Skip to content

Commit 63d66ba

Browse files
committed
Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py
1 parent 5b0bff4 commit 63d66ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+146
-152
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ coverage_percent.txt
101101
linux-coverage-build
102102
linux-build
103103
win32-build
104-
qa/pull-tester/tests_config.py
105-
qa/pull-tester/tests_config.ini
106-
qa/cache/*
104+
test/functional/config.ini
105+
test/util/buildenv.py
106+
test/cache/*
107107

108108
!src/leveldb*/Makefile
109109

Makefile.am

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,64 @@ dist_noinst_SCRIPTS = autogen.sh
225225

226226
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
227227

228+
EXTRA_DIST += \
229+
test/util/bctest.py \
230+
test/util/bitcoin-util-test.py \
231+
test/util/data/bitcoin-util-test.json \
232+
test/util/data/blanktxv1.hex \
233+
test/util/data/blanktxv1.json \
234+
test/util/data/blanktxv2.hex \
235+
test/util/data/blanktxv2.json \
236+
test/util/data/tt-delin1-out.hex \
237+
test/util/data/tt-delin1-out.json \
238+
test/util/data/tt-delout1-out.hex \
239+
test/util/data/tt-delout1-out.json \
240+
test/util/data/tt-locktime317000-out.hex \
241+
test/util/data/tt-locktime317000-out.json \
242+
test/util/data/tx394b54bb.hex \
243+
test/util/data/txcreate1.hex \
244+
test/util/data/txcreate1.json \
245+
test/util/data/txcreate2.hex \
246+
test/util/data/txcreate2.json \
247+
test/util/data/txcreatedata1.hex \
248+
test/util/data/txcreatedata1.json \
249+
test/util/data/txcreatedata2.hex \
250+
test/util/data/txcreatedata2.json \
251+
test/util/data/txcreatedata_seq0.hex \
252+
test/util/data/txcreatedata_seq0.json \
253+
test/util/data/txcreatedata_seq1.hex \
254+
test/util/data/txcreatedata_seq1.json \
255+
test/util/data/txcreatemultisig1.hex \
256+
test/util/data/txcreatemultisig1.json \
257+
test/util/data/txcreatemultisig2.hex \
258+
test/util/data/txcreatemultisig2.json \
259+
test/util/data/txcreatemultisig3.hex \
260+
test/util/data/txcreatemultisig3.json \
261+
test/util/data/txcreatemultisig4.hex \
262+
test/util/data/txcreatemultisig4.json \
263+
test/util/data/txcreateoutpubkey1.hex \
264+
test/util/data/txcreateoutpubkey1.json \
265+
test/util/data/txcreateoutpubkey2.hex \
266+
test/util/data/txcreateoutpubkey2.json \
267+
test/util/data/txcreateoutpubkey3.hex \
268+
test/util/data/txcreateoutpubkey3.json \
269+
test/util/data/txcreatescript1.hex \
270+
test/util/data/txcreatescript1.json \
271+
test/util/data/txcreatescript2.hex \
272+
test/util/data/txcreatescript2.json \
273+
test/util/data/txcreatescript3.hex \
274+
test/util/data/txcreatescript3.json \
275+
test/util/data/txcreatescript4.hex \
276+
test/util/data/txcreatescript4.json \
277+
test/util/data/txcreatesignv1.hex \
278+
test/util/data/txcreatesignv1.json \
279+
test/util/data/txcreatesignv2.hex
280+
228281
CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
229282

283+
# This file is problematic for out-of-tree builds if it exists.
284+
DISTCLEANFILES = test/util/buildenv.pyc
285+
230286
.INTERMEDIATE: $(COVERAGE_INFO)
231287

232288
DISTCHECK_CONFIGURE_FLAGS = --enable-man

configure.ac

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,9 +1147,12 @@ AC_SUBST(EVENT_PTHREADS_LIBS)
11471147
AC_SUBST(ZMQ_LIBS)
11481148
AC_SUBST(PROTOBUF_LIBS)
11491149
AC_SUBST(QR_LIBS)
1150-
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py test/functional/config.ini])
1150+
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/functional/config.ini])
1151+
AC_CONFIG_FILES([test/util/buildenv.py],[chmod +x test/util/buildenv.py])
11511152
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
11521153
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
1154+
AC_CONFIG_LINKS([test/util/bitcoin-util-test.py:test/util/bitcoin-util-test.py])
1155+
AC_CONFIG_LINKS([test/util/bctest.py:test/util/bctest.py])
11531156

11541157
dnl boost's m4 checks do something really nasty: they export these vars. As a
11551158
dnl result, they leak into secp256k1's configure and crazy things happen.
@@ -1197,8 +1200,8 @@ esac
11971200
dnl Replace the BUILDDIR path with the correct Windows path if compiling on Native Windows
11981201
case ${OS} in
11991202
*Windows*)
1200-
sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/pull-tester/tests_config.py > test/pull-tester/tests_config-2.py
1201-
mv test/pull-tester/tests_config-2.py test/pull-tester/tests_config.py
1203+
sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/functional/config.ini > test/functional/config-2.ini
1204+
mv test/functional/config-2.ini test/functional/config.ini
12021205
;;
12031206
esac
12041207

contrib/rpm/bitcoin.spec

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,7 @@ rm -f %{buildroot}%{_bindir}/test_*
311311

