diff --git a/tests/memory_leak.py b/tests/memory_leak.py index 02501315e..34c49c9e5 100644 --- a/tests/memory_leak.py +++ b/tests/memory_leak.py @@ -12,11 +12,11 @@ NO_LEAK_OUTPUT = "All heap blocks were freed -- no leaks are possible" -def failure_mode(): +def failure_mode(fail_cmd): test_status = 0 # Start binary print("Start binary") - z_pub_command = f"stdbuf -oL -eL valgrind ./{DIR_EXAMPLES}/z_pub -m peer" + z_pub_command = f"stdbuf -oL -eL valgrind ./{DIR_EXAMPLES}/" + fail_cmd z_pub_process = subprocess.Popen( z_pub_command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True ) @@ -157,7 +157,7 @@ def query_and_queryable(query_cmd, queryable_cmd): # Test failure mode print("*** Failure mode ***") - if failure_mode() == 1: + if failure_mode(f'z_pub -m peer') == 1: EXIT_STATUS = 1 # Test pub and sub examples print("*** Pub & sub test ***")