Example #1
0
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);
}
Example #2
0
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);
}