summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/bloom/test_bloom.c2
-rw-r--r--test/checkpoint/test_checkpoint.c2
-rw-r--r--test/cursor_order/cursor_order.c2
-rw-r--r--test/fops/t.c2
-rw-r--r--test/format/format.h1
-rw-r--r--test/format/t.c7
-rw-r--r--test/huge/huge.c2
-rw-r--r--test/readonly/readonly.c2
-rw-r--r--test/recovery/random-abort.c2
-rw-r--r--test/recovery/truncated-log.c2
-rw-r--r--test/salvage/salvage.c2
-rw-r--r--test/thread/t.c2
-rw-r--r--test/utility/test_util.i5
13 files changed, 26 insertions, 7 deletions
diff --git a/test/bloom/test_bloom.c b/test/bloom/test_bloom.c
index 4a3d3372794..ffaddd2173b 100644
--- a/test/bloom/test_bloom.c
+++ b/test/bloom/test_bloom.c
@@ -55,6 +55,8 @@ void usage(void);
extern char *__wt_optarg;
extern int __wt_optind;
+void (*custom_die)(void) = NULL;
+
int
main(int argc, char *argv[])
{
diff --git a/test/checkpoint/test_checkpoint.c b/test/checkpoint/test_checkpoint.c
index 1914ad0188a..0f28a86b675 100644
--- a/test/checkpoint/test_checkpoint.c
+++ b/test/checkpoint/test_checkpoint.c
@@ -41,6 +41,8 @@ static int wt_shutdown(void);
extern int __wt_optind;
extern char *__wt_optarg;
+void (*custom_die)(void) = NULL;
+
int
main(int argc, char *argv[])
{
diff --git a/test/cursor_order/cursor_order.c b/test/cursor_order/cursor_order.c
index 14709a2e88e..68d2f092c60 100644
--- a/test/cursor_order/cursor_order.c
+++ b/test/cursor_order/cursor_order.c
@@ -43,6 +43,8 @@ static void wt_shutdown(SHARED_CONFIG *);
extern int __wt_optind;
extern char *__wt_optarg;
+void (*custom_die)(void) = NULL;
+
int
main(int argc, char *argv[])
{
diff --git a/test/fops/t.c b/test/fops/t.c
index 0881c23d7d4..24994404c7c 100644
--- a/test/fops/t.c
+++ b/test/fops/t.c
@@ -50,6 +50,8 @@ static void wt_shutdown(void);
extern int __wt_optind;
extern char *__wt_optarg;
+void (*custom_die)(void) = NULL;
+
int
main(int argc, char *argv[])
{
diff --git a/test/format/format.h b/test/format/format.h
index b32877636c8..c54fd061736 100644
--- a/test/format/format.h
+++ b/test/format/format.h
@@ -310,7 +310,6 @@ void config_single(const char *, int);
void *dmalloc(size_t);
char *dstrdup(const char *);
void fclose_and_clear(FILE **);
-void format_die(void);
void key_gen(uint8_t *, size_t *, uint64_t);
void key_gen_insert(WT_RAND_STATE *, uint8_t *, size_t *, uint64_t);
void key_gen_setup(uint8_t **);
diff --git a/test/format/t.c b/test/format/t.c
index b9dfdaabb33..28c22e23cb8 100644
--- a/test/format/t.c
+++ b/test/format/t.c
@@ -30,12 +30,15 @@
GLOBAL g;
+static void format_die(void);
static void startup(void);
static void usage(void);
extern int __wt_optind;
extern char *__wt_optarg;
+void (*custom_die)(void) = format_die; /* Local death handler. */
+
int
main(int argc, char *argv[])
{
@@ -45,8 +48,6 @@ main(int argc, char *argv[])
config = NULL;
- /* Register a fatal cleanup handler */
- custom_die = format_die;
#ifdef _WIN32
g.progname = "t_format.exe";
#else
@@ -310,7 +311,7 @@ startup(void)
* die --
* Report an error, dumping the configuration.
*/
-void
+static void
format_die(void)
{
/*
diff --git a/test/huge/huge.c b/test/huge/huge.c
index d09f6f375fb..ad19035ff99 100644
--- a/test/huge/huge.c
+++ b/test/huge/huge.c
@@ -167,6 +167,8 @@ run(CONFIG *cp, int bigkey, size_t bytes)
extern int __wt_optind;
extern char *__wt_optarg;
+void (*custom_die)(void) = NULL;
+
int
main(int argc, char *argv[])
{
diff --git a/test/readonly/readonly.c b/test/readonly/readonly.c
index 6f74ee47c5a..100ccbf81b7 100644
--- a/test/readonly/readonly.c
+++ b/test/readonly/readonly.c
@@ -158,6 +158,8 @@ open_dbs(int op, const char *dir,
extern int __wt_optind;
extern char *__wt_optarg;
+void (*custom_die)(void) = NULL;
+
int
main(int argc, char *argv[])
{
diff --git a/test/recovery/random-abort.c b/test/recovery/random-abort.c
index b356ddc6379..c9cc10d2db3 100644
--- a/test/recovery/random-abort.c
+++ b/test/recovery/random-abort.c
@@ -136,6 +136,8 @@ fill_db(void)
extern int __wt_optind;
extern char *__wt_optarg;
+void (*custom_die)(void) = NULL;
+
int
main(int argc, char *argv[])
{
diff --git a/test/recovery/truncated-log.c b/test/recovery/truncated-log.c
index d1046064c2f..23269e99d35 100644
--- a/test/recovery/truncated-log.c
+++ b/test/recovery/truncated-log.c
@@ -169,6 +169,8 @@ fill_db(void)
extern int __wt_optind;
extern char *__wt_optarg;
+void (*custom_die)(void) = NULL;
+
int
main(int argc, char *argv[])
{
diff --git a/test/salvage/salvage.c b/test/salvage/salvage.c
index c2ad6224b11..a1517d70787 100644
--- a/test/salvage/salvage.c
+++ b/test/salvage/salvage.c
@@ -64,6 +64,8 @@ static int verbose; /* -v flag */
extern int __wt_optind;
extern char *__wt_optarg;
+void (*custom_die)(void) = NULL;
+
int
main(int argc, char *argv[])
{
diff --git a/test/thread/t.c b/test/thread/t.c
index e72b54bf62a..22334076ee1 100644
--- a/test/thread/t.c
+++ b/test/thread/t.c
@@ -51,6 +51,8 @@ static void wt_shutdown(void);
extern int __wt_optind;
extern char *__wt_optarg;
+void (*custom_die)(void) = NULL;
+
int
main(int argc, char *argv[])
{
diff --git a/test/utility/test_util.i b/test/utility/test_util.i
index bd7956e460f..c5cebadcb5c 100644
--- a/test/utility/test_util.i
+++ b/test/utility/test_util.i
@@ -42,9 +42,8 @@
#define DEFAULT_DIR "WT_TEST"
#define MKDIR_COMMAND "mkdir "
-/* Setup a function pointer so tests can override the content of die. */
-typedef void (*die_func)(void);
-die_func custom_die;
+/* Allow tests to add their own death handling. */
+extern void (*custom_die)(void);
static void testutil_die(int, const char *, ...)
#if defined(__GNUC__)