1- api_dir = get_option (' prefix' ) + ' / api/ '
1+ api_dir = join_paths ( get_option (' prefix' ), ' api' )
22build_root = meson .project_build_root()
33
44test_env = environment ()
55test_env.set(' PYTHONDONTWRITEBYTECODE' , ' 1' )
66test_env.prepend(' PYTHONPATH' , api_dir)
77python_exe = import (' python' ).find_installation(' python3' )
8+ system_template = join_paths (api_dir, ' system_template.py' )
89
910install_subdir (meson .current_source_dir(), install_dir : ' .' )
1011
1112test (' api_template_help' ,
1213 python_exe,
1314 env : test_env,
14- args : [api_dir + ' system_template.py ' , ' -h' ])
15+ args : [system_template, ' -h' ])
1516
1617test (' api_show_solid_creators' ,
1718 python_exe,
1819 env : test_env,
19- args : [api_dir + ' system_template.py' , ' -sl' ])
20+ args : [system_template, ' -sl' ],
21+ )
2022
2123# Test all solid creators
2224g4objects = {
@@ -35,27 +37,27 @@ foreach volume: g4objects.keys()
3537 python_exe,
3638 is_parallel : false ,
3739 env : test_env,
38- args : [api_dir + ' system_template.py ' , ' -gv' , volume])
40+ args : [system_template, ' -gv' , volume])
3941 test (' api_template_show_code_for_volume' + volume + ' _with_parameters_' + pars.replace(' ' , '' ),
4042 python_exe,
4143 is_parallel : false ,
4244 env : test_env,
43- args : [api_dir + ' system_template.py ' , ' -gv' , volume, ' -gvp' , pars.replace(' ' , '' )])
45+ args : [system_template, ' -gv' , volume, ' -gvp' , pars.replace(' ' , '' )])
4446endforeach
4547
4648test (' api_show_template_code_for_G4Cons' ,
4749 python_exe,
4850 is_parallel : false ,
4951 env : test_env,
50- args : [api_dir + ' system_template.py ' , ' -gv' , ' G4Cons' , ' -silent' ])
52+ args : [system_template, ' -gv' , ' G4Cons' , ' -silent' ])
5153
5254test_dir = join_paths (build_root, ' test' )
5355test (' api_create_system' ,
5456 python_exe,
5557 is_parallel : false ,
5658 env : test_env,
57- args : [api_dir + ' system_template.py ' , ' -s' , ' test' ],
58- workdir : test_dir ,
59+ args : [system_template, ' -s' , ' test' ],
60+ workdir : build_root ,
5961 priority : 5 )
6062foreach format : [' ascii' , ' sqlite' ]
6163 test (' api_template_build_geometry_in_test_for_format_' + format,
@@ -86,15 +88,15 @@ foreach volume: g4objects.keys()
8688 python_exe,
8789 is_parallel : false ,
8890 env : test_env,
89- args : [api_dir + ' system_template.py ' , ' -s' , test_name],
90- workdir : test_dir ,
91+ args : [system_template, ' -s' , test_name],
92+ workdir : build_root ,
9193 priority : 4 )
9294 test (' api_template_replace_geometry_with' + volume,
9395 python_exe,
9496 is_parallel : false ,
9597 env : test_env,
96- args : [api_dir + ' system_template.py ' , ' -gv' , volume, ' -gvp' , pars, geo_py, sub_name],
97- workdir : test_dir ,
98+ args : [system_template, ' -gv' , volume, ' -gvp' , pars, geo_py, sub_name],
99+ workdir : build_root ,
98100 priority : - 3 )
99101 foreach format : [' ascii' , ' sqlite' ]
100102 test (' api_template_build_geometry_in_test_of_replacing_geometry_with' + volume + ' _with_format' + format,
0 commit comments