| 1 | #include <cgreen/cgreen.h> |
| 2 | |
| 3 | #include <stdio.h> |
| 4 | #include <stdlib.h> |
| 5 | #include <unistd.h> |
| 6 | #include <signal.h> |
| 7 | #ifdef HAVE_SYS_RESOURCE_H |
| 8 | #include <sys/resource.h> |
| 9 | #endif |
| 10 | |
| 11 | #ifdef __cplusplus |
| 12 | using namespace cgreen; |
| 13 | #endif |
| 14 | |
| 15 | Describe(IgnoreMessage); |
| 16 | BeforeEach(IgnoreMessage) {} |
| 17 | AfterEach(IgnoreMessage) {} |
| 18 | |
| 19 | Ensure(IgnoreMessage, should_not_count_empty_tests_as_ignored) { |
| 20 | } |
| 21 | |
| 22 | Ensure(IgnoreMessage, should_not_count_passing_tests_as_ignored) { |
| 23 | assert_that(true); |
| 24 | } |
| 25 | |
| 26 | Ensure(IgnoreMessage, should_not_count_failing_tests_as_ignored) { |
| 27 | assert_that(false); |
| 28 | } |
| 29 | |
| 30 | Ensure(IgnoreMessage, should_not_count_exceptions_as_ignored) { |
| 31 | #ifdef HAVE_SYS_RESOURCE_H |
| 32 | struct rlimit core_limit; |
| 33 | core_limit.rlim_cur = 1U; |
| 34 | core_limit.rlim_max = 1U; |
| 35 | setrlimit(RLIMIT_CORE, &core_limit); |
| 36 | #endif |
| 37 | raise(SIGSEGV); |
| 38 | } |
| 39 | |
| 40 | xEnsure(IgnoreMessage, should_present_this_as_ignored) { |
| 41 | fail_test("Should not be run since it's inside an ignored test"); |
| 42 | } |