Changeset 1433ecda in mainline for uspace/lib/pcut/src/run.c
- Timestamp:
- 2018-04-04T15:42:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/run.c
r47b2d7e3 r1433ecda 73 73 static int default_suite_initialized = 0; 74 74 75 static void init_default_suite_when_needed() { 75 static void init_default_suite_when_needed() 76 { 76 77 if (default_suite_initialized) { 77 78 return; … … 91 92 * @return Always a valid test suite item. 92 93 */ 93 static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it) { 94 static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it) 95 { 94 96 while (it != NULL) { 95 97 if (it->kind == PCUT_KIND_TESTSUITE) { … … 106 108 * @param func Function to run (can be NULL). 107 109 */ 108 static void run_setup_teardown(pcut_setup_func_t func) { 110 static void run_setup_teardown(pcut_setup_func_t func) 111 { 109 112 if (func != NULL) { 110 113 func(); … … 119 122 * @param outcome Outcome of the current test. 120 123 */ 121 static void leave_test(int outcome) { 124 static void leave_test(int outcome) 125 { 122 126 PCUT_DEBUG("leave_test(outcome=%d), will_exit=%s", outcome, 123 127 leave_means_exit ? "yes" : "no"); 124 128 if (leave_means_exit) { 125 129 exit(outcome); … … 138 142 * @param message Message describing the failure. 139 143 */ 140 void pcut_failed_assertion(const char *message) { 144 void pcut_failed_assertion(const char *message) 145 { 141 146 static const char *prev_message = NULL; 142 147 /* … … 157 162 if (report_test_result) { 158 163 pcut_report_test_done(current_test, PCUT_OUTCOME_FAIL, 159 164 message, NULL, NULL); 160 165 } 161 166 } else { 162 167 if (report_test_result) { 163 168 pcut_report_test_done(current_test, PCUT_OUTCOME_FAIL, 164 169 prev_message, message, NULL); 165 170 } 166 171 } … … 176 181 * @return Error status (zero means success). 177 182 */ 178 static int run_test(pcut_item_t *test) { 183 static int run_test(pcut_item_t *test) 184 { 179 185 /* 180 186 * Set here as the returning point in case of test failure. … … 228 234 if (report_test_result) { 229 235 pcut_report_test_done(current_test, PCUT_OUTCOME_PASS, 230 236 NULL, NULL, NULL); 231 237 } 232 238 … … 242 248 * @return Error status (zero means success). 243 249 */ 244 int pcut_run_test_forked(pcut_item_t *test) { 250 int pcut_run_test_forked(pcut_item_t *test) 251 { 245 252 int rc; 246 253 … … 265 272 * @return Error status (zero means success). 266 273 */ 267 int pcut_run_test_single(pcut_item_t *test) { 274 int pcut_run_test_single(pcut_item_t *test) 275 { 268 276 int rc; 269 277 … … 285 293 * @return Timeout in seconds. 286 294 */ 287 int pcut_get_test_timeout(pcut_item_t *test) { 295 int pcut_get_test_timeout(pcut_item_t *test) 296 { 288 297 int timeout = PCUT_DEFAULT_TEST_TIMEOUT; 289 298 pcut_extra_t *extras = test->extras;
Note:
See TracChangeset
for help on using the changeset viewer.