]> granicus.if.org Git - check/commitdiff
Added possibility to turn off timeout tests through configure option --enable-timeout...
authorhugo303 <hugo303@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 15 Sep 2005 13:04:17 +0000 (13:04 +0000)
committerhugo303 <hugo303@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 15 Sep 2005 13:04:17 +0000 (13:04 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@250 64e312b2-a51f-0410-8e61-82d0ca0eb02a

check/ChangeLog
check/configure.in
check/tests/Makefile.am
check/tests/check_check.h
check/tests/check_check_master.c
check/tests/check_check_sub.c

index e779eb8244447a83d901a14c9a71e630a4c392d5..c42038371c72e02d5f72d7124d153bd22f30a839 100644 (file)
@@ -1,3 +1,10 @@
+2005-09-15 hugo303
+
+       * configure.in, tests/check_check_sub.c, tests/check_check.h,
+       tests/check_check_master.c, tests/Makefile.am:
+       Added possibility to turn off timeout tests through configure option
+       --enable-timeout-tests=no
+
 2005-09-15 hugo303
 
        * src/Makefile.am: Improved coverage analysis by running all tests
index 749df98c6a6159cfc6d96a738f76f5fbd0f98a40..21bbe0e4eb688d24fd63eb6f8c5ca7022b50035b 100644 (file)
@@ -23,6 +23,16 @@ esac], [enable_gcov=false ])
 
 AM_CONDITIONAL(ENABLE_GCOV, test x"$enable_gcov" = "xtrue")
 
+AC_ARG_ENABLE(timeout-tests,
+AC_HELP_STRING([--enable-timeout-tests],[turn off timeout tests]),
+[case "${enableval}" in
+  yes) enable_timeout_tests=true ;;
+  no)  enable_timeout_tests=false ;;
+  *)   AC_MSG_ERROR(bad value ${enableval} for --enable-timeout-tests) ;;
+esac], [enable_timeout_tests=true ])
+
+AM_CONDITIONAL(NO_TIMEOUT_TESTS, test x"$enable_timeout_tests" = "xfalse")
+
 AC_ARG_ENABLE(plain_docdir,
 [  --enable-plain-docdir        don't append version information to docdir],
 [case "${enableval}" in
index 8fb64c2d138b25039ec4a7b6d8f6f82fad6dc2cc..319764cadac6e87af051f2f2a23a630f5bffe176 100644 (file)
@@ -13,6 +13,10 @@ noinst_PROGRAMS = \
 
 EXTRA_DIST = test_output.sh test_log_output.sh test_xml_output.sh
 
+if NO_TIMEOUT_TESTS
+check_check_CFLAGS = -DTIMEOUT_TESTS_ENABLED=0
+endif
+
 check_check_SOURCES = \
        check_check.h           \
        check_list.c            \
index c4cf67d72841a9ab003d98ef9096ee084812f428..3a5b5861e74dfbe410f507de169066da0bdc9802 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef CHECK_CHECK_H
 #define CHECK_CHECK_H
 
+#ifndef TIMEOUT_TESTS_ENABLED
+#define TIMEOUT_TESTS_ENABLED 1
+#endif
+
 int sub_nfailed;
 int sub_ntests;
 
index f74f3b1ea97b664766890855b84e975d83d118d7..fd10d592a27b9fa63f6cdf5b9a44d84090620854 100644 (file)
@@ -42,6 +42,7 @@ static master_test_t master_tests[] = {
   { "Signal Tests",  -1, CK_ERROR,   "Received signal 8 (Floating point exception)" },
   { "Signal Tests",  -1, CK_ERROR,   "Received signal 8 (Floating point exception)" },
 
+#if TIMEOUT_TESTS_ENABLED
   { "Environment Timeout Tests", 139, CK_ERROR,  "Test timeout expired" },
   { "Environment Timeout Tests",  -1, CK_PASS,   "Passed" },
   { "Environment Timeout Tests",  -1, CK_PASS,   "Passed" },
@@ -59,6 +60,7 @@ static master_test_t master_tests[] = {
   { "Timeout Tests",  -1, CK_PASS,   "Passed" },
   { "Timeout Tests", 152, CK_ERROR,  "Test timeout expired" },
   { "Timeout Tests", 158, CK_ERROR,  "Test timeout expired" },
+#endif
 
   { "Limit Tests",   -1, CK_ERROR,   "Early exit with return value 1" },
   { "Limit Tests",   -1, CK_FAILURE, "Completed properly" },
index 87bbe69246969fac794548263f444fb93f04ed03..6903468dfb78794826c6dc47473a91502dfbd2ee 100644 (file)
@@ -136,6 +136,7 @@ START_TEST(test_mark_point)
 }
 END_TEST
 
+#if TIMEOUT_TESTS_ENABLED
 START_TEST(test_eternal) /* line 139 */
 {
   for (;;)
@@ -160,7 +161,7 @@ START_TEST(test_sleep8) /* line 158 */
   sleep(8);
 }
 END_TEST
-
+#endif
 
 START_TEST(test_early_exit)
 {
@@ -320,9 +321,11 @@ Suite *make_sub_suite(void)
 
   TCase *tc_simple;
   TCase *tc_signal;
+#if TIMEOUT_TESTS_ENABLED
   TCase *tc_timeout_env;
   TCase *tc_timeout;
   TCase *tc_timeout_usr;
+#endif
   TCase *tc_limit;
   TCase *tc_messaging_and_fork;
 
@@ -330,21 +333,25 @@ Suite *make_sub_suite(void)
 
   tc_simple = tcase_create("Simple Tests");
   tc_signal = tcase_create("Signal Tests");
+#if TIMEOUT_TESTS_ENABLED
   setenv("CK_DEFAULT_TIMEOUT", "6", 1);
   tc_timeout_env = tcase_create("Environment Timeout Tests");
   unsetenv("CK_DEFAULT_TIMEOUT");
   tc_timeout = tcase_create("Timeout Tests");
   tc_timeout_usr = tcase_create("User Timeout Tests");
+#endif
   tc_limit = tcase_create("Limit Tests");
   tc_messaging_and_fork = tcase_create("Msg and fork Tests");
 
   suite_add_tcase (s, tc_simple);
   suite_add_tcase (s, tc_signal);
+#if TIMEOUT_TESTS_ENABLED
   suite_add_tcase (s, tc_timeout_env);
   suite_add_tcase (s, tc_timeout);
   suite_add_tcase (s, tc_timeout_usr);
   /* Add a second time to make sure tcase_set_timeout doesn't contaminate it. */
   suite_add_tcase (s, tc_timeout);
+#endif
   suite_add_tcase (s, tc_limit);
   suite_add_tcase (s, tc_messaging_and_fork);
 
@@ -371,6 +378,7 @@ Suite *make_sub_suite(void)
   tcase_add_test (tc_signal, test_fpe);
   tcase_add_test (tc_signal, test_mark_point);
 
+#if TIMEOUT_TESTS_ENABLED
   tcase_add_test (tc_timeout_env, test_eternal);
   tcase_add_test (tc_timeout_env, test_sleep2);
   tcase_add_test (tc_timeout_env, test_sleep5);
@@ -386,6 +394,7 @@ Suite *make_sub_suite(void)
   tcase_add_test (tc_timeout_usr, test_sleep2);
   tcase_add_test (tc_timeout_usr, test_sleep5);
   tcase_add_test (tc_timeout_usr, test_sleep8);
+#endif
 
   tcase_add_test (tc_limit, test_early_exit);
   tcase_add_test (tc_limit, test_null);