- continue;
- }
-
- stats.collection_total++;
-
- bool failed= false;
- bool skipped= false;
- test_return_t collection_rc;
- if (test_success(collection_rc= frame->runner()->pre(next->pre, creators_ptr)))
- {
- Out << "Collection: " << next->name;
-
- for (test_st *run= next->tests; run->name; run++)
- {
- long int load_time= 0;
-
- if (wildcard && fnmatch(wildcard, run->name, 0))
- {
- continue;
- }
-
- test_return_t return_code;
- try
- {
- if (run->requires_flush)
- {
- if (test_failed(frame->runner()->flush(creators_ptr)))
- {
- Error << "frame->runner()->flush(creators_ptr)";
- continue;
- }
- }
-
- return_code= runner_code(frame.get(), run, creators_ptr, load_time);
-
- if (return_code == TEST_SKIPPED)
- { }
- else if (return_code == TEST_FAILURE)
- {
-#if 0
- Error << " frame->runner()->run(failure)";
- signal.set_shutdown(SHUTDOWN_GRACEFUL);
-#endif
- }
-
- }
- catch (libtest::fatal &e)
- {
- Error << "Fatal exception was thrown: " << e.what();
- return_code= TEST_FAILURE;
- throw;
- }
- catch (std::exception &e)
- {
- Error << "Exception was thrown: " << e.what();
- return_code= TEST_FAILURE;
- throw;
- }
- catch (...)
- {
- Error << "Unknown exception occurred";
- return_code= TEST_FAILURE;
- throw;
- }
-
- stats.total++;
-
- switch (return_code)
- {
- case TEST_SUCCESS:
- Out << "\tTesting " << run->name << "\t\t\t\t\t" << load_time / 1000 << "." << load_time % 1000 << "[ " << test_strerror(return_code) << " ]";
- stats.success++;
- break;
-
- case TEST_FAILURE:
- stats.failed++;
- failed= true;
- Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
- break;
-
- case TEST_SKIPPED:
- stats.skipped++;
- skipped= true;
- Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
- break;
-
- default:
- fatal_message("invalid return code");
- }
-#if 0
- @TODO add code here to allow for a collection to define a method to reset to allow tests to continue.
-#endif
- }
-
- (void) frame->runner()->post(next->post, creators_ptr);
- }
- else if (collection_rc == TEST_FAILURE)
- {
- Out << next->name << " [ failed ]";
- failed= true;
-#if 0
- signal.set_shutdown(SHUTDOWN_GRACEFUL);
-#endif
- }
- else if (collection_rc == TEST_SKIPPED)
- {
- Out << next->name << " [ skipping ]";
- skipped= true;
- }
-
- if (failed == false and skipped == false)
- {
- stats.collection_success++;
- }