mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-27 02:36:47 +01:00
ci: Run fuzz testing test cases under valgrind
This commit is contained in:
parent
179504ccb6
commit
a3b539a924
4 changed files with 26 additions and 3 deletions
|
@ -134,6 +134,11 @@ jobs:
|
|||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_native_fuzz.sh"
|
||||
|
||||
- stage: test
|
||||
name: 'x86_64 Linux [GOAL: install] [bionic] [no depends, only system libs, fuzzers under valgrind]'
|
||||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_native_fuzz_with_valgrind.sh"
|
||||
|
||||
- stage: test
|
||||
name: 'x86_64 Linux [GOAL: install] [bionic] [no wallet]'
|
||||
env: >-
|
||||
|
|
18
ci/test/00_setup_env_native_fuzz_with_valgrind.sh
Normal file
18
ci/test/00_setup_env_native_fuzz_with_valgrind.sh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/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 CONTAINER_NAME=ci_native_fuzz_valgrind
|
||||
export PACKAGES="clang-8 llvm-8 python3 libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev valgrind"
|
||||
export NO_DEPENDS=1
|
||||
export RUN_UNIT_TESTS=false
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
export RUN_FUZZ_TESTS=true
|
||||
export FUZZ_TESTS_CONFIG="--valgrind"
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer CC=clang-8 CXX=clang++-8"
|
||||
# Use clang-8, instead of default clang on bionic, which is clang-6 and does not come with libfuzzer on aarch64
|
|
@ -36,6 +36,6 @@ fi
|
|||
|
||||
if [ "$RUN_FUZZ_TESTS" = "true" ]; then
|
||||
BEGIN_FOLD fuzz-tests
|
||||
DOCKER_EXEC test/fuzz/test_runner.py -l DEBUG ${DIR_FUZZ_IN}
|
||||
DOCKER_EXEC test/fuzz/test_runner.py ${FUZZ_TESTS_CONFIG} -l DEBUG ${DIR_FUZZ_IN}
|
||||
END_FOLD
|
||||
fi
|
||||
|
|
|
@ -64,7 +64,7 @@ def main():
|
|||
parser.add_argument(
|
||||
'--valgrind',
|
||||
action='store_true',
|
||||
help='If true, run fuzzing binaries under the valgrind memory error detector. Valgrind 3.14 or later required.',
|
||||
help='If true, run fuzzing binaries under the valgrind memory error detector',
|
||||
)
|
||||
parser.add_argument(
|
||||
'seed_dir',
|
||||
|
@ -150,7 +150,7 @@ def run_once(*, corpus, test_list, build_dir, export_coverage, use_valgrind):
|
|||
corpus_path,
|
||||
]
|
||||
if use_valgrind:
|
||||
args = ['valgrind', '--quiet', '--error-exitcode=1', '--exit-on-first-error=yes'] + args
|
||||
args = ['valgrind', '--quiet', '--error-exitcode=1'] + args
|
||||
logging.debug('Run {} with args {}'.format(t, args))
|
||||
result = subprocess.run(args, stderr=subprocess.PIPE, universal_newlines=True)
|
||||
output = result.stderr
|
||||
|
|
Loading…
Add table
Reference in a new issue