@@ -31,8 +31,8 @@ def get_project_path():
31
31
32
32
33
33
def source_script (script_path ):
34
- command = f"source { script_path } && env"
35
- result = subprocess .run (command , shell = True , capture_output = True , text = True )
34
+ command = f"bash -c ' source { script_path } && env' "
35
+ result = subprocess .run (command , stdout = subprocess . PIPE , shell = True , text = True )
36
36
if result .returncode == 0 :
37
37
# Parse the output environment variables
38
38
env_vars = {}
@@ -65,9 +65,9 @@ def run_exec_file(command):
65
65
raise Exception (f"Subprocess return { result .returncode } ." )
66
66
67
67
68
- def get_common_gtest_settings ():
68
+ def get_common_gtest_settings (repeats_count ):
69
69
command = "--gtest_also_run_disabled_tests "
70
- command += "--gtest_repeat=10 "
70
+ command += f "--gtest_repeat={ repeats_count } "
71
71
command += "--gtest_recreate_environments_when_repeating "
72
72
command += "--gtest_color=0 "
73
73
return command
@@ -78,14 +78,14 @@ def run_threads():
78
78
79
79
80
80
def run_common (install_bin_dir ):
81
- valgrind_settings = "--error-exitcode=1 --leak-check=full --show-leak-kinds=all"
81
+ valgrind_running = "valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all"
82
82
83
83
if platform .system () == "Linux" and not os .environ .get ("ASAN_RUN" ):
84
- run_exec_file (f"valgrind { valgrind_settings } { Path (install_bin_dir ) / 'core_func_tests' } " )
85
- run_exec_file (f"valgrind { valgrind_settings } { Path (install_bin_dir ) / 'ref_func_tests' } " )
84
+ run_exec_file (f"{ valgrind_running } { Path (install_bin_dir ) / 'core_func_tests' } { get_common_gtest_settings ( 1 ) } " )
85
+ run_exec_file (f"{ valgrind_running } { Path (install_bin_dir ) / 'ref_func_tests' } { get_common_gtest_settings ( 1 ) } " )
86
86
87
- run_exec_file (f"{ Path (install_bin_dir ) / 'core_func_tests' } { get_common_gtest_settings ()} " )
88
- run_exec_file (f"{ Path (install_bin_dir ) / 'ref_func_tests' } { get_common_gtest_settings ()} " )
87
+ run_exec_file (f"{ Path (install_bin_dir ) / 'core_func_tests' } { get_common_gtest_settings (10 )} " )
88
+ run_exec_file (f"{ Path (install_bin_dir ) / 'ref_func_tests' } { get_common_gtest_settings (10 )} " )
89
89
90
90
91
91
def run_processes (install_bin_dir , additional_mpi_args ):
@@ -95,8 +95,8 @@ def run_processes(install_bin_dir, additional_mpi_args):
95
95
96
96
mpi_running = f"mpirun { additional_mpi_args } -np { proc_count } "
97
97
if not os .environ .get ("ASAN_RUN" ):
98
- run_exec_file (f"{ mpi_running } { Path (install_bin_dir ) / 'all_func_tests' } { get_common_gtest_settings ()} " )
99
- run_exec_file (f"{ mpi_running } { Path (install_bin_dir ) / 'mpi_func_tests' } { get_common_gtest_settings ()} " )
98
+ run_exec_file (f"{ mpi_running } { Path (install_bin_dir ) / 'all_func_tests' } { get_common_gtest_settings (10 )} " )
99
+ run_exec_file (f"{ mpi_running } { Path (install_bin_dir ) / 'mpi_func_tests' } { get_common_gtest_settings (10 )} " )
100
100
101
101
102
102
if __name__ == "__main__" :
0 commit comments