static void cute_reporter_testcase_finished(TestReporter *reporter, const char *filename, int line, const char *message, uint32_t duration_in_milliseconds) { CuteMemo *memo = (CuteMemo *) reporter->memo; const char *name = get_current_from_breadcrumb((CgreenBreadcrumb *)reporter->breadcrumb); reporter_finish(reporter, filename, line, message, duration_in_milliseconds); if (memo->error_count == reporter->failures + reporter->exceptions) { memo->printer("#success %s, %d ms OK\n", name); } }
static void cute_reporter_suite_finished(TestReporter *reporter, const char *filename, int line, uint32_t duration_in_milliseconds) { CuteMemo *memo = (CuteMemo *) reporter->memo; const char *name = get_current_from_breadcrumb((CgreenBreadcrumb *)reporter->breadcrumb); reporter_finish(reporter, filename, line, NULL, duration_in_milliseconds); memo->printer("#ending %s", name); if (get_breadcrumb_depth((CgreenBreadcrumb *) reporter->breadcrumb) == 0) { memo->printer(": %d pass%s, %d failure%s, %d exception%s, %d ms.\n", reporter->passes, reporter->passes == 1 ? "" : "es", reporter->failures, reporter->failures == 1 ? "" : "s", reporter->exceptions, reporter->exceptions == 1 ? "" : "s", duration_in_milliseconds); } else memo->printer("\n"); }
void run_specified_test_if_child(TestSuite *suite, TestReporter *reporter){ //figure out if we are a child process, and if so, use the test name provided by our parent char testName[256]; DWORD result = GetEnvironmentVariableA(CGREEN_TEST_TO_RUN,testName,sizeof(testName)); if (result) //we are a child process, only run the specified test { //May have to deal with some issues here. I don't call the function pointer for //reporter start and finish in order to avoid extraneous prints to the console, //but this may cause problems for other types of reporters. Not sure the //best solution for this. reporter_start(reporter, testName); //add breadcrumb without triggering output to console run_named_test_child(suite, testName, reporter); reporter_finish(reporter, suite->filename, suite->line, NULL); return; //never happens because we call stop inside run_named_test_child } }
static void text_reporter_finish(TestReporter *reporter, const char *filename, int line, const char *message, uint32_t duration_in_milliseconds) { reporter_finish(reporter, filename, line, message, duration_in_milliseconds); }
static void text_reporter_finish(TestReporter *reporter, const char *filename, int line, const char *message) { reporter_finish(reporter, filename, line, message); }
static void cdash_reporter_suite_finished(TestReporter *reporter, const char *filename, int line, uint32_t duration_in_milliseconds) { reporter_finish(reporter, filename, line, NULL, duration_in_milliseconds); }