diff options
Diffstat (limited to 'src/ext/tinytest.c')
-rw-r--r-- | src/ext/tinytest.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ext/tinytest.c b/src/ext/tinytest.c index df2cc0b584..052fb6483f 100644 --- a/src/ext/tinytest.c +++ b/src/ext/tinytest.c @@ -25,6 +25,7 @@ #ifdef TINYTEST_LOCAL #include "tinytest_local.h" #endif +#define TINYTEST_POSTFORK #include <stdio.h> #include <stdlib.h> @@ -118,6 +119,14 @@ testcase_run_bare_(const struct testcase_t *testcase) #ifndef NO_FORKING +#ifdef TINYTEST_POSTFORK +void tinytest_prefork(void); +void tinytest_postfork(void); +#else +static void tinytest_prefork(void) { } +static void tinytest_postfork(void) { } +#endif + static enum outcome testcase_run_forked_(const struct testgroup_t *group, const struct testcase_t *testcase) @@ -178,10 +187,12 @@ testcase_run_forked_(const struct testgroup_t *group, if (opt_verbosity>0) printf("[forking] "); + tinytest_prefork(); pid = fork(); #ifdef FORK_BREAKS_GCOV vproc_transaction_begin(0); #endif + tinytest_postfork(); if (!pid) { /* child. */ int test_r, write_r; |