aboutsummaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-11-15 11:38:27 -0500
committerMarcoFalke <falke.marco@gmail.com>2019-12-10 19:37:37 -0500
commitfacb416ad5ba47b01ee52c273a5c5e3709f06f07 (patch)
tree66ef08295860af9be2eb1ed5a597cafab95ee5ce /ci
parent3d6752779f0504e6435fe682f0c06c60b5c4c33b (diff)
downloadbitcoin-facb416ad5ba47b01ee52c273a5c5e3709f06f07.tar.xz
ci: Add valgrind run
Diffstat (limited to 'ci')
-rw-r--r--ci/test/00_setup_env_native_valgrind.sh15
-rwxr-xr-xci/test/04_install.sh2
-rwxr-xr-xci/test/06_script_b.sh7
-rwxr-xr-xci/test/wrap-valgrind.sh18
4 files changed, 40 insertions, 2 deletions
diff --git a/ci/test/00_setup_env_native_valgrind.sh b/ci/test/00_setup_env_native_valgrind.sh
new file mode 100644
index 0000000000..906ffd7d79
--- /dev/null
+++ b/ci/test/00_setup_env_native_valgrind.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2019 The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+export LC_ALL=C.UTF-8
+
+export PACKAGES="valgrind clang llvm python3-zmq libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev"
+export USE_VALGRIND=1
+export NO_DEPENDS=1
+export TEST_RUNNER_EXTRA="p2p_segwit.py" # Only run one test for now. TODO enable all and bump timeouts
+export RUN_FUNCTIONAL_TESTS=true
+export GOAL="install"
+export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang CXX=clang++" # TODO enable GUI
diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh
index c721345250..62f30535cb 100755
--- a/ci/test/04_install.sh
+++ b/ci/test/04_install.sh
@@ -41,7 +41,7 @@ export ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order=
export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/lsan"
export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan:log_path=${BASE_SCRATCH_DIR}/sanitizer-output/tsan"
export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1"
-env | grep -E '^(BITCOIN_CONFIG|CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS)' | tee /tmp/env
+env | grep -E '^(BITCOIN_CONFIG|BASE_|CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS)' | tee /tmp/env
if [[ $HOST = *-mingw32 ]]; then
DOCKER_ADMIN="--cap-add SYS_ADMIN"
elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764)
diff --git a/ci/test/06_script_b.sh b/ci/test/06_script_b.sh
index a8e0a50f36..e641cef279 100755
--- a/ci/test/06_script_b.sh
+++ b/ci/test/06_script_b.sh
@@ -8,7 +8,6 @@ export LC_ALL=C.UTF-8
if [ -n "$QEMU_USER_CMD" ]; then
BEGIN_FOLD wrap-qemu
- echo "Prepare to run functional tests for HOST=$HOST"
# Generate all binaries, so that they can be wrapped
DOCKER_EXEC make $MAKEJOBS -C src/secp256k1 VERBOSE=1
DOCKER_EXEC make $MAKEJOBS -C src/univalue VERBOSE=1
@@ -25,6 +24,12 @@ if [ -n "$QEMU_USER_CMD" ]; then
END_FOLD
fi
+if [ -n "$USE_VALGRIND" ]; then
+ BEGIN_FOLD wrap-valgrind
+ DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh"
+ END_FOLD
+fi
+
if [ "$RUN_UNIT_TESTS" = "true" ]; then
BEGIN_FOLD unit-tests
bash -c "${CI_WAIT}" & # Print dots in case the unit tests take a long time to run
diff --git a/ci/test/wrap-valgrind.sh b/ci/test/wrap-valgrind.sh
new file mode 100755
index 0000000000..d2192061db
--- /dev/null
+++ b/ci/test/wrap-valgrind.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2018 The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+export LC_ALL=C.UTF-8
+
+for b_name in "${BASE_OUTDIR}/bin"/*; do
+ # shellcheck disable=SC2044
+ for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name $(basename $b_name)); do
+ echo "Wrap $b ..."
+ mv "$b" "${b}_orig"
+ echo '#!/usr/bin/env bash' > "$b"
+ echo "valgrind --gen-suppressions=all --quiet --error-exitcode=1 --suppressions=${BASE_ROOT_DIR}/contrib/valgrind.supp \"${b}_orig\" \"\$@\"" >> "$b"
+ chmod +x "$b"
+ done
+done