Changeset 9eb1ff5 in mainline for uspace/lib/pcut/src/os/generic.c
- Timestamp:
- 2017-12-08T14:47:08Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c1694b6b
- Parents:
- 6fb8b2c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/os/generic.c
r6fb8b2c r9eb1ff5 34 34 #include <stdlib.h> 35 35 #include <stdio.h> 36 #include <sys/types.h> 36 37 #include <errno.h> 37 38 #include <assert.h> … … 94 95 static int convert_wait_status_to_outcome(int status) { 95 96 if (status < 0) { 96 return TEST_OUTCOME_ERROR;97 return PCUT_OUTCOME_INTERNAL_ERROR; 97 98 } else if (status == 0) { 98 return TEST_OUTCOME_PASS;99 return PCUT_OUTCOME_PASS; 99 100 } else { 100 return TEST_OUTCOME_FAIL;101 return PCUT_OUTCOME_FAIL; 101 102 } 102 103 } … … 107 108 * @param test Test to be run. 108 109 */ 109 voidpcut_run_test_forking(const char *self_path, pcut_item_t *test) {110 int rc ;110 int pcut_run_test_forking(const char *self_path, pcut_item_t *test) { 111 int rc, outcome; 111 112 FILE *tempfile; 112 113 char tempfile_name[PCUT_TEMP_FILENAME_BUFFER_SIZE]; … … 126 127 PCUT_DEBUG("system() returned 0x%04X", rc); 127 128 128 rc= convert_wait_status_to_outcome(rc);129 outcome = convert_wait_status_to_outcome(rc); 129 130 130 131 tempfile = fopen(tempfile_name, "rb"); 131 132 if (tempfile == NULL) { 132 133 pcut_report_test_done(test, TEST_OUTCOME_ERROR, "Failed to open temporary file.", NULL, NULL); 133 return ;134 return PCUT_OUTCOME_INTERNAL_ERROR; 134 135 } 135 136 136 137 fread(extra_output_buffer, 1, OUTPUT_BUFFER_SIZE, tempfile); 137 138 fclose(tempfile); 138 unlink(tempfile_name);139 remove(tempfile_name); 139 140 140 pcut_report_test_done_unparsed(test, rc, extra_output_buffer, OUTPUT_BUFFER_SIZE); 141 pcut_report_test_done_unparsed(test, outcome, extra_output_buffer, OUTPUT_BUFFER_SIZE); 142 143 return outcome; 141 144 } 142 145
Note:
See TracChangeset
for help on using the changeset viewer.