312312
%check
313313
make check
314-
pushd src
315-
srcdir=. test/bitcoin-util-test.py
316-
popd
314+
srcdir=src test/bitcoin-util-test.py
317315
test/functional/test_runner.py --extended
318316

319317
%post libs -p /sbin/ldconfig

src/Makefile.test.include

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,60 +8,6 @@ noinst_PROGRAMS += test/test_bitcoin_fuzzy
88
TEST_SRCDIR = test
99
TEST_BINARY=test/test_bitcoin$(EXEEXT)
1010

11-
12-
EXTRA_DIST += \
13-
test/bctest.py \
14-
test/bitcoin-util-test.py \
15-
test/data/bitcoin-util-test.json \
16-
test/data/blanktxv1.hex \
17-
test/data/blanktxv1.json \
18-
test/data/blanktxv2.hex \
19-
test/data/blanktxv2.json \
20-
test/data/tt-delin1-out.hex \
21-
test/data/tt-delin1-out.json \
22-
test/data/tt-delout1-out.hex \
23-
test/data/tt-delout1-out.json \
24-
test/data/tt-locktime317000-out.hex \
25-
test/data/tt-locktime317000-out.json \
26-
test/data/tx394b54bb.hex \
27-
test/data/txcreate1.hex \
28-
test/data/txcreate1.json \
29-
test/data/txcreate2.hex \
30-
test/data/txcreate2.json \
31-
test/data/txcreatedata1.hex \
32-
test/data/txcreatedata1.json \
33-
test/data/txcreatedata2.hex \
34-
test/data/txcreatedata2.json \
35-
test/data/txcreatedata_seq0.hex \
36-
test/data/txcreatedata_seq0.json \
37-
test/data/txcreatedata_seq1.hex \
38-
test/data/txcreatedata_seq1.json \
39-
test/data/txcreatemultisig1.hex \
40-
test/data/txcreatemultisig1.json \
41-
test/data/txcreatemultisig2.hex \
42-
test/data/txcreatemultisig2.json \
43-
test/data/txcreatemultisig3.hex \
44-
test/data/txcreatemultisig3.json \
45-
test/data/txcreatemultisig4.hex \
46-
test/data/txcreatemultisig4.json \
47-
test/data/txcreateoutpubkey1.hex \
48-
test/data/txcreateoutpubkey1.json \
49-
test/data/txcreateoutpubkey2.hex \
50-
test/data/txcreateoutpubkey2.json \
51-
test/data/txcreateoutpubkey3.hex \
52-
test/data/txcreateoutpubkey3.json \
53-
test/data/txcreatescript1.hex \
54-
test/data/txcreatescript1.json \
55-
test/data/txcreatescript2.hex \
56-
test/data/txcreatescript2.json \
57-
test/data/txcreatescript3.hex \
58-
test/data/txcreatescript3.json \
59-
test/data/txcreatescript4.hex \
60-
test/data/txcreatescript4.json \
61-
test/data/txcreatesignv1.hex \
62-
test/data/txcreatesignv1.json \
63-
test/data/txcreatesignv2.hex
64-
6511
JSON_TEST_FILES = \
6612
test/data/script_tests.json \
6713
test/data/base58_keys_valid.json \
@@ -191,9 +137,6 @@ CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)
191137

192138
CLEANFILES += $(CLEAN_BITCOIN_TEST)
193139

194-
# This file is problematic for out-of-tree builds if it exists.
195-
DISTCLEANFILES += test/buildenv.pyc
196-
197140
bitcoin_test: $(TEST_BINARY)
198141

199142
bitcoin_test_check: $(TEST_BINARY) FORCE
@@ -203,8 +146,8 @@ bitcoin_test_clean : FORCE
203146
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
204147

205148
check-local:
206-
@echo "Running test/bitcoin-util-test.py..."
207-
$(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(PYTHON) $(srcdir)/test/bitcoin-util-test.py
149+
@echo "Running test/util/bitcoin-util-test.py..."
150+
$(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py
208151
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
209152
if EMBEDDED_UNIVALUE
210153
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check

src/test/README.md

Lines changed: 0 additions & 9 deletions

src/test/bitcoin-util-test.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/test/buildenv.py.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

test/README.md

Lines changed: 35 additions & 25 deletions

src/test/bctest.py renamed to test/util/bctest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ def parse_output(a, fmt):
2323
else:
2424
raise NotImplementedError("Don't know how to compare %s" % fmt)
2525

26-
def bctest(testDir, testObj, exeext):
26+
def bctest(testDir, testObj, buildenv):
2727
"""Runs a single test, comparing output and RC to expected output and RC.
2828
2929
Raises an error if input can't be read, executable fails, or output/RC
3030
are not as expected. Error is caught by bctester() and reported.
3131
"""
3232
# Get the exec names and arguments
33-
execprog = testObj['exec'] + exeext
33+
execprog = buildenv.BUILDDIR + "/src/" + testObj['exec'] + buildenv.exeext
3434
execargs = testObj['args']
3535
execrun = [execprog] + execargs
3636

@@ -112,7 +112,7 @@ def bctester(testDir, input_basename, buildenv):
112112

113113
for testObj in input_data:
114114
try:
115-
bctest(testDir, testObj, buildenv.exeext)
115+
bctest(testDir, testObj, buildenv)
116116
logging.info("PASSED: " + testObj["description"])
117117
except:
118118
logging.info("FAILED: " + testObj["description"])

0 commit comments

Comments
 (0)