aboutsummaryrefslogtreecommitdiff
path: root/src/ext/tinytest.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-04 20:21:07 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-04 20:21:07 -0400
commit0db5c549571eb0098a3f709ffb25c2e4909ca01d (patch)
tree0dbf1fbe9b25ddab292eadca50703f34de4c919e /src/ext/tinytest.c
parentfd994f55c441922d3c5ae19ad5c254a1ae1eccfd (diff)
parentd644c93ae9373f99d95870c7b752b790f8714201 (diff)
downloadtor-0db5c549571eb0098a3f709ffb25c2e4909ca01d.tar.gz
tor-0db5c549571eb0098a3f709ffb25c2e4909ca01d.zip
Merge branch 'nss_squashed' into nss_merge
Diffstat (limited to 'src/ext/tinytest.c')
-rw-r--r--src/ext/tinytest.c11
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;