From 651270b90d79ded4a407c75642fc47872f0ac8ce Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 2 Sep 2006 10:56:48 +0000 Subject: (refs #3) Added a RunCommand() function which converts UNIX paths to native before calling ::system() on Win32. --- lib/common/Test.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/common/Test.h') diff --git a/lib/common/Test.h b/lib/common/Test.h index 75ed93aa..5e42e406 100644 --- a/lib/common/Test.h +++ b/lib/common/Test.h @@ -79,7 +79,7 @@ inline int TestGetFileSize(const char *Filename) return -1; } -inline int LaunchServer(const char *pCommandLine, const char *pidFile) +inline int RunCommand(const char *pCommandLine) { #ifdef WIN32 // convert UNIX paths to native @@ -101,7 +101,12 @@ inline int LaunchServer(const char *pCommandLine, const char *pidFile) std::string command = pCommandLine; #endif - if(::system(command.c_str()) != 0) + return ::system(command.c_str()); +} + +inline int LaunchServer(const char *pCommandLine, const char *pidFile) +{ + if(RunCommand(pCommandLine) != 0) { printf("Server: %s\n", command.c_str()); TEST_FAIL_WITH_MESSAGE("Couldn't start server"); -- cgit v1.2.3