コード例 #1
0
ファイル: tap.c プロジェクト: jimbelton/jools
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;
}
コード例 #2
0
ファイル: tap.c プロジェクト: BackupTheBerlios/web-cpan-svn
/*
 * 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;
}