@@ -59,7 +59,7 @@ class TestNode():
59
59
To make things easier for the test writer, any unrecognised messages will
60
60
be dispatched to the RPC connection."""
61
61
62
- 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 ):
62
+ 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 ):
63
63
"""
64
64
Kwargs:
65
65
start_perf (bool): If True, begin profiling the node with `perf` as soon as
@@ -96,6 +96,15 @@ def __init__(self, i, datadir, *, chain, rpchost, timewait, bitcoind, bitcoin_cl
96
96
"-debugexclude=leveldb" ,
97
97
"-uacomment=testnode%d" % i ,
98
98
]
99
+ if use_valgrind :
100
+ default_suppressions_file = os .path .join (
101
+ os .path .dirname (os .path .realpath (__file__ )),
102
+ ".." , ".." , ".." , "contrib" , "valgrind.supp" )
103
+ suppressions_file = os .getenv ("VALGRIND_SUPPRESSIONS_FILE" ,
104
+ default_suppressions_file )
105
+ self .args = ["valgrind" , "--suppressions={}" .format (suppressions_file ),
106
+ "--gen-suppressions=all" , "--exit-on-first-error=yes" ,
107
+ "--error-exitcode=1" , "--quiet" ] + self .args
99
108
100
109
self .cli = TestNodeCLI (bitcoin_cli , self .datadir )
101
110
self .use_cli = use_cli
0 commit comments