Skip to content

Commit 6edbc9c

Browse files
PastaPastaPastaUdjinM6
authored andcommitted
Merge bitcoin#9956: Reorganise qa directory (#2912)
* Merge bitcoin#9956: Reorganise qa directory 63d66ba Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py (John Newbery) 5b0bff4 Rename --enable-extended-rpc-tests to --enable-extended-functional-tests (John Newbery) a9bd622 Rename test/pull-tester/rpc-tests.py to test/functional/test_runner.py (John Newbery) c28ee91 Rename rpc-tests directory to functional (John Newbery) 00902c4 Rename qa directory to test (John Newbery) Tree-SHA512: ee7125c0c647d81590177beef2c8852c4ef76fdcf888096d9d4d360562a01d8d3b453345c3040487b2a043935bd1e7e80018f34462d6e02262bedbe23edcc576 resolve build errors Signed-off-by: Pasta <Pasta@dash.org> update test_runner.py in testintegrations.sh Signed-off-by: Pasta <Pasta@dash.org> * moved dash specific tests Signed-off-by: Pasta <Pasta@dash.org> * dashify README.md Signed-off-by: Pasta <Pasta@dash.org> * removed autoix*.py Signed-off-by: Pasta <Pasta@dash.org> * change back file perms * dedashify Signed-off-by: Pasta <Pasta@dash.org>
1 parent 89d8f7a commit 6edbc9c

File tree

160 files changed

+239
-245
lines changed

Some content is hidden

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

160 files changed

+239
-245
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ coverage_percent.txt
108108
linux-coverage-build
109109
linux-build
110110
win32-build
111-
qa/pull-tester/tests_config.py
112-
qa/pull-tester/tests_config.ini
113-
qa/cache/*
111+
test/functional/config.ini
112+
test/util/buildenv.py
113+
test/cache/*
114114

115115
!src/leveldb*/Makefile
116116

Makefile.am

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
6161

6262
COVERAGE_INFO = baseline_filtered_combined.info baseline.info \
6363
leveldb_baseline.info test_dash_filtered.info total_coverage.info \
64-
baseline_filtered.info rpc_test.info rpc_test_filtered.info \
64+
baseline_filtered.info functional_test.info functional_test_filtered.info \
6565
leveldb_baseline_filtered.info test_dash_coverage.info test_dash.info
6666

6767
dist-hook:
@@ -191,20 +191,20 @@ test_dash.info: baseline_filtered_combined.info
191191
test_dash_filtered.info: test_dash.info
192192
$(LCOV) -r $< "/usr/include/*" -o $@
193193

194-
rpc_test.info: test_dash_filtered.info
195-
-@TIMEOUT=15 python qa/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS)
196-
$(LCOV) -c -d $(abs_builddir)/src --t rpc-tests -o $@
194+
functional_test.info: test_dash_filtered.info
195+
-@TIMEOUT=15 python test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS)
196+
$(LCOV) -c -d $(abs_builddir)/src --t functional-tests -o $@
197197
$(LCOV) -z -d $(abs_builddir)/src
198198
$(LCOV) -z -d $(abs_builddir)/src/leveldb
199199

200-
rpc_test_filtered.info: rpc_test.info
200+
functional_test_filtered.info: functional_test.info
201201
$(LCOV) -r $< "/usr/include/*" -o $@
202202

