summaryrefslogtreecommitdiff
path: root/auto_tests
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-08-26 13:18:43 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-08-26 13:18:43 +0000
commit64ddb7fff21e8cfcd197ba31bbb08ee6d3964c54 (patch)
tree08e5f78a945c94204530648c8e2f7ce48da28905 /auto_tests
parent80f8458146061e5fe6edd97e06e039f1ad2cf3a9 (diff)
Call `abort` instead of `exit` on test failure.
This raises a signal, so we can more easily catch it with gdb.
Diffstat (limited to 'auto_tests')
-rw-r--r--auto_tests/check_compat.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/auto_tests/check_compat.h b/auto_tests/check_compat.h
index 9e174287..2f83577d 100644
--- a/auto_tests/check_compat.h
+++ b/auto_tests/check_compat.h
@@ -44,7 +44,7 @@ static inline int srunner_ntests_failed(SRunner *r)
44#define ck_assert(ok) do { \ 44#define ck_assert(ok) do { \
45 if (!(ok)) { \ 45 if (!(ok)) { \
46 fprintf(stderr, "%s:%d: failed `%s'\n", __FILE__, __LINE__, #ok); \ 46 fprintf(stderr, "%s:%d: failed `%s'\n", __FILE__, __LINE__, #ok); \
47 exit(EXIT_FAILURE); \ 47 abort(); \
48 } \ 48 } \
49} while (0) 49} while (0)
50 50
@@ -53,7 +53,7 @@ static inline int srunner_ntests_failed(SRunner *r)
53 fprintf(stderr, "%s:%d: failed `%s': ", __FILE__, __LINE__, #ok); \ 53 fprintf(stderr, "%s:%d: failed `%s': ", __FILE__, __LINE__, #ok); \
54 fprintf(stderr, __VA_ARGS__); \ 54 fprintf(stderr, __VA_ARGS__); \
55 fprintf(stderr, "\n"); \ 55 fprintf(stderr, "\n"); \
56 exit(EXIT_FAILURE); \ 56 abort(); \
57 } \ 57 } \
58} while (0) 58} while (0)
59 59
@@ -61,7 +61,7 @@ static inline int srunner_ntests_failed(SRunner *r)
61 fprintf(stderr, "%s:%d: ", __FILE__, __LINE__); \ 61 fprintf(stderr, "%s:%d: ", __FILE__, __LINE__); \
62 fprintf(stderr, __VA_ARGS__); \ 62 fprintf(stderr, __VA_ARGS__); \
63 fprintf(stderr, "\n"); \ 63 fprintf(stderr, "\n"); \
64 exit(EXIT_FAILURE); \ 64 abort(); \
65} while (0) 65} while (0)
66 66
67#endif // CHECK_COMPAT_H 67#endif // CHECK_COMPAT_H