예제 #1
0
파일: runner.c 프로젝트: thoni56/cgreen
void run_the_test_code(TestSuite *suite, CgreenTest *spec, TestReporter *reporter) {
    significant_figures_for_assert_double_are(8);
    clear_mocks();

    if (per_test_timeout_defined()) {
        validate_per_test_timeout_value();

        die_in(per_test_timeout_value());
    }

    // for historical reasons the suite can have a setup
    if(has_setup(suite)) {
        (*suite->setup)();
    } else {
        if (spec->context->setup != NULL) {
            run_setup_for(spec);
        }
    }

    run(spec);
    // for historical reasons the suite can have a teardown
    if (has_teardown(suite)) {
        (*suite->teardown)();
    } else {
        if (spec->context->teardown != NULL) {
            run_teardown_for(spec);
        }
    }

    tally_mocks(reporter);
}
예제 #2
0
파일: unit.c 프로젝트: jorgenpt/cgreen
static void run_the_test_code(TestSuite *suite, UnitTest *test, TestReporter *reporter) {
    significant_figures_for_assert_double_are(8);
    clear_mocks();
	(*suite->setup)();
    (*test->test)();
	(*suite->teardown)();
	tally_mocks(reporter);
}