diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2019-11-29 15:11:18 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2019-12-01 19:53:30 +0000 |
commit | 5db506ba5943868cc2c845f717508739b7f05714 (patch) | |
tree | e1b2aa6dc986024e4514adcc9419222f80d455c1 /test/functional/test_framework/test_node.py | |
parent | 19698ac6bc0e6c75a92b02c8b74ae1fa51c34e08 (diff) | |
download | bitcoin-5db506ba5943868cc2c845f717508739b7f05714.tar.xz |
tests: Add option --valgrind to run nodes under valgrind in the functional tests
Diffstat (limited to 'test/functional/test_framework/test_node.py')
-rwxr-xr-x | test/functional/test_framework/test_node.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 1c9628264f..40681790b9 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -59,7 +59,7 @@ class TestNode(): To make things easier for the test writer, any unrecognised messages will be dispatched to the RPC connection.""" - def __init__(self, i, datadir, *, chain, rpchost, timewait, bitcoind, bitcoin_cli, coverage_dir, cwd, extra_conf=None, extra_args=None, use_cli=False, start_perf=False): + def __init__(self, i, datadir, *, chain, rpchost, timewait, bitcoind, bitcoin_cli, coverage_dir, cwd, extra_conf=None, extra_args=None, use_cli=False, start_perf=False, use_valgrind=False): """ Kwargs: start_perf (bool): If True, begin profiling the node with `perf` as soon as @@ -96,6 +96,15 @@ class TestNode(): "-debugexclude=leveldb", "-uacomment=testnode%d" % i, ] + if use_valgrind: + default_suppressions_file = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + "..", "..", "..", "contrib", "valgrind.supp") + suppressions_file = os.getenv("VALGRIND_SUPPRESSIONS_FILE", + default_suppressions_file) + self.args = ["valgrind", "--suppressions={}".format(suppressions_file), + "--gen-suppressions=all", "--exit-on-first-error=yes", + "--error-exitcode=1", "--quiet"] + self.args self.cli = TestNodeCLI(bitcoin_cli, self.datadir) self.use_cli = use_cli |