@@ -59,7 +59,7 @@ class TestNode():
5959 To make things easier for the test writer, any unrecognised messages will
6060 be dispatched to the RPC connection."""
6161
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 ):
6363 """
6464 Kwargs:
6565 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
9696 "-debugexclude=leveldb" ,
9797 "-uacomment=testnode%d" % i ,
9898 ]
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
99108
100109 self .cli = TestNodeCLI (bitcoin_cli , self .datadir )
101110 self .use_cli = use_cli
0 commit comments