From: brarcher Date: Sun, 22 Sep 2013 17:22:57 +0000 (+0000) Subject: Do not run test_early_exit without fork X-Git-Tag: 0.10.0~446 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1116afb056eda056e951d3e2a2642859197e838f;p=check Do not run test_early_exit without fork Without fork(), this test results in exiting a unit test run. The test is not valid without fork(). git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@768 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/tests/check_check_master.c b/tests/check_check_master.c index b05d11d..d175b59 100644 --- a/tests/check_check_master.c +++ b/tests/check_check_master.c @@ -192,7 +192,9 @@ static master_test_t master_tests[] = { #endif /* HAVE_WORKING_SETENV */ #endif /* TIMEOUT_TESTS_ENABLED && defined(HAVE_FORK) */ +#ifdef HAVE_FORK { "Limit Tests", CK_ERROR, "Early exit with return value 1" }, +#endif /* HAVE_FORK */ { "Limit Tests", CK_FAILURE, "Completed properly" }, { "Limit Tests", CK_FAILURE, "Completed properly" }, diff --git a/tests/check_check_sub.c b/tests/check_check_sub.c index 5c05e9f..56d6fc3 100644 --- a/tests/check_check_sub.c +++ b/tests/check_check_sub.c @@ -485,11 +485,13 @@ START_TEST(test_sleep14) END_TEST #endif /* TIMEOUT_TESTS_ENABLED && defined(HAVE_FORK) */ +#ifdef HAVE_FORK START_TEST(test_early_exit) { exit(EXIT_FAILURE); } END_TEST +#endif /* HAVE_FORK */ START_TEST(test_null) { @@ -836,7 +838,9 @@ void init_master_tests_lineno(int num_master_tests) { #endif /* TIMEOUT_TESTS_ENABLED && defined(HAVE_FORK) */ /* Limit Tests */ +#ifdef HAVE_FORK "-1", +#endif /* HAVE_FORK */ "-1", "-1", @@ -1133,7 +1137,9 @@ Suite *make_sub_suite(void) #endif /* HAVE_WORKING_SETENV */ #endif /* TIMEOUT_TESTS_ENABLED && defined(HAVE_FORK) */ +#ifdef HAVE_FORK tcase_add_test (tc_limit, test_early_exit); +#endif /* HAVE_FORK */ tcase_add_test (tc_limit, test_null); tcase_add_test (tc_limit, test_null_2);