Skip to content

Commit

Permalink
Disable SIGFPE tests for Cygwin until fixed
Browse files Browse the repository at this point in the history
The test_fpe and test_mark_point tests currently fail on Cygwin.
Instead of the test process receiving a SIGFPE it instead fails
with a SIGSEGV. The reason is not yet know. However, attempting a
simple program that installs a SIGFPE handler then does a
raise(SIGFPE) does result in the handler being called.

This tests need to be enabled again once the reason for the failures
is resolved.

#97
  • Loading branch information
brarcher committed Dec 23, 2016
1 parent b858494 commit e199127
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
17 changes: 16 additions & 1 deletion tests/check_check_fixture.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ START_TEST(test_ch_setup_pass_nofork)
}
END_TEST

/* This test currently does not work on Cygwin, as it results in a
* SIGSEGV instead of a SIGFPE. However, a simple program that installs
* a SIGFPE handler then raise(SIGFPE) works as expected. Further
* investigation is necessary. */
#if !defined(__CYGWIN__)
/*
* This test will fail without fork, as it results in a checked
* fixture raising a signal, which terminates the test runner early.
Expand Down Expand Up @@ -350,6 +355,7 @@ START_TEST(test_ch_setup_sig)
free(tr);
}
END_TEST
#endif /* !defined(__CYGWIN__) */

static void sub_ch_setup_dual_1(void)
{
Expand Down Expand Up @@ -487,7 +493,11 @@ START_TEST(test_ch_teardown_fail_nofork)
}
END_TEST


/* This test currently does not work on Cygwin, as it results in a
* SIGSEGV instead of a SIGFPE. However, a simple program that installs
* a SIGFPE handler then raise(SIGFPE) works as expected. Further
* investigation is necessary. */
#if !defined(__CYGWIN__)
/*
* This test will fail without fork, as it results in a checked
* fixture raising a signal, which terminates the test runner early.
Expand Down Expand Up @@ -539,6 +549,7 @@ START_TEST(test_ch_teardown_sig)
free(tr);
}
END_TEST
#endif /* !defined(__CYGWIN__) */

/* Teardowns are run in reverse order */
static void sub_ch_teardown_dual_1(void)
Expand Down Expand Up @@ -631,11 +642,15 @@ Suite *make_fixture_suite (void)
tcase_add_test(tc,test_ch_setup_fail_nofork);
tcase_add_test(tc,test_ch_setup_fail_nofork_2);
tcase_add_test(tc,test_ch_setup_pass_nofork);
#if !defined(__CYGWIN__)
tcase_add_test(tc,test_ch_setup_sig);
#endif /* !defined(__CYGWIN__) */
tcase_add_test(tc,test_ch_setup_two_setups_fork);
tcase_add_test(tc,test_ch_teardown_fail);
tcase_add_test(tc,test_ch_teardown_fail_nofork);
#if !defined(__CYGWIN__)
tcase_add_test(tc,test_ch_teardown_sig);
#endif /* !defined(__CYGWIN__) */
tcase_add_test(tc,test_ch_teardown_two_teardowns_fork);
#endif

Expand Down
4 changes: 3 additions & 1 deletion tests/check_check_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,11 @@ static master_test_t master_tests[] = {
{ "Signal Tests", "test_segv", CK_ERROR, signal_11_8_str },
{ "Signal Tests", "test_non_signal_8", CK_FAILURE, "Early exit with return value 0" },
{ "Signal Tests", "test_fail_unless", CK_FAILURE, "Early exit with return value 1" },
#if !defined(__CYGWIN__)
{ "Signal Tests", "test_fpe", CK_ERROR, signal_8_str },
{ "Signal Tests", "test_mark_point", CK_ERROR, signal_8_str },
#endif
#endif /* !defined(__CYGWIN__) */
#endif /* HAVE_FORK */

#if TIMEOUT_TESTS_ENABLED && defined(HAVE_FORK) && HAVE_FORK==1
#if HAVE_DECL_SETENV
Expand Down
17 changes: 16 additions & 1 deletion tests/check_check_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2272,13 +2272,19 @@ START_TEST(test_segv)
}
END_TEST

/* This test currently does not work on Cygwin, as it results in a
* SIGSEGV instead of a SIGFPE. However, a simple program that installs
* a SIGFPE handler then raise(SIGFPE) works as expected. Further
* investigation is necessary. */
#if !defined(__CYGWIN__)
START_TEST(test_fpe)
{
record_test_name(tcase_name());
record_failure_line_num(__LINE__-4); /* -4 as the failure is reported at START_TEST() */
raise (SIGFPE);
}
END_TEST
#endif /* !defined(__CYGWIN__) */

/*
* This test is to be used when the test is expected to throw signal 8,
Expand All @@ -2295,6 +2301,11 @@ END_TEST
/* TODO:
unit test running the same suite in succession */

/* This test currently does not work on Cygwin, as it results in a
* SIGSEGV instead of a SIGFPE. However, a simple program that installs
* a SIGFPE handler then raise(SIGFPE) works as expected. Further
* investigation is necessary. */
#if !defined(__CYGWIN__)
START_TEST(test_mark_point)
{
int i;
Expand All @@ -2307,7 +2318,9 @@ START_TEST(test_mark_point)
ck_abort_msg("Shouldn't reach here");
}
END_TEST
#endif
#endif /* !defined(__CYGWIN__) */

#endif /* HAVE_FORK */

#if TIMEOUT_TESTS_ENABLED && defined(HAVE_FORK) && HAVE_FORK == 1
START_TEST(test_eternal_fail)
Expand Down Expand Up @@ -2959,8 +2972,10 @@ Suite *make_sub_suite(void)
tcase_add_test_raise_signal (tc_signal, test_segv, 8); /* error */
tcase_add_test_raise_signal (tc_signal, test_non_signal_8, 8); /* fail */
tcase_add_test_raise_signal (tc_signal, test_fail_unless, 8); /* fail */
#if !defined(__CYGWIN__)
tcase_add_test (tc_signal, test_fpe);
tcase_add_test (tc_signal, test_mark_point);
#endif /* !defined(__CYGWIN__) */
#endif /* HAVE_FORK */

#if TIMEOUT_TESTS_ENABLED && defined(HAVE_FORK) && HAVE_FORK == 1
Expand Down

0 comments on commit e199127

Please sign in to comment.