summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:21:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:21:13 +0930
commit59527bcc7b465bfa2cdfb5a9f5e40d68e888ace9 (patch)
tree7d7b68ad571892ffdf9c59c66668a1332f5ec146 /lib
parentb67acb7e2a7cde01321daa6116c635a565accd27 (diff)
downloadsamba-59527bcc7b465bfa2cdfb5a9f5e40d68e888ace9.tar.gz
samba-59527bcc7b465bfa2cdfb5a9f5e40d68e888ace9.tar.bz2
samba-59527bcc7b465bfa2cdfb5a9f5e40d68e888ace9.zip
tdb2: make tests include a single mega-header to simplify future patches
This lets us add the new files to a single place. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 476567430be6962625bf399192e20938985232c7)
Diffstat (limited to 'lib')
-rw-r--r--lib/tdb2/test/run-001-encode.c9
-rw-r--r--lib/tdb2/test/run-001-fls.c9
-rw-r--r--lib/tdb2/test/run-01-new_database.c9
-rw-r--r--lib/tdb2/test/run-02-expand.c9
-rw-r--r--lib/tdb2/test/run-03-coalesce.c9
-rw-r--r--lib/tdb2/test/run-04-basichash.c9
-rw-r--r--lib/tdb2/test/run-05-readonly-open.c9
-rw-r--r--lib/tdb2/test/run-10-simple-store.c9
-rw-r--r--lib/tdb2/test/run-11-simple-fetch.c9
-rw-r--r--lib/tdb2/test/run-12-store.c9
-rw-r--r--lib/tdb2/test/run-13-delete.c9
-rw-r--r--lib/tdb2/test/run-14-exists.c9
-rw-r--r--lib/tdb2/test/run-15-append.c9
-rw-r--r--lib/tdb2/test/run-16-wipe_all.c10
-rw-r--r--lib/tdb2/test/run-20-growhash.c9
-rw-r--r--lib/tdb2/test/run-21-parse_record.c9
-rw-r--r--lib/tdb2/test/run-25-hashoverload.c10
-rw-r--r--lib/tdb2/test/run-30-exhaust-before-expand.c9
-rw-r--r--lib/tdb2/test/run-35-convert.c9
-rw-r--r--lib/tdb2/test/run-50-multiple-freelists.c9
-rw-r--r--lib/tdb2/test/run-55-transaction.c9
-rw-r--r--lib/tdb2/test/run-56-open-during-transaction.c9
-rw-r--r--lib/tdb2/test/run-57-die-during-transaction.c10
-rw-r--r--lib/tdb2/test/run-64-bit-tdb.c10
-rw-r--r--lib/tdb2/test/run-80-tdb_fd.c9
-rw-r--r--lib/tdb2/test/run-81-seqnum.c10
-rw-r--r--lib/tdb2/test/run-82-lockattr.c10
-rw-r--r--lib/tdb2/test/run-83-openhook.c9
-rw-r--r--lib/tdb2/test/run-90-get-set-attributes.c10
-rw-r--r--lib/tdb2/test/run-91-get-stats.c10
-rw-r--r--lib/tdb2/test/run-92-get-set-readonly.c10
-rw-r--r--lib/tdb2/test/run-add-remove-flags.c10
-rw-r--r--lib/tdb2/test/run-check-callback.c10
-rw-r--r--lib/tdb2/test/run-expand-in-transaction.c9
-rw-r--r--lib/tdb2/test/run-features.c10
-rw-r--r--lib/tdb2/test/run-firstkey-nextkey.c10
-rw-r--r--lib/tdb2/test/run-fork-test.c9
-rw-r--r--lib/tdb2/test/run-lockall.c9
-rw-r--r--lib/tdb2/test/run-locktimeout.c9
-rw-r--r--lib/tdb2/test/run-missing-entries.c10
-rw-r--r--lib/tdb2/test/run-open-multiple-times.c9
-rw-r--r--lib/tdb2/test/run-record-expand.c9
-rw-r--r--lib/tdb2/test/run-remap-in-read_traverse.c10
-rw-r--r--lib/tdb2/test/run-seed.c9
-rw-r--r--lib/tdb2/test/run-simple-delete.c9
-rw-r--r--lib/tdb2/test/run-summary.c10
-rw-r--r--lib/tdb2/test/run-tdb_errorstr.c9
-rw-r--r--lib/tdb2/test/run-tdb_foreach.c9
-rw-r--r--lib/tdb2/test/run-traverse.c10
-rw-r--r--lib/tdb2/test/tdb2-source.h10
50 files changed, 60 insertions, 408 deletions
diff --git a/lib/tdb2/test/run-001-encode.c b/lib/tdb2/test/run-001-encode.c
index ffa4b93c02..67616fcd9f 100644
--- a/lib/tdb2/test/run-001-encode.c
+++ b/lib/tdb2/test/run-001-encode.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-001-fls.c b/lib/tdb2/test/run-001-fls.c
index d54cad1d1c..4449f69d85 100644
--- a/lib/tdb2/test/run-001-fls.c
+++ b/lib/tdb2/test/run-001-fls.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
static unsigned int dumb_fls(uint64_t num)
diff --git a/lib/tdb2/test/run-01-new_database.c b/lib/tdb2/test/run-01-new_database.c
index 32ebaf09c1..0786d4a65b 100644
--- a/lib/tdb2/test/run-01-new_database.c
+++ b/lib/tdb2/test/run-01-new_database.c
@@ -1,12 +1,5 @@
#include <ccan/failtest/failtest_override.h>
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include <ccan/failtest/failtest.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-02-expand.c b/lib/tdb2/test/run-02-expand.c
index 6666ae167e..192a3547d8 100644
--- a/lib/tdb2/test/run-02-expand.c
+++ b/lib/tdb2/test/run-02-expand.c
@@ -1,12 +1,5 @@
#include <ccan/failtest/failtest_override.h>
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/hash.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include <ccan/failtest/failtest.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-03-coalesce.c b/lib/tdb2/test/run-03-coalesce.c
index 3fdd11c077..073b4e99aa 100644
--- a/lib/tdb2/test/run-03-coalesce.c
+++ b/lib/tdb2/test/run-03-coalesce.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
#include "layout.h"
diff --git a/lib/tdb2/test/run-04-basichash.c b/lib/tdb2/test/run-04-basichash.c
index 62031bdb40..12c130f5f6 100644
--- a/lib/tdb2/test/run-04-basichash.c
+++ b/lib/tdb2/test/run-04-basichash.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-05-readonly-open.c b/lib/tdb2/test/run-05-readonly-open.c
index 0f1a4343d8..1062f1c484 100644
--- a/lib/tdb2/test/run-05-readonly-open.c
+++ b/lib/tdb2/test/run-05-readonly-open.c
@@ -1,12 +1,5 @@
#include <ccan/failtest/failtest_override.h>
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include <ccan/failtest/failtest.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-10-simple-store.c b/lib/tdb2/test/run-10-simple-store.c
index 35c387a3be..a8e80589fc 100644
--- a/lib/tdb2/test/run-10-simple-store.c
+++ b/lib/tdb2/test/run-10-simple-store.c
@@ -1,12 +1,5 @@
#include <ccan/failtest/failtest_override.h>
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include <ccan/failtest/failtest.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-11-simple-fetch.c b/lib/tdb2/test/run-11-simple-fetch.c
index 29b6bf0872..700a4eb93b 100644
--- a/lib/tdb2/test/run-11-simple-fetch.c
+++ b/lib/tdb2/test/run-11-simple-fetch.c
@@ -1,12 +1,5 @@
#include <ccan/failtest/failtest_override.h>
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include <ccan/failtest/failtest.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-12-store.c b/lib/tdb2/test/run-12-store.c
index ba2e4f8971..e46183b9c1 100644
--- a/lib/tdb2/test/run-12-store.c
+++ b/lib/tdb2/test/run-12-store.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-13-delete.c b/lib/tdb2/test/run-13-delete.c
index 3b464d927e..b5586dc215 100644
--- a/lib/tdb2/test/run-13-delete.c
+++ b/lib/tdb2/test/run-13-delete.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-14-exists.c b/lib/tdb2/test/run-14-exists.c
index f264a6f2c9..b27fc7060b 100644
--- a/lib/tdb2/test/run-14-exists.c
+++ b/lib/tdb2/test/run-14-exists.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-15-append.c b/lib/tdb2/test/run-15-append.c
index d2f9ec6598..ac37960a6f 100644
--- a/lib/tdb2/test/run-15-append.c
+++ b/lib/tdb2/test/run-15-append.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include <ccan/ilog/ilog.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-16-wipe_all.c b/lib/tdb2/test/run-16-wipe_all.c
index d9c5128e0b..1ca23c3363 100644
--- a/lib/tdb2/test/run-16-wipe_all.c
+++ b/lib/tdb2/test/run-16-wipe_all.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/traverse.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-20-growhash.c b/lib/tdb2/test/run-20-growhash.c
index 22a88c4504..890bcd2781 100644
--- a/lib/tdb2/test/run-20-growhash.c
+++ b/lib/tdb2/test/run-20-growhash.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-21-parse_record.c b/lib/tdb2/test/run-21-parse_record.c
index 773cdff4e0..6f95ff70ac 100644
--- a/lib/tdb2/test/run-21-parse_record.c
+++ b/lib/tdb2/test/run-21-parse_record.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-25-hashoverload.c b/lib/tdb2/test/run-25-hashoverload.c
index 83f549d6b2..0e1430265c 100644
--- a/lib/tdb2/test/run-25-hashoverload.c
+++ b/lib/tdb2/test/run-25-hashoverload.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/traverse.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-30-exhaust-before-expand.c b/lib/tdb2/test/run-30-exhaust-before-expand.c
index 2386f85f26..2279a802a3 100644
--- a/lib/tdb2/test/run-30-exhaust-before-expand.c
+++ b/lib/tdb2/test/run-30-exhaust-before-expand.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include <err.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-35-convert.c b/lib/tdb2/test/run-35-convert.c
index 0300369194..faadfb7646 100644
--- a/lib/tdb2/test/run-35-convert.c
+++ b/lib/tdb2/test/run-35-convert.c
@@ -1,13 +1,6 @@
#include <ccan/tdb2/private.h>
#include <ccan/failtest/failtest_override.h>
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include <ccan/failtest/failtest.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-50-multiple-freelists.c b/lib/tdb2/test/run-50-multiple-freelists.c
index 7a48c3e0ee..547bac476e 100644
--- a/lib/tdb2/test/run-50-multiple-freelists.c
+++ b/lib/tdb2/test/run-50-multiple-freelists.c
@@ -1,12 +1,5 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
-#include <ccan/tdb2/transaction.c>
#include "logging.h"
#include "layout.h"
diff --git a/lib/tdb2/test/run-55-transaction.c b/lib/tdb2/test/run-55-transaction.c
index 1650e40e1f..a6607d11db 100644
--- a/lib/tdb2/test/run-55-transaction.c
+++ b/lib/tdb2/test/run-55-transaction.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-56-open-during-transaction.c b/lib/tdb2/test/run-56-open-during-transaction.c
index 88933e02ed..1c714dc8b8 100644
--- a/lib/tdb2/test/run-56-open-during-transaction.c
+++ b/lib/tdb2/test/run-56-open-during-transaction.c
@@ -11,14 +11,7 @@ static int ftruncate_check(int fd, off_t length);
#define fcntl fcntl_with_lockcheck
#define ftruncate ftruncate_check
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include <stdlib.h>
#include <stdbool.h>
diff --git a/lib/tdb2/test/run-57-die-during-transaction.c b/lib/tdb2/test/run-57-die-during-transaction.c
index 1b02802359..e622395537 100644
--- a/lib/tdb2/test/run-57-die-during-transaction.c
+++ b/lib/tdb2/test/run-57-die-during-transaction.c
@@ -58,14 +58,8 @@ static void free_all(void)
#define malloc malloc_noleak
#define free free_noleak
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
+
#undef malloc
#undef free
#undef write
diff --git a/lib/tdb2/test/run-64-bit-tdb.c b/lib/tdb2/test/run-64-bit-tdb.c
index 78dadca016..1201bba619 100644
--- a/lib/tdb2/test/run-64-bit-tdb.c
+++ b/lib/tdb2/test/run-64-bit-tdb.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/traverse.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-80-tdb_fd.c b/lib/tdb2/test/run-80-tdb_fd.c
index e8b2fae2dd..82daffea16 100644
--- a/lib/tdb2/test/run-80-tdb_fd.c
+++ b/lib/tdb2/test/run-80-tdb_fd.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-81-seqnum.c b/lib/tdb2/test/run-81-seqnum.c
index 6e8b2698b6..6af3f91ee1 100644
--- a/lib/tdb2/test/run-81-seqnum.c
+++ b/lib/tdb2/test/run-81-seqnum.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/traverse.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-82-lockattr.c b/lib/tdb2/test/run-82-lockattr.c
index bfc2653222..20d0aaafa0 100644
--- a/lib/tdb2/test/run-82-lockattr.c
+++ b/lib/tdb2/test/run-82-lockattr.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/traverse.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-83-openhook.c b/lib/tdb2/test/run-83-openhook.c
index 320be7d4da..69447b54d8 100644
--- a/lib/tdb2/test/run-83-openhook.c
+++ b/lib/tdb2/test/run-83-openhook.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include <stdlib.h>
#include <stdbool.h>
diff --git a/lib/tdb2/test/run-90-get-set-attributes.c b/lib/tdb2/test/run-90-get-set-attributes.c
index 159d8a01ea..6cb889f4d1 100644
--- a/lib/tdb2/test/run-90-get-set-attributes.c
+++ b/lib/tdb2/test/run-90-get-set-attributes.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/traverse.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-91-get-stats.c b/lib/tdb2/test/run-91-get-stats.c
index 795dfd6602..53a0ff5990 100644
--- a/lib/tdb2/test/run-91-get-stats.c
+++ b/lib/tdb2/test/run-91-get-stats.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/traverse.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-92-get-set-readonly.c b/lib/tdb2/test/run-92-get-set-readonly.c
index 09a6010c18..31404be20d 100644
--- a/lib/tdb2/test/run-92-get-set-readonly.c
+++ b/lib/tdb2/test/run-92-get-set-readonly.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/traverse.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-add-remove-flags.c b/lib/tdb2/test/run-add-remove-flags.c
index 1dc8463662..96c6bbe7e0 100644
--- a/lib/tdb2/test/run-add-remove-flags.c
+++ b/lib/tdb2/test/run-add-remove-flags.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/traverse.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-check-callback.c b/lib/tdb2/test/run-check-callback.c
index 1e87436717..7e15d6ff27 100644
--- a/lib/tdb2/test/run-check-callback.c
+++ b/lib/tdb2/test/run-check-callback.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/traverse.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/open.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-expand-in-transaction.c b/lib/tdb2/test/run-expand-in-transaction.c
index 49ba03c924..26b7c45715 100644
--- a/lib/tdb2/test/run-expand-in-transaction.c
+++ b/lib/tdb2/test/run-expand-in-transaction.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-features.c b/lib/tdb2/test/run-features.c
index 6d82dc308c..a304833ce3 100644
--- a/lib/tdb2/test/run-features.c
+++ b/lib/tdb2/test/run-features.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/summary.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-firstkey-nextkey.c b/lib/tdb2/test/run-firstkey-nextkey.c
index 65a6090a96..a46151f6c3 100644
--- a/lib/tdb2/test/run-firstkey-nextkey.c
+++ b/lib/tdb2/test/run-firstkey-nextkey.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/traverse.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-fork-test.c b/lib/tdb2/test/run-fork-test.c
index e9813e0a0f..2734742571 100644
--- a/lib/tdb2/test/run-fork-test.c
+++ b/lib/tdb2/test/run-fork-test.c
@@ -10,14 +10,7 @@
* Note that we don't hold a lock across tdb_traverse callbacks, so
* that doesn't matter.
*/
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include <sys/types.h>
#include <sys/wait.h>
diff --git a/lib/tdb2/test/run-lockall.c b/lib/tdb2/test/run-lockall.c
index 7f75159cca..201757fe84 100644
--- a/lib/tdb2/test/run-lockall.c
+++ b/lib/tdb2/test/run-lockall.c
@@ -3,15 +3,8 @@
#include "lock-tracking.h"
#define fcntl fcntl_with_lockcheck
+#include "tdb2-source.h"
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
#include <ccan/tap/tap.h>
#include <stdlib.h>
#include <stdbool.h>
diff --git a/lib/tdb2/test/run-locktimeout.c b/lib/tdb2/test/run-locktimeout.c
index bb5b5db29b..44ae7d57e7 100644
--- a/lib/tdb2/test/run-locktimeout.c
+++ b/lib/tdb2/test/run-locktimeout.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
#include "external-agent.h"
diff --git a/lib/tdb2/test/run-missing-entries.c b/lib/tdb2/test/run-missing-entries.c
index e99572f64c..22d6ba4270 100644
--- a/lib/tdb2/test/run-missing-entries.c
+++ b/lib/tdb2/test/run-missing-entries.c
@@ -1,13 +1,5 @@
+#include "tdb2-source.h"
/* Another test revealed that we lost an entry. This reproduces it. */
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/traverse.c>
-#include <ccan/tdb2/transaction.c>
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-open-multiple-times.c b/lib/tdb2/test/run-open-multiple-times.c
index 240828df16..f49e65d8b6 100644
--- a/lib/tdb2/test/run-open-multiple-times.c
+++ b/lib/tdb2/test/run-open-multiple-times.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-record-expand.c b/lib/tdb2/test/run-record-expand.c
index 109a099278..1db22c5501 100644
--- a/lib/tdb2/test/run-record-expand.c
+++ b/lib/tdb2/test/run-record-expand.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-remap-in-read_traverse.c b/lib/tdb2/test/run-remap-in-read_traverse.c
index d784ca3407..b70a841aaf 100644
--- a/lib/tdb2/test/run-remap-in-read_traverse.c
+++ b/lib/tdb2/test/run-remap-in-read_traverse.c
@@ -1,14 +1,6 @@
+#include "tdb2-source.h"
/* We had a bug where we marked the tdb read-only for a tdb_traverse_read.
* If we then expanded the tdb, we would remap read-only, and later SEGV. */
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/traverse.c>
-#include <ccan/tdb2/transaction.c>
#include <ccan/tap/tap.h>
#include "external-agent.h"
#include "logging.h"
diff --git a/lib/tdb2/test/run-seed.c b/lib/tdb2/test/run-seed.c
index e1c23a0c57..129666299c 100644
--- a/lib/tdb2/test/run-seed.c
+++ b/lib/tdb2/test/run-seed.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-simple-delete.c b/lib/tdb2/test/run-simple-delete.c
index d06bf2d2bd..336e98115c 100644
--- a/lib/tdb2/test/run-simple-delete.c
+++ b/lib/tdb2/test/run-simple-delete.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-summary.c b/lib/tdb2/test/run-summary.c
index c92e759373..ef29be2440 100644
--- a/lib/tdb2/test/run-summary.c
+++ b/lib/tdb2/test/run-summary.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/summary.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-tdb_errorstr.c b/lib/tdb2/test/run-tdb_errorstr.c
index 27bdfcd67c..742fb89113 100644
--- a/lib/tdb2/test/run-tdb_errorstr.c
+++ b/lib/tdb2/test/run-tdb_errorstr.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
int main(int argc, char *argv[])
diff --git a/lib/tdb2/test/run-tdb_foreach.c b/lib/tdb2/test/run-tdb_foreach.c
index e34dfb86cd..b17f078074 100644
--- a/lib/tdb2/test/run-tdb_foreach.c
+++ b/lib/tdb2/test/run-tdb_foreach.c
@@ -1,11 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/transaction.c>
-#include <ccan/tdb2/check.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/run-traverse.c b/lib/tdb2/test/run-traverse.c
index f973d95d0f..610f02a516 100644
--- a/lib/tdb2/test/run-traverse.c
+++ b/lib/tdb2/test/run-traverse.c
@@ -1,12 +1,4 @@
-#include <ccan/tdb2/tdb.c>
-#include <ccan/tdb2/open.c>
-#include <ccan/tdb2/free.c>
-#include <ccan/tdb2/lock.c>
-#include <ccan/tdb2/io.c>
-#include <ccan/tdb2/hash.c>
-#include <ccan/tdb2/check.c>
-#include <ccan/tdb2/traverse.c>
-#include <ccan/tdb2/transaction.c>
+#include "tdb2-source.h"
#include <ccan/tap/tap.h>
#include "logging.h"
diff --git a/lib/tdb2/test/tdb2-source.h b/lib/tdb2/test/tdb2-source.h
new file mode 100644
index 0000000000..ade2135421
--- /dev/null
+++ b/lib/tdb2/test/tdb2-source.h
@@ -0,0 +1,10 @@
+#include <ccan/tdb2/check.c>
+#include <ccan/tdb2/free.c>
+#include <ccan/tdb2/hash.c>
+#include <ccan/tdb2/io.c>
+#include <ccan/tdb2/lock.c>
+#include <ccan/tdb2/open.c>
+#include <ccan/tdb2/summary.c>
+#include <ccan/tdb2/tdb.c>
+#include <ccan/tdb2/transaction.c>
+#include <ccan/tdb2/traverse.c>