diff options
-rw-r--r-- | lib/common/Test.h | 8 | ||||
-rw-r--r-- | test/basicserver/testbasicserver.cpp | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/common/Test.h b/lib/common/Test.h index 15a3db6f..36cd6a59 100644 --- a/lib/common/Test.h +++ b/lib/common/Test.h @@ -243,4 +243,12 @@ void safe_sleep(int seconds); std::auto_ptr<Configuration> load_config_file(const std::string& config_file, const ConfigurationVerify& verify); +#ifdef _MSC_VER + // Our CMakeFiles compile tests to different executable filenames, + // e.g. test_common.exe instead of _test.exe. + #define TEST_EXECUTABLE BOX_MODULE ".exe" +#else + #define TEST_EXECUTABLE "./_test" +#endif + #endif // TEST__H diff --git a/test/basicserver/testbasicserver.cpp b/test/basicserver/testbasicserver.cpp index 9e3b8890..6a1e15ad 100644 --- a/test/basicserver/testbasicserver.cpp +++ b/test/basicserver/testbasicserver.cpp @@ -485,7 +485,7 @@ int test(int argc, const char *argv[]) // Launch a basic server { - std::string cmd = "./_test --test-daemon-args="; + std::string cmd = TEST_EXECUTABLE " --test-daemon-args="; cmd += test_args; cmd += " srv1 testfiles/srv1.conf"; int pid = LaunchServer(cmd, "testfiles/srv1.pid"); @@ -531,7 +531,7 @@ int test(int argc, const char *argv[]) // Launch a test forking server { - std::string cmd = "./_test --test-daemon-args="; + std::string cmd = TEST_EXECUTABLE " --test-daemon-args="; cmd += test_args; cmd += " srv2 testfiles/srv2.conf"; int pid = LaunchServer(cmd, "testfiles/srv2.pid"); @@ -601,7 +601,7 @@ int test(int argc, const char *argv[]) // Launch a test SSL server { - std::string cmd = "./_test --test-daemon-args="; + std::string cmd = TEST_EXECUTABLE " --test-daemon-args="; cmd += test_args; cmd += " srv3 testfiles/srv3.conf"; int pid = LaunchServer(cmd, "testfiles/srv3.pid"); @@ -682,7 +682,7 @@ int test(int argc, const char *argv[]) //protocolserver: // Launch a test protocol handling server { - std::string cmd = "./_test --test-daemon-args="; + std::string cmd = TEST_EXECUTABLE " --test-daemon-args="; cmd += test_args; cmd += " srv4 testfiles/srv4.conf"; int pid = LaunchServer(cmd, "testfiles/srv4.pid"); |