Changeset 4b54bd9 in mainline for uspace/lib/pcut/src/run.c
- Timestamp:
- 2018-09-12T13:23:03Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3da0ee4
- Parents:
- 275530a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/run.c
r275530a4 r4b54bd9 33 33 34 34 #include "internal.h" 35 35 36 #ifndef PCUT_NO_LONG_JUMP 37 #pragma warning(push, 0) 36 38 #include <setjmp.h> 39 #pragma warning(pop) 37 40 #endif 38 41 … … 73 76 static int default_suite_initialized = 0; 74 77 75 static void init_default_suite_when_needed() 76 { 78 static void init_default_suite_when_needed() { 77 79 if (default_suite_initialized) { 78 80 return; … … 92 94 * @return Always a valid test suite item. 93 95 */ 94 static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it) 95 { 96 static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it) { 96 97 while (it != NULL) { 97 98 if (it->kind == PCUT_KIND_TESTSUITE) { … … 108 109 * @param func Function to run (can be NULL). 109 110 */ 110 static void run_setup_teardown(pcut_setup_func_t func) 111 { 111 static void run_setup_teardown(pcut_setup_func_t func) { 112 112 if (func != NULL) { 113 113 func(); … … 122 122 * @param outcome Outcome of the current test. 123 123 */ 124 static void leave_test(int outcome) 125 { 124 static void leave_test(int outcome) { 126 125 PCUT_DEBUG("leave_test(outcome=%d), will_exit=%s", outcome, 127 126 leave_means_exit ? "yes" : "no"); 128 127 if (leave_means_exit) { 129 128 exit(outcome); … … 142 141 * @param message Message describing the failure. 143 142 */ 144 void pcut_failed_assertion(const char *message) 145 { 143 void pcut_failed_assertion(const char *message) { 146 144 static const char *prev_message = NULL; 147 145 /* … … 162 160 if (report_test_result) { 163 161 pcut_report_test_done(current_test, PCUT_OUTCOME_FAIL, 164 162 message, NULL, NULL); 165 163 } 166 164 } else { 167 165 if (report_test_result) { 168 166 pcut_report_test_done(current_test, PCUT_OUTCOME_FAIL, 169 167 prev_message, message, NULL); 170 168 } 171 169 } … … 181 179 * @return Error status (zero means success). 182 180 */ 183 static int run_test(pcut_item_t *test) 184 { 181 static int run_test(pcut_item_t *test) { 185 182 /* 186 183 * Set here as the returning point in case of test failure. … … 234 231 if (report_test_result) { 235 232 pcut_report_test_done(current_test, PCUT_OUTCOME_PASS, 236 233 NULL, NULL, NULL); 237 234 } 238 235 … … 248 245 * @return Error status (zero means success). 249 246 */ 250 int pcut_run_test_forked(pcut_item_t *test) 251 { 247 int pcut_run_test_forked(pcut_item_t *test) { 252 248 int rc; 253 249 … … 272 268 * @return Error status (zero means success). 273 269 */ 274 int pcut_run_test_single(pcut_item_t *test) 275 { 270 int pcut_run_test_single(pcut_item_t *test) { 276 271 int rc; 277 272 … … 293 288 * @return Timeout in seconds. 294 289 */ 295 int pcut_get_test_timeout(pcut_item_t *test) 296 { 290 int pcut_get_test_timeout(pcut_item_t *test) { 297 291 int timeout = PCUT_DEFAULT_TEST_TIMEOUT; 298 292 pcut_extra_t *extras = test->extras;
Note:
See TracChangeset
for help on using the changeset viewer.