Merge pull request #6813

d80e3cb Support gathering of code coverage data for RPC tests (dexX7)
e3b5e6c Run extended BitcoinJ tests for coverage based on config (dexX7)
45d4ff0 Add config option to enable extended RPC tests for code coverage (dexX7)
8e3a27b Require Python for RPC tests, when using lcov (dexX7)
d425877 Remove coverage and test related files, when cleaning up (dexX7)
4d2a926 Ignore coverage data related and temporary test files (dexX7)
This commit is contained in:
Wladimir J. van der Laan 2015-10-26 09:09:16 +01:00
commit 5242bb32c7
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
4 changed files with 45 additions and 7 deletions

4
.gitignore vendored
View File

@ -91,6 +91,7 @@ build
#lcov
*.gcno
*.gcda
/*.info
test_bitcoin.coverage/
total.coverage/
@ -104,6 +105,9 @@ qa/pull-tester/run-bitcoind-for-test.sh
qa/pull-tester/tests_config.py
qa/pull-tester/cache/*
qa/pull-tester/test.*/*
qa/tmp
cache/
share/BitcoindComparisonTool.jar
!src/leveldb*/Makefile

View File

@ -39,7 +39,7 @@ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) $
COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
baseline_filtered.info block_test_filtered.info \
baseline_filtered.info block_test_filtered.info rpc_test.info rpc_test_filtered.info \
leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
dist-hook:
@ -170,7 +170,7 @@ test_bitcoin_filtered.info: test_bitcoin.info
block_test.info: test_bitcoin_filtered.info
$(MKDIR_P) qa/tmp
-@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool 0
-@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS)
$(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@
$(LCOV) -z -d $(abs_builddir)/src
$(LCOV) -z -d $(abs_builddir)/src/leveldb
@ -178,11 +178,20 @@ block_test.info: test_bitcoin_filtered.info
block_test_filtered.info: block_test.info
$(LCOV) -r $< "/usr/include/*" -o $@
rpc_test.info: test_bitcoin_filtered.info
-@TIMEOUT=15 python qa/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS)
$(LCOV) -c -d $(abs_builddir)/src --t rpc-tests -o $@
$(LCOV) -z -d $(abs_builddir)/src
$(LCOV) -z -d $(abs_builddir)/src/leveldb
rpc_test_filtered.info: rpc_test.info
$(LCOV) -r $< "/usr/include/*" -o $@
test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
$(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info block_test_filtered.info
$(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a block_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info block_test_filtered.info rpc_test_filtered.info
$(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a block_test_filtered.info -a rpc_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info
$(GENHTML) -s $< -o $(@D)
@ -211,4 +220,4 @@ CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
.INTERMEDIATE: $(COVERAGE_INFO)
clean-local:
rm -rf test_bitcoin.coverage/ total.coverage/ $(OSX_APP)
rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ qa/tmp/ cache/ $(OSX_APP)

View File

@ -58,6 +58,7 @@ AC_PATH_TOOL(STRIP, strip)
AC_PATH_TOOL(GCOV, gcov)
AC_PATH_PROG(LCOV, lcov)
AC_PATH_PROG(JAVA, java)
AC_PATH_PROG(PYTHON, python)
AC_PATH_PROG(GENHTML, genhtml)
AC_PATH_PROG([GIT], [git])
AC_PATH_PROG(CCACHE,ccache)
@ -106,6 +107,11 @@ AC_ARG_ENABLE([comparison-tool-reorg-tests],
[use_comparison_tool_reorg_tests=$enableval],
[use_comparison_tool_reorg_tests=no])
AC_ARG_ENABLE([extended-rpc-tests],
AS_HELP_STRING([--enable-extended-rpc-tests],[enable expensive RPC tests when using lcov (default no)]),
[use_extended_rpc_tests=$enableval],
[use_extended_rpc_tests=no])
AC_ARG_WITH([qrencode],
[AS_HELP_STRING([--with-qrencode],
[enable QR code support (default is yes if qt is enabled and libqrencode is found)])],
@ -341,6 +347,10 @@ else
AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 0)
fi
if test x$use_extended_rpc_tests != xno; then
AC_SUBST(EXTENDED_RPC_TESTS, -extended)
fi
if test x$use_lcov = xyes; then
if test x$LCOV = x; then
AC_MSG_ERROR("lcov testing requested but lcov not found")
@ -351,6 +361,9 @@ if test x$use_lcov = xyes; then
if test x$JAVA = x; then
AC_MSG_ERROR("lcov testing requested but java not found")
fi
if test x$PYTHON = x; then
AC_MSG_ERROR("lcov testing requested but python not found")
fi
if test x$GENHTML = x; then
AC_MSG_ERROR("lcov testing requested but genhtml not found")
fi

View File

@ -412,7 +412,19 @@ libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BIT
endif
#
CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a
CLEANFILES += *.gcda *.gcno
CLEANFILES += compat/*.gcda compat/*.gcno
CLEANFILES += consensus/*.gcda consensus/*.gcno
CLEANFILES += crypto/*.gcda crypto/*.gcno
CLEANFILES += policy/*.gcda policy/*.gcno
CLEANFILES += primitives/*.gcda primitives/*.gcno
CLEANFILES += script/*.gcda script/*.gcno
CLEANFILES += support/*.gcda support/*.gcno
CLEANFILES += univalue/*.gcda univalue/*.gcno
CLEANFILES += wallet/*.gcda wallet/*.gcno
CLEANFILES += wallet/test/*.gcda wallet/test/*.gcno
CLEANFILES += zmq/*.gcda zmq/*.gcno
DISTCLEANFILES = obj/build.h
@ -422,7 +434,7 @@ clean-local:
-$(MAKE) -C leveldb clean
-$(MAKE) -C secp256k1 clean
-$(MAKE) -C univalue clean
rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
-rm -f leveldb/*/*.gcda leveldb/*/*.gcno leveldb/helpers/memenv/*.gcda leveldb/helpers/memenv/*.gcno
-rm -f config.h
.rc.o: