aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2013-01-14 08:35:49 -0500
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-01-14 08:35:49 -0500
commit176e38bd5876bfe691d09d75de8959801eda9da2 (patch)
treec9c73613e281e7d2a640ddc7938571512163f37e
parent916c8dfde6a4ee5b86af4d4db882c05c6bb08e9b (diff)
Include PID info in test failures
Useful for correlating test failures to events in traces.
-rw-r--r--include/tests.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/tests.h b/include/tests.h
index ed2b409..4ca21f8 100644
--- a/include/tests.h
+++ b/include/tests.h
@@ -7,8 +7,11 @@
7 7
8#define fail(fmt, args...) \ 8#define fail(fmt, args...) \
9 do { \ 9 do { \
10 fprintf(stderr, "\n!! TEST FAILURE " fmt "\n at %s:%d (%s)\n", \ 10 fprintf(stderr, "\n!! TEST FAILURE " fmt \
11 ## args, __FILE__, __LINE__, __FUNCTION__); \ 11 "\n at %s:%d (%s)" \
12 "\n in task PID=%d\n", \
13 ## args, __FILE__, __LINE__, __FUNCTION__, \
14 getpid()); \
12 fflush(stderr); \ 15 fflush(stderr); \
13 exit(200); \ 16 exit(200); \
14 } while (0) 17 } while (0)