Changeset 927 for box/chris/merge/lib/common/Test.h
- Timestamp:
- 02/09/2006 11:44:29 (6 years ago)
- File:
-
- 1 edited
-
box/chris/merge/lib/common/Test.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/chris/merge/lib/common/Test.h
r456 r927 80 80 } 81 81 82 inline int LaunchServer(const char *CommandLine, const char *pidFile) 83 { 84 if(::system(CommandLine) != 0) 85 { 86 printf("Server: %s\n", CommandLine); 82 inline int LaunchServer(const char *pCommandLine, const char *pidFile) 83 { 84 #ifdef WIN32 85 // convert UNIX paths to native 86 87 std::string command; 88 for (int i = 0; pCommandLine[i] != 0; i++) 89 { 90 if (pCommandLine[i] == '/') 91 { 92 command += '\\'; 93 } 94 else 95 { 96 command += pCommandLine[i]; 97 } 98 } 99 100 #else // !WIN32 101 std::string command = pCommandLine; 102 #endif 103 104 if(::system(command.c_str()) != 0) 105 { 106 printf("Server: %s\n", command.c_str()); 87 107 TEST_FAIL_WITH_MESSAGE("Couldn't start server"); 88 108 return -1; … … 94 114 if(!TestFileExists(pidFile)) 95 115 { 96 printf("Server: %s\n", CommandLine);116 printf("Server: %s\n", command.c_str()); 97 117 TEST_FAIL_WITH_MESSAGE("Server didn't save PID file"); 98 118 return -1; … … 103 123 if(f == NULL || fscanf(f, "%d", &pid) != 1) 104 124 { 105 printf("Server: %s (pidfile %s)\n", CommandLine, pidFile);125 printf("Server: %s (pidfile %s)\n", command.c_str(), pidFile); 106 126 TEST_FAIL_WITH_MESSAGE("Couldn't read PID file"); 107 127 return -1;
Note: See TracChangeset
for help on using the changeset viewer.
