Exemplo n.º 1
0
void
tap_plan(unsigned tests, unsigned flags, FILE * output)
{
    LOCK;

    tap_flags = flags;
    tap_init(output != NULL ? output : stdout);

    if (have_plan != 0) {
        fprintf(stderr, "You tried to plan twice!\n");
        test_died = 1;
        UNLOCK;
        exit(255);
    }

    if (tests == 0) {
        fprintf(stderr, "You said to run 0 tests!  You've got to run something.\n");
        test_died = 1;
        UNLOCK;
        exit(255);
    }

    have_plan = 1;
    _expected_tests(tests);

    UNLOCK;
}
Exemplo n.º 2
0
/*
 * Note the number of tests that will be run.
 */
int
plan_tests(unsigned int tests)
{

	LOCK;

	_tap_init();

	if(have_plan != 0) {
		fprintf(stderr, "You tried to plan twice!\n");
		test_died = 1;
		UNLOCK;
		exit(255);
	}

	if(tests == 0) {
		fprintf(stderr, "You said to run 0 tests!  You've got to run something.\n");
		test_died = 1;
		UNLOCK;
		exit(255);
	}

	have_plan = 1;

	_expected_tests(tests);

	UNLOCK;

	return 0;
}