203203
test_dash_coverage.info: baseline_filtered_combined.info test_dash_filtered.info
204204
$(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_dash_filtered.info -o $@
205205

206-
total_coverage.info: baseline_filtered_combined.info test_dash_filtered.info rpc_test_filtered.info
207-
$(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_dash_filtered.info -a rpc_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
206+
total_coverage.info: baseline_filtered_combined.info test_dash_filtered.info functional_test_filtered.info
207+
$(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_dash_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
208208

209209
test_dash.coverage/.dirstamp: test_dash_coverage.info
210210
$(GENHTML) -s $< -o $(@D)
@@ -220,14 +220,58 @@ endif
220220

221221
dist_noinst_SCRIPTS = autogen.sh
222222

223-
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.py qa/rpc-tests $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
223+
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
224+
225+
EXTRA_DIST += \
226+
test/util/bctest.py \
227+
test/util/bitcoin-util-test.py \
228+
test/util/data/bitcoin-util-test.json \
229+
test/util/data/blanktxv1.hex \
230+
test/util/data/blanktxv1.json \
231+
test/util/data/blanktxv2.hex \
232+
test/util/data/blanktxv2.json \
233+
test/util/data/tt-delin1-out.hex \
234+
test/util/data/tt-delin1-out.json \
235+
test/util/data/tt-delout1-out.hex \
236+
test/util/data/tt-delout1-out.json \
237+
test/util/data/tt-locktime317000-out.hex \
238+
test/util/data/tt-locktime317000-out.json \
239+
test/util/data/tx394b54bb.hex \
240+
test/util/data/txcreate1.hex \
241+
test/util/data/txcreate1.json \
242+
test/util/data/txcreate2.hex \
243+
test/util/data/txcreate2.json \
244+
test/util/data/txcreatedata1.hex \
245+
test/util/data/txcreatedata1.json \
246+
test/util/data/txcreatedata2.hex \
247+
test/util/data/txcreatedata2.json \
248+
test/util/data/txcreatedata_seq0.hex \
249+
test/util/data/txcreatedata_seq0.json \
250+
test/util/data/txcreatedata_seq1.hex \
251+
test/util/data/txcreatedata_seq1.json \
252+
test/util/data/txcreatemultisig1.hex \
253+
test/util/data/txcreatemultisig1.json \
254+
test/util/data/txcreatemultisig2.hex \
255+
test/util/data/txcreatemultisig2.json \
256+
test/util/data/txcreateoutpubkey1.hex \
257+
test/util/data/txcreateoutpubkey1.json \
258+
test/util/data/txcreatescript1.hex \
259+
test/util/data/txcreatescript1.json \
260+
test/util/data/txcreatescript2.hex \
261+
test/util/data/txcreatescript2.json \
262+
test/util/data/txcreatesignv1.hex \
263+
test/util/data/txcreatesignv1.json \
264+
test/util/data/txcreatesignv2.hex
224265

225266
CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
226267

268+
# This file is problematic for out-of-tree builds if it exists.
269+
DISTCLEANFILES = test/util/buildenv.pyc
270+
227271
.INTERMEDIATE: $(COVERAGE_INFO)
228272

229273
DISTCHECK_CONFIGURE_FLAGS = --enable-man
230274

231275
clean-local:
232-
rm -rf coverage_percent.txt test_dash.coverage/ total.coverage/ qa/tmp/ cache/ $(OSX_APP)
233-
rm -rf qa/pull-tester/__pycache__
276+
rm -rf coverage_percent.txt test_dash.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP)
277+
rm -rf test/functional/__pycache__

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ submit new unit tests for old code. Unit tests can be compiled and run
4949
(assuming they weren't disabled in configure) with: `make check`. Further details on running
5050
and extending unit tests can be found in [/src/test/README.md](/src/test/README.md).
5151

52-
There are also [regression and integration tests](/qa) of the RPC interface, written
52+
There are also [regression and integration tests](/test), written
5353
in Python, that are run automatically on the build server.
54-
These tests can be run (if the [test dependencies](/qa) are installed) with: `qa/pull-tester/rpc-tests.py`
54+
These tests can be run (if the [test dependencies](/test) are installed) with: `test/functional/test_runner.py`
5555

5656
The Travis CI system makes sure that every pull request is built for Windows, Linux, and OS X, and that unit/sanity tests are run automatically.
5757

ci/test_integrationtests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ export LD_LIBRARY_PATH=$BUILD_DIR/depends/$HOST/lib
1717

1818
cd build-ci/dashcore-$BUILD_TARGET
1919

20-
./qa/pull-tester/rpc-tests.py --coverage $PASS_ARGS
20+
./test/functional/test_runner.py --coverage $PASS_ARGS

configure.ac

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ AC_ARG_ENABLE(bench,
124124
[use_bench=$enableval],
125125
[use_bench=yes])
126126

127-
AC_ARG_ENABLE([extended-rpc-tests],
128-
AS_HELP_STRING([--enable-extended-rpc-tests],[enable expensive RPC tests when using lcov (default no)]),
129-
[use_extended_rpc_tests=$enableval],
130-
[use_extended_rpc_tests=no])
127+
AC_ARG_ENABLE([extended-functional-tests],
128+
AS_HELP_STRING([--enable-extended-functional-tests],[enable expensive functional tests when using lcov (default no)]),
129+
[use_extended_functional_tests=$enableval],
130+
[use_extended_functional_tests=no])
131131

132132
AC_ARG_WITH([qrencode],
133133
[AS_HELP_STRING([--with-qrencode],
@@ -459,8 +459,8 @@ if test x$use_pkgconfig = xyes; then
459459
])
460460
fi
461461

462-
if test x$use_extended_rpc_tests != xno; then
463-
AC_SUBST(EXTENDED_RPC_TESTS, -extended)
462+
if test x$use_extended_functional_tests != xno; then
463+
AC_SUBST(EXTENDED_FUNCTIONAL_TESTS, --extended)
464464
fi
465465

466466
if test x$use_lcov = xyes; then
@@ -1200,10 +1200,12 @@ AC_SUBST(EVENT_PTHREADS_LIBS)
12001200
AC_SUBST(ZMQ_LIBS)
12011201
AC_SUBST(PROTOBUF_LIBS)
12021202
AC_SUBST(QR_LIBS)
1203-
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
1204-
AC_CONFIG_FILES([qa/pull-tester/tests_config.ini],[chmod +x qa/pull-tester/tests_config.ini])
1203+
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/functional/config.ini])
1204+
AC_CONFIG_FILES([test/util/buildenv.py],[chmod +x test/util/buildenv.py])
12051205
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
1206-
AC_CONFIG_LINKS([qa/pull-tester/rpc-tests.py:qa/pull-tester/rpc-tests.py])
1206+
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
1207+
AC_CONFIG_LINKS([test/util/bitcoin-util-test.py:test/util/bitcoin-util-test.py])
1208+
AC_CONFIG_LINKS([test/util/bctest.py:test/util/bctest.py])
12071209

12081210
dnl boost's m4 checks do something really nasty: they export these vars. As a
12091211
dnl result, they leak into secp256k1's configure and crazy things happen.
@@ -1251,8 +1253,8 @@ esac
12511253
dnl Replace the BUILDDIR path with the correct Windows path if compiling on Native Windows
12521254
case ${OS} in
12531255
*Windows*)
1254-
sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' qa/pull-tester/tests_config.py > qa/pull-tester/tests_config-2.py
1255-
mv qa/pull-tester/tests_config-2.py qa/pull-tester/tests_config.py
1256+
sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/functional/config.ini > test/functional/config-2.ini
1257+
mv test/functional/config-2.ini test/functional/config.ini
12561258
;;
12571259
esac
12581260

contrib/devtools/copyright_header.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
'src/tinyformat.h',
3434
'src/leveldb/util/env_win.cc',
3535
'src/crypto/ctaes/bench.c',
36-
'qa/rpc-tests/test_framework/bignum.py',
36+
'test/functional/test_framework/bignum.py',
3737
# python init:
3838
'*__init__.py',
3939
]

doc/developer-notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Run with the -testnet option to run with "play coins" on the test network, if yo
133133
are testing multi-machine code that needs to operate across the internet.
134134

135135
If you are testing something that can run on one machine, run with the -regtest option.
136-
In regression test mode, blocks can be created on-demand; see qa/rpc-tests/ for tests
136+
In regression test mode, blocks can be created on-demand; see test/functional/ for tests
137137
that run in -regtest mode.
138138

139139
**DEBUG_LOCKORDER**
@@ -255,7 +255,7 @@ Wallet
255255

256256
- *Rationale*: In RPC code that conditionally uses the wallet (such as
257257
`validateaddress`) it is easy to forget that global pointer `pwalletMain`
258-
can be NULL. See `qa/rpc-tests/disablewallet.py` for functional tests
258+
can be NULL. See `test/functional/disablewallet.py` for functional tests
259259
exercising the API with `-disablewallet`
260260

261261
- Include `db_cxx.h` (BerkeleyDB header) only when `ENABLE_WALLET` is set

qa/README.md

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

src/Makefile.test.include

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,48 +8,6 @@ bin_PROGRAMS += test/test_dash
88
TEST_SRCDIR = test
99
TEST_BINARY=test/test_dash$(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/txcreateoutpubkey1.hex \
44-
test/data/txcreateoutpubkey1.json \
45-
test/data/txcreatescript1.hex \
46-
test/data/txcreatescript1.json \
47-
test/data/txcreatescript2.hex \
48-
test/data/txcreatescript2.json \
49-
test/data/txcreatesignv1.hex \
50-
test/data/txcreatesignv1.json \
51-
test/data/txcreatesignv2.hex
52-
5311
JSON_TEST_FILES = \
5412
test/data/script_tests.json \
5513
test/data/base58_keys_valid.json \
@@ -174,9 +132,6 @@ CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)
174132

175133
CLEANFILES += $(CLEAN_BITCOIN_TEST)
176134

177-
# This file is problematic for out-of-tree builds if it exists.
178-
DISTCLEANFILES += test/buildenv.pyc
179-
180135
dash_test: $(TEST_BINARY)
181136

182137
dash_test_check: $(TEST_BINARY) FORCE
@@ -186,8 +141,8 @@ dash_test_clean : FORCE
186141
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_dash_OBJECTS) $(TEST_BINARY)
187142

188143
check-local:
189-
@echo "Running test/bitcoin-util-test.py..."
190-
$(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(PYTHON) $(srcdir)/test/bitcoin-util-test.py
144+
@echo "Running test/util/bitcoin-util-test.py..."
145+
$(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py
191146
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
192147
if EMBEDDED_UNIVALUE
193148
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check

src/test/README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ unit tests as possible).
3939

4040
The build system is setup to compile an executable called `test_dash`
4141
that runs all of the unit tests. The main source file is called
42-
test_dash.cpp. To add a new unit test file to our test suite you need
42+
test_dash.cpp. To add a new unit test file to our test suite you need
4343
to add the file to `src/Makefile.test.include`. The pattern is to create
4444
one test file for each class or source file for which you want to create
4545
unit tests. The file naming convention is `<source_filename>_tests.cpp`
@@ -50,12 +50,3 @@ examine `uint256_tests.cpp`.
5050
For further reading, I found the following website to be helpful in
5151
explaining how the boost unit test framework works:
5252
[http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/](http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/).
53-
54-
### bitcoin-util-test.py
55-
56-
The test directory also contains the bitcoin-util-test.py tool, which tests bitcoin utils (currently just dash-tx). This test gets run automatically during the `make check` build process. It is also possible to run the test manually from the src directory:
57-
58-
```
59-
test/bitcoin-util-test.py --srcdir=[current directory]
60-
61-
```

0 commit comments

Comments
 (0)