Changes in uspace/lib/pcut/src/os/windows.c [9eb1ff5:9b20126] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/os/windows.c
r9eb1ff5 r9b20126 144 144 * @param test Test to be run. 145 145 */ 146 intpcut_run_test_forking(const char *self_path, pcut_item_t *test) {146 void pcut_run_test_forking(const char *self_path, pcut_item_t *test) { 147 147 /* TODO: clean-up if something goes wrong "in the middle" */ 148 148 BOOL okay = FALSE; … … 173 173 if (!okay) { 174 174 report_func_fail(test, "CreatePipe(/* stdout */)"); 175 return PCUT_OUTCOME_INTERNAL_ERROR;175 return; 176 176 } 177 177 okay = SetHandleInformation(link_stdout[0], HANDLE_FLAG_INHERIT, 0); 178 178 if (!okay) { 179 179 report_func_fail(test, "SetHandleInformation(/* stdout */)"); 180 return PCUT_OUTCOME_INTERNAL_ERROR;180 return; 181 181 } 182 182 … … 185 185 if (!okay) { 186 186 report_func_fail(test, "CreatePipe(/* stderr */)"); 187 return PCUT_OUTCOME_INTERNAL_ERROR;187 return; 188 188 } 189 189 okay = SetHandleInformation(link_stderr[0], HANDLE_FLAG_INHERIT, 0); 190 190 if (!okay) { 191 191 report_func_fail(test, "SetHandleInformation(/* stderr */)"); 192 return PCUT_OUTCOME_INTERNAL_ERROR;192 return; 193 193 } 194 194 … … 197 197 if (!okay) { 198 198 report_func_fail(test, "CreatePipe(/* stdin */)"); 199 return PCUT_OUTCOME_INTERNAL_ERROR;199 return; 200 200 } 201 201 okay = SetHandleInformation(link_stdin[1], HANDLE_FLAG_INHERIT, 0); 202 202 if (!okay) { 203 203 report_func_fail(test, "SetHandleInformation(/* stdin */)"); 204 return PCUT_OUTCOME_INTERNAL_ERROR;204 return; 205 205 } 206 206 … … 224 224 if (!okay) { 225 225 report_func_fail(test, "CreateProcess()"); 226 return PCUT_OUTCOME_INTERNAL_ERROR;226 return; 227 227 } 228 228 … … 236 236 if (!okay) { 237 237 report_func_fail(test, "CloseHandle(/* stdout */)"); 238 return PCUT_OUTCOME_INTERNAL_ERROR;238 return; 239 239 } 240 240 okay = CloseHandle(link_stderr[1]); 241 241 if (!okay) { 242 242 report_func_fail(test, "CloseHandle(/* stderr */)"); 243 return PCUT_OUTCOME_INTERNAL_ERROR;243 return; 244 244 } 245 245 okay = CloseHandle(link_stdin[0]); 246 246 if (!okay) { 247 247 report_func_fail(test, "CloseHandle(/* stdin */)"); 248 return PCUT_OUTCOME_INTERNAL_ERROR;248 return; 249 249 } 250 250 … … 267 267 if (test_output_thread_reader == NULL) { 268 268 report_func_fail(test, "CreateThread(/* read test stdout */)"); 269 return PCUT_OUTCOME_INTERNAL_ERROR;269 return; 270 270 } 271 271 … … 281 281 if (!okay) { 282 282 report_func_fail(test, "TerminateProcess(/* PROCESS_INFORMATION.hProcess */)"); 283 return PCUT_ERROR_INTERNAL_FAILURE;283 return; 284 284 } 285 285 rc = WaitForSingleObject(process_info.hProcess, INFINITE); … … 287 287 if (rc != WAIT_OBJECT_0) { 288 288 report_func_fail(test, "WaitForSingleObject(/* PROCESS_INFORMATION.hProcess */)"); 289 return PCUT_OUTCOME_INTERNAL_ERROR;289 return; 290 290 } 291 291 … … 294 294 if (!okay) { 295 295 report_func_fail(test, "GetExitCodeProcess()"); 296 return PCUT_OUTCOME_INTERNAL_ERROR;296 return; 297 297 } 298 298 299 299 if (rc == 0) { 300 outcome = PCUT_OUTCOME_PASS;300 outcome = TEST_OUTCOME_PASS; 301 301 } else if ((rc > 0) && (rc < 10) && !timed_out) { 302 outcome = PCUT_OUTCOME_FAIL;302 outcome = TEST_OUTCOME_FAIL; 303 303 } else { 304 outcome = PCUT_OUTCOME_INTERNAL_ERROR;304 outcome = TEST_OUTCOME_ERROR; 305 305 } 306 306 … … 309 309 if (rc != WAIT_OBJECT_0) { 310 310 report_func_fail(test, "WaitForSingleObject(/* stdout reader thread */)"); 311 return PCUT_ERROR_INTERNAL_FAILURE;311 return; 312 312 } 313 313 314 314 pcut_report_test_done_unparsed(test, outcome, extra_output_buffer, OUTPUT_BUFFER_SIZE); 315 316 return outcome;317 315 } 318 316
Note:
See TracChangeset
for help on using the changeset viewer.