Changeset 9b20126 in mainline for uspace/lib/pcut/src/os/generic.c
- Timestamp:
- 2014-09-19T08:23:01Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c85a57f
- Parents:
- 15d0046
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/os/generic.c
r15d0046 r9b20126 33 33 34 34 #include <stdlib.h> 35 #include <stdio.h> 35 36 #include <sys/types.h> 36 37 #include <errno.h> … … 50 51 /* Format the command to launch a test according to OS we are running on. */ 51 52 52 #if defined(__WIN64) || defined(__WIN32) 53 #if defined(__WIN64) || defined(__WIN32) || defined(_WIN32) 53 54 #include <process.h> 54 55 … … 108 109 */ 109 110 void pcut_run_test_forking(const char *self_path, pcut_item_t *test) { 111 int rc; 112 FILE *tempfile; 113 char tempfile_name[PCUT_TEMP_FILENAME_BUFFER_SIZE]; 114 char command[PCUT_COMMAND_LINE_BUFFER_SIZE]; 115 110 116 before_test_start(test); 111 117 112 char tempfile_name[PCUT_TEMP_FILENAME_BUFFER_SIZE];113 118 FORMAT_TEMP_FILENAME(tempfile_name, PCUT_TEMP_FILENAME_BUFFER_SIZE - 1); 114 115 char command[PCUT_COMMAND_LINE_BUFFER_SIZE];116 119 FORMAT_COMMAND(command, PCUT_COMMAND_LINE_BUFFER_SIZE - 1, 117 120 self_path, (test)->id, tempfile_name); 121 122 PCUT_DEBUG("Will execute <%s> (temp file <%s>) with system().", 123 command, tempfile_name); 118 124 119 int rc = system(command); 125 rc = system(command); 126 127 PCUT_DEBUG("system() returned 0x%04X", rc); 128 120 129 rc = convert_wait_status_to_outcome(rc); 121 130 122 FILE *tempfile = fopen(tempfile_name, "rb");131 tempfile = fopen(tempfile_name, "rb"); 123 132 if (tempfile == NULL) { 124 133 pcut_report_test_done(test, TEST_OUTCOME_ERROR, "Failed to open temporary file.", NULL, NULL); … … 133 142 } 134 143 144 void pcut_hook_before_test(pcut_item_t *test) { 145 PCUT_UNUSED(test); 146 147 /* Do nothing. */ 148 } 149
Note:
See TracChangeset
for help on using the changeset viewer.