summaryrefslogtreecommitdiff
path: root/lib/common/Test.h
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-09-02 10:56:48 +0000
committerChris Wilson <chris+github@qwirx.com>2006-09-02 10:56:48 +0000
commit651270b90d79ded4a407c75642fc47872f0ac8ce (patch)
tree533391d5514baf6d5805a1130787c5a91ebba88c /lib/common/Test.h
parentaae9bedf46cd180f89a961d2cc77cf6c7fcc3055 (diff)
(refs #3)
Added a RunCommand() function which converts UNIX paths to native before calling ::system() on Win32.
Diffstat (limited to 'lib/common/Test.h')
-rw-r--r--lib/common/Test.h9
1 files changed, 7 insertions, 2 deletions
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");