Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Commit e1cf58d

Browse files
committed
tests: Move test data into its own 'test/data' subdirectory
1 parent 5580587 commit e1cf58d

34 files changed

+44
-39
lines changed

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ AC_CONFIG_FILES([
163163
lib/Makefile
164164
src/Makefile
165165
test/Makefile
166+
test/data/Makefile
166167
external/Makefile
167168
])
168169
AC_OUTPUT

test/Makefile.am

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,12 @@ if ENABLE_VALGRIND
44
--error-exitcode=1
55
endif
66

7+
SUBDIRS = data
8+
79
AM_CPPFLAGS = -DTEST_SRCDIR=\"$(top_srcdir)/test\" \
810
-I$(top_srcdir)/include \
911
-I$(top_srcdir)/external/secp256k1/include
1012

11-
EXTRA_DIST = \
12-
base58_encode_decode.json \
13-
base58_keys_invalid.json base58_keys_valid.json \
14-
random.data \
15-
blk0.json blk120383.json tx3e0dc3da.json \
16-
blk0.ser blk120383.ser tx3e0dc3da.ser \
17-
blks10.ser \
18-
hdr193000.ser tn_hdr35141.ser \
19-
tn_blk35133.ser wallet-basics.json sighash.json \
20-
script_tests.json tx_valid.json tx_invalid.json
21-
2213
noinst_LIBRARIES= libtest.a
2314

2415
libtest_a_SOURCES= libtest.h libtest.c chisq.c randtest.c

test/base58.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,9 @@ static void runtest_keys_invalid(const char *json_base_fn)
344344

345345
int main (int argc, char *argv[])
346346
{
347-
runtest_encdec("base58_encode_decode.json");
348-
runtest_keys_valid("base58_keys_valid.json");
349-
runtest_keys_invalid("base58_keys_invalid.json");
347+
runtest_encdec("data/base58_encode_decode.json");
348+
runtest_keys_valid("data/base58_keys_valid.json");
349+
runtest_keys_invalid("data/base58_keys_invalid.json");
350350

351351
bp_key_static_shutdown();
352352
return 0;

test/blkdb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ static void runtest(const char *ser_base_fn, const struct chain_info *chain,
9797

9898
int main (int argc, char *argv[])
9999
{
100-
runtest("hdr193000.ser", &chain_metadata[CHAIN_BITCOIN], 193000,
100+
runtest("data/hdr193000.ser", &chain_metadata[CHAIN_BITCOIN], 193000,
101101
"000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317");
102-
runtest("tn_hdr35141.ser", &chain_metadata[CHAIN_TESTNET3], 35141,
102+
runtest("data/tn_hdr35141.ser", &chain_metadata[CHAIN_TESTNET3], 35141,
103103
"0000000000dde6ce4b9ad1e2a5be59f1b7ace6ef8d077d846263b0bfbc984f7f");
104104

105105
bp_key_static_shutdown();

test/block.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ static void runtest(const char *json_fn_base, const char *ser_fn_base)
8686

8787
int main (int argc, char *argv[])
8888
{
89-
runtest("blk0.json", "blk0.ser");
90-
runtest("blk120383.json", "blk120383.ser");
89+
runtest("data/blk0.json", "data/blk0.ser");
90+
runtest("data/blk120383.json", "data/blk120383.ser");
9191

9292
bp_key_static_shutdown();
9393
return 0;

test/blockfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static void runtest(const char *ser_fn_base)
5858

5959
int main (int argc, char *argv[])
6060
{
61-
runtest("blks10.ser");
61+
runtest("data/blks10.ser");
6262

6363
bp_key_static_shutdown();
6464
return 0;

test/data/Makefile.am

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
EXTRA_DIST = \
3+
base58_encode_decode.json \
4+
base58_keys_invalid.json base58_keys_valid.json \
5+
blk0.json blk0.ser blks10.ser \
6+
blk120383.json blk120383.ser \
7+
hdr193000.ser tn_hdr35141.ser \
8+
random.data script_tests.json sighash.json \
9+
tn_blk35133.ser tx3e0dc3da.json tx3e0dc3da.ser \
10+
tx_invalid.json tx_valid.json \
11+
wallet-basics.json
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)