Changes in uspace/lib/pcut/src/os/helenos.c [b7fd2a0:8e3498b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/os/helenos.c
rb7fd2a0 r8e3498b 68 68 } 69 69 70 void pcut_str_error( errno_t error, char *buffer, int size) {70 void pcut_str_error(int error, char *buffer, int size) { 71 71 const char *str = str_error(error); 72 72 if (str == NULL) { … … 130 130 * @return EOK Always. 131 131 */ 132 static errno_t test_timeout_handler_fibril(void *arg) {132 static int test_timeout_handler_fibril(void *arg) { 133 133 pcut_item_t *test = arg; 134 134 int timeout_sec = pcut_get_test_timeout(test); … … 139 139 goto leave_no_kill; 140 140 } 141 errno_t rc = fibril_condvar_wait_timeout(&forced_termination_cv,141 int rc = fibril_condvar_wait_timeout(&forced_termination_cv, 142 142 &forced_termination_mutex, timeout_us); 143 143 if (rc == ETIMEOUT) { … … 154 154 * @param test Test to be run. 155 155 */ 156 intpcut_run_test_forking(const char *self_path, pcut_item_t *test) {156 void pcut_run_test_forking(const char *self_path, pcut_item_t *test) { 157 157 before_test_start(test); 158 158 159 159 char tempfile_name[PCUT_TEMP_FILENAME_BUFFER_SIZE]; 160 160 snprintf(tempfile_name, PCUT_TEMP_FILENAME_BUFFER_SIZE - 1, "pcut_%lld.tmp", (unsigned long long) task_get_id()); 161 int tempfile; 162 errno_t rc = vfs_lookup_open(tempfile_name, WALK_REGULAR | WALK_MAY_CREATE, MODE_READ | MODE_WRITE, &tempfile); 163 if (rc != EOK) { 164 pcut_report_test_done(test, PCUT_OUTCOME_INTERNAL_ERROR, "Failed to create temporary file.", NULL, NULL); 165 return PCUT_OUTCOME_INTERNAL_ERROR; 161 int tempfile = vfs_lookup_open(tempfile_name, WALK_REGULAR | WALK_MAY_CREATE, MODE_READ | MODE_WRITE); 162 if (tempfile < 0) { 163 pcut_report_test_done(test, TEST_OUTCOME_ERROR, "Failed to create temporary file.", NULL, NULL); 164 return; 166 165 } 167 166 … … 175 174 }; 176 175 177 int status = PCUT_OUTCOME_PASS;176 int status = TEST_OUTCOME_PASS; 178 177 179 178 task_wait_t test_task_wait; 180 rc = task_spawnvf(&test_task_id, &test_task_wait, self_path, arguments,179 int rc = task_spawnvf(&test_task_id, &test_task_wait, self_path, arguments, 181 180 fileno(stdin), tempfile, tempfile); 182 181 if (rc != EOK) { 183 status = PCUT_OUTCOME_INTERNAL_ERROR;182 status = TEST_OUTCOME_ERROR; 184 183 goto leave_close_tempfile; 185 184 } … … 199 198 rc = task_wait(&test_task_wait, &task_exit, &task_retval); 200 199 if (rc != EOK) { 201 status = PCUT_OUTCOME_INTERNAL_ERROR;200 status = TEST_OUTCOME_ERROR; 202 201 goto leave_close_tempfile; 203 202 } 204 203 if (task_exit == TASK_EXIT_UNEXPECTED) { 205 status = PCUT_OUTCOME_INTERNAL_ERROR;204 status = TEST_OUTCOME_ERROR; 206 205 } else { 207 status = task_retval == 0 ? PCUT_OUTCOME_PASS : PCUT_OUTCOME_FAIL;206 status = task_retval == 0 ? TEST_OUTCOME_PASS : TEST_OUTCOME_FAIL; 208 207 } 209 208 … … 222 221 223 222 pcut_report_test_done_unparsed(test, status, extra_output_buffer, OUTPUT_BUFFER_SIZE); 224 225 return status;226 223 } 227 224
Note:
See TracChangeset
for help on using the changeset viewer.