Skip to content

Commit

Permalink
Build: utility test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuzzbawls committed Dec 11, 2018
1 parent b4f08d2 commit 0fc2f83
Show file tree
Hide file tree
Showing 34 changed files with 1,455 additions and 160 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -86,6 +86,7 @@ src/qt/test/moc*.cpp
Makefile
pivx-qt
PIVX-Qt.app
background.tiff*

# Unit-tests
Makefile.test
Expand Down Expand Up @@ -113,6 +114,8 @@ coverage_percent.txt
linux-coverage-build
linux-build
win32-build
test/config.ini
test/cache/*
qa/pull-tester/run-bitcoind-for-test.sh
qa/pull-tester/tests-config.sh
qa/pull-tester/cache/*
Expand All @@ -124,7 +127,7 @@ qa/pull-tester/test.*/*
.project
/doc/doxygen/
/nbproject/

libbitcoinconsensus.pc
.idea
CMakeLists.txt
cmake-build-debug
22 changes: 22 additions & 0 deletions Makefile.am
Expand Up @@ -218,6 +218,28 @@ dist_noinst_SCRIPTS = autogen.sh

EXTRA_DIST = $(DIST_SHARE) qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)

EXTRA_DIST += \
test/util/bitcoin-util-test.py \
test/util/data/bitcoin-util-test.json \
test/util/data/blanktxv1.hex \
test/util/data/blanktxv1.json \
test/util/data/tt-delin1-out.hex \
test/util/data/tt-delin1-out.json \
test/util/data/tt-delout1-out.hex \
test/util/data/tt-delout1-out.json \
test/util/data/tt-locktime317000-out.hex \
test/util/data/tt-locktime317000-out.json \
test/util/data/tx394b54bb.hex \
test/util/data/txcreate1.hex \
test/util/data/txcreate1.json \
test/util/data/txcreate2.hex \
test/util/data/txcreate2.json \
test/util/data/txcreatescript1.hex \
test/util/data/txcreatescript1.json \
test/util/data/txcreatesign.hex \
test/util/data/txcreatesign.json \
test/util/rpcauth-test.py

CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)

.INTERMEDIATE: $(COVERAGE_INFO)
Expand Down
1 change: 1 addition & 0 deletions autogen.sh
Expand Up @@ -3,6 +3,7 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

export LC_ALL=C
set -e
srcdir="$(dirname $0)"
cd "$srcdir"
Expand Down
3 changes: 2 additions & 1 deletion configure.ac
Expand Up @@ -1167,6 +1167,7 @@ AC_MSG_CHECKING([whether to build libraries])
AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])
if test x$build_bitcoin_libs = xyes; then
AC_DEFINE(HAVE_CONSENSUS_LIB, 1, [Define this symbol if the consensus lib has been built])
AC_CONFIG_FILES([libbitcoinconsensus.pc:libbitcoinconsensus.pc.in])
fi
AC_MSG_RESULT($build_bitcoin_libs)

Expand Down Expand Up @@ -1401,7 +1402,7 @@ AC_SUBST(PROTOBUF_LIBS)
AC_SUBST(QR_LIBS)
AC_SUBST(USE_NUM_GMP)
AC_SUBST(USE_NUM_OPENSSL)
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
Expand Down
14 changes: 14 additions & 0 deletions contrib/init/org.pivx.pivxd.plist
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.pivx.pivxd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/pivxd</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
11 changes: 11 additions & 0 deletions libbitcoinconsensus.pc.in
@@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: @PACKAGE_NAME@ consensus library
Description: Library for the Bitcoin consensus protocol.
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lbitcoinconsensus
Cflags: -I${includedir}
Requires.private: libcrypto
9 changes: 5 additions & 4 deletions src/Makefile.am
Expand Up @@ -276,8 +276,8 @@ libbitcoin_wallet_a_SOURCES = \
$(BITCOIN_CORE_H)

# crypto primitives library
crypto_libbitcoin_crypto_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
crypto_libbitcoin_crypto_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
crypto_libbitcoin_crypto_a_CPPFLAGS = $(AM_CPPFLAGS) $(PIC_FLAGS)
crypto_libbitcoin_crypto_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIC_FLAGS)
crypto_libbitcoin_crypto_a_SOURCES = \
crypto/sha1.cpp \
crypto/sha256.cpp \
Expand Down Expand Up @@ -422,11 +422,11 @@ pivxd_SOURCES += pivxd-res.rc
endif
pivxd_LDADD = \
$(LIBBITCOIN_SERVER) \
$(LIBBITCOIN_WALLET) \
$(LIBBITCOIN_COMMON) \
$(LIBUNIVALUE) \
$(LIBBITCOIN_ZEROCOIN) \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_WALLET) \
$(LIBBITCOIN_ZMQ) \
$(LIBBITCOIN_CRYPTO) \
$(LIBLEVELDB) \
Expand Down Expand Up @@ -501,7 +501,7 @@ if GLIBC_BACK_COMPAT
endif

libbitcoinconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
libbitcoinconsensus_la_LIBADD = $(LIBSECP256K1) $(BOOST_LIBS)
libbitcoinconsensus_la_LIBADD = $(LIBSECP256K1)
libbitcoinconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
libbitcoinconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

Expand Down Expand Up @@ -534,6 +534,7 @@ clean-local:
-$(MAKE) -C univalue clean
-rm -f leveldb/*/*.gcda leveldb/*/*.gcno leveldb/helpers/memenv/*.gcda leveldb/helpers/memenv/*.gcno
-rm -f config.h
-rm -rf test/__pycache__

.rc.o:
@test -f $(WINDRES)
Expand Down
38 changes: 13 additions & 25 deletions src/Makefile.test.include
Expand Up @@ -6,20 +6,6 @@ bin_PROGRAMS += test/test_pivx
TEST_SRCDIR = test
TEST_BINARY=test/test_pivx$(EXEEXT)


EXTRA_DIST += \
test/bctest.py \
test/bitcoin-util-test.py \
test/data/bitcoin-util-test.json \
test/data/blanktx.hex \
test/data/tt-delin1-out.hex \
test/data/tt-delout1-out.hex \
test/data/tt-locktime317000-out.hex \
test/data/tx394b54bb.hex \
test/data/txcreate1.hex \
test/data/txcreate2.hex \
test/data/txcreatesign.hex

JSON_TEST_FILES = \
test/data/script_valid.json \
test/data/base58_keys_valid.json \
Expand All @@ -36,6 +22,8 @@ RAW_TEST_FILES = test/data/alertTests.raw

GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)

BITCOIN_TEST_SUITE = \
test/test_pivx.cpp
# test_pivx binary #
BITCOIN_TESTS =\
test/zerocoin_implementation_tests.cpp\
Expand Down Expand Up @@ -75,7 +63,6 @@ BITCOIN_TESTS =\
test/sighash_tests.cpp \
test/sigopcount_tests.cpp \
test/skiplist_tests.cpp \
test/test_pivx.cpp \
test/timedata_tests.cpp \
test/torcontrol_tests.cpp \
test/transaction_tests.cpp \
Expand All @@ -90,16 +77,14 @@ BITCOIN_TESTS += \
test/rpc_wallet_tests.cpp
endif

test_test_pivx_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
test_test_pivx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS)
test_test_pivx_LDADD =
test_test_pivx_SOURCES = $(BITCOIN_TEST_SUITE) $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
test_test_pivx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_FLAGS)
test_test_pivx_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBBITCOIN_ZEROCOIN) \
$(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
if ENABLE_WALLET
test_test_pivx_LDADD += $(LIBBITCOIN_WALLET)
endif

test_test_pivx_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBBITCOIN_ZEROCOIN) \
$(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
test_test_pivx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

test_test_pivx_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
test_test_pivx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
Expand All @@ -126,8 +111,10 @@ pivx_test_clean : FORCE
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_pivx_OBJECTS) $(TEST_BINARY)

check-local: $(BITCOIN_TESTS:.cpp=.cpp.test)
@echo "Running bitcoin-util-test.py..."
$(PYTHON) test/bitcoin-util-test.py
@echo "Running test/util/bitcoin-util-test.py..."
$(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py
@echo "Running test/util/rpcauth-test.py..."
$(PYTHON) $(top_builddir)/test/util/rpcauth-test.py
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
if EMBEDDED_UNIVALUE
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
Expand All @@ -136,6 +123,7 @@ endif
%.cpp.test: %.cpp
@echo Running tests: `cat $< | grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1` from $<
$(AM_V_at)$(TEST_BINARY) -l test_suite -t "`cat $< | grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1`" > $<.log 2>&1 || (cat $<.log && false)

%.json.h: %.json
@$(MKDIR_P) $(@D)
@{ \
Expand All @@ -145,7 +133,7 @@ endif
echo "};};"; \
} > "$@.new" && mv -f "$@.new" "$@"
@echo "Generated $@"

%.raw.h: %.raw
@$(MKDIR_P) $(@D)
@echo "namespace alert_tests{" > $@
Expand Down
54 changes: 0 additions & 54 deletions src/test/bctest.py

This file was deleted.

13 changes: 0 additions & 13 deletions src/test/bitcoin-util-test.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/test/buildenv.py.in

This file was deleted.

60 changes: 0 additions & 60 deletions src/test/data/bitcoin-util-test.json

This file was deleted.

0 comments on commit 0fc2f83

Please sign in to comment.