From 2be8f78982755794586d7640c702018feb6897aa Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Jun 2021 01:05:03 +0100 Subject: [PATCH] Make wxExecute() unit test work when using Wine too Use wxTEST_RUNNER in this test, which can be/is set to "wine" by the GitHub wxMSW CI workflow and can also be set manually if necessary, to make executing MSW commands under non-MSW systems have a chance to actually work (but note that the tests still fail when run under Wine). --- tests/exec/exec.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/exec/exec.cpp b/tests/exec/exec.cpp index 5afe329d4d..69b7eb3c17 100644 --- a/tests/exec/exec.cpp +++ b/tests/exec/exec.cpp @@ -116,7 +116,13 @@ private: wxProcess* callback_ = NULL) { forceExitLoop = forceExitLoop_; - command = command_; + + // Prepend the command with the value of wxTEST_RUNNER if it's + // defined to make this test work when using Wine too. + if ( wxGetEnv("wxTEST_RUNNER", &command) ) + command += ' '; + command += command_; + flags = flags_; callback = callback_;