Skip to content

Commit 146ebb7

Browse files
authored
Added test redirection mechanism for ini generators (#1889)
1 parent 25d9c6b commit 146ebb7

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### The external generator derives from GeneratorPythia8.
2+
## The generator allows to run Pythia8 with POWHEG
3+
#---> GeneratorPythia8POWHEG
4+
[GeneratorExternal]
5+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/external/generator/generator_pythia8_powheg.C
6+
funcName=getGeneratorJEPythia8POWHEG("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/external/powheg/powheg_beauty_F2.input")
7+
8+
[GeneratorPythia8]
9+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/pythia8/generator/pythia8_powheg.cfg
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### The external generator derives from GeneratorPythia8.
2+
## The generator allows to run Pythia8 with POWHEG
3+
#---> GeneratorPythia8POWHEG
4+
[GeneratorExternal]
5+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/external/generator/generator_pythia8_powheg.C
6+
funcName=getGeneratorJEPythia8POWHEG("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/external/powheg/powheg_charm_default.input")
7+
8+
[GeneratorPythia8]
9+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/pythia8/generator/pythia8_powheg.cfg

test/run_generator_tests.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,16 @@ get_test_script_path_for_ini()
6464
{
6565
local ini_path=${1}
6666
local test_script=$(basename ${ini_path})
67-
echo $(dirname ${ini_path})/tests/${test_script%.ini}.C
67+
local path_to_test_script=$(dirname ${ini_path})/tests/${test_script%.ini}.C
68+
if [[ ! -f ${path_to_test_script} ]] ; then
69+
# Check if test redirection is applied inside the ini_path file using the #---> syntax
70+
local redirection=$(grep "#--->" ${ini_path})
71+
if [[ "${redirection}" != "" ]] ; then
72+
test_script=$(echo ${redirection} | awk '{print $2}')
73+
path_to_test_script=$(dirname ${ini_path})/tests/${test_script}.C
74+
fi
75+
fi
76+
echo ${path_to_test_script}
6877
}
6978

7079

0 commit comments

Comments
 (0)