示例#1
0
static void text_reporter_finish_suite(TestReporter *reporter, const char *file, int line, uint32_t duration_in_milliseconds) {
    const char *name = get_current_from_breadcrumb((CgreenBreadcrumb *) reporter->breadcrumb);
    bool use_colors = reporter->options && ((TextReporterOptions *)reporter->options)->use_colours;
    TextMemo *memo = (TextMemo *)reporter->memo;
    
    reporter_finish_suite(reporter, file, line, duration_in_milliseconds);

    if (have_quiet_mode(reporter)) {
        memo->printer(".");
        if (get_breadcrumb_depth((CgreenBreadcrumb *) reporter->breadcrumb) == 0)
            memo->printer("\n");
    } else {
        char buf[1000];
        sprintf(buf, "Completed \"%s\": ", name);
        if (reporter->passes)
            strcat(buf, format_passes(reporter->passes, use_colors));
        if (reporter->skips) {
            insert_comma(buf);
            strcat(buf, format_skips(reporter->skips, use_colors));
        }
        if (reporter->failures) {
            insert_comma(buf);
            strcat(buf, format_failures(reporter->failures, use_colors));
        }
        if (reporter->exceptions) {
            insert_comma(buf);
            strcat(buf, format_exceptions(reporter->exceptions, use_colors));
        }
        memo->printer("%s in %dms.\n", buf, duration_in_milliseconds);
    }
}
示例#2
0
static void text_reporter_start_suite(TestReporter *reporter, const char *name,
		const int number_of_tests) {
	reporter_start(reporter, name);
	if (get_breadcrumb_depth((CgreenBreadcrumb *) reporter->breadcrumb) == 1) {
		printf("Running \"%s\" (%d tests)...\n",
				get_current_from_breadcrumb(
						(CgreenBreadcrumb *) reporter->breadcrumb),
				number_of_tests);
        fflush(stdout);
	}
}
示例#3
0
static void text_reporter_start_suite(TestReporter *reporter, const char *name,
		const int number_of_tests) {
    TextMemo *memo = (TextMemo *)reporter->memo;
    
    reporter_start_test(reporter, name);
    if (get_breadcrumb_depth((CgreenBreadcrumb *) reporter->breadcrumb) == 1) {
        memo->printer("Running \"%s\" (%d tests)%s",
                      get_current_from_breadcrumb((CgreenBreadcrumb *) reporter->breadcrumb),
                      number_of_tests,
                      have_quiet_mode(reporter)?":":"...\n");
        fflush(stdout);
    }
}
示例#4
0
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");
}
示例#5
0
static void text_reporter_finish_suite(TestReporter *reporter, const char *file, int line, uint32_t duration_in_milliseconds) {
	const char *name = get_current_from_breadcrumb((CgreenBreadcrumb *) reporter->breadcrumb);
    bool use_colors = reporter->options && ((TextReporterOptions *)reporter->options)->use_colours;

    reporter_finish_suite(reporter, file, line, duration_in_milliseconds);

    if (have_quiet_mode(reporter)) {
        printf(".");
        if (get_breadcrumb_depth((CgreenBreadcrumb *) reporter->breadcrumb) == 0)
            printf("\n");
    } else {
        printf("Completed \"%s\": %s, %s, %s in %dms.\n",
               name,
               format_passes(reporter->passes, use_colors),
               format_failures(reporter->failures, use_colors),
               format_exceptions(reporter->exceptions, use_colors),
               duration_in_milliseconds);
    }
}