From b90727839ce006bc275c0bb714e34efdacb84ae5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 24 Dec 2015 00:21:50 +0000 Subject: Fix test/httpserver startup on Windows (compiled with MSVC). Avoid using the rm command, and use the correct name for the test executables compiled by our cmake alternate build system. --- test/httpserver/testhttpserver.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/httpserver/testhttpserver.cpp b/test/httpserver/testhttpserver.cpp index 17af1905..b188a648 100644 --- a/test/httpserver/testhttpserver.cpp +++ b/test/httpserver/testhttpserver.cpp @@ -36,6 +36,12 @@ #define SHORT_TIMEOUT 5000 +#ifdef _MSC_VER +# define TEST_EXECUTABLE "test_httpserver.exe" +#else +# define TEST_EXECUTABLE "./_test" +#endif + class TestWebServer : public HTTPServer { public: @@ -144,10 +150,12 @@ int test(int argc, const char *argv[]) return server.Main("doesnotexist", argc - 1, argv + 1); } +#ifndef WIN32 TEST_THAT(system("rm -rf *.memleaks") == 0); +#endif // Start the server - int pid = StartDaemon(0, "./_test server testfiles/httpserver.conf", + int pid = StartDaemon(0, TEST_EXECUTABLE " server testfiles/httpserver.conf", "testfiles/httpserver.pid"); TEST_THAT_OR(pid > 0, return 1); @@ -379,7 +387,7 @@ int test(int argc, const char *argv[]) } // Start the S3Simulator server - pid = StartDaemon(0, "./_test s3server testfiles/s3simulator.conf", + pid = StartDaemon(0, TEST_EXECUTABLE " s3server testfiles/s3simulator.conf", "testfiles/s3simulator.pid"); TEST_THAT_OR(pid > 0, return 1); -- cgit v1.2.3