Skip to content

Commit 7f94fb8

Browse files
committed
Allow to filter on generator tests
1 parent eaf1fdc commit 7f94fb8

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

test/run_generator_tests.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LOG_FILE_GENERIC_KINE="o2dpg-test-generic-kine.log"
1717
# collect any macro files that are not directly used in INI files but that might be included in other macros
1818
MACRO_FILES_POTENTIALLY_INCLUDED=""
1919

20-
# collect all INI files to be tested
20+
# global var to collect all INI files to be tested
2121
INI_FILES=""
2222

2323
# collect test macros that do not have a corresponding INI file
@@ -264,7 +264,6 @@ collect_ini_files()
264264

265265
# this relies on INI_FILES and MACRO_FILES_POTENTIALLY_INCLUDED
266266
# collect all INI files that might include some changed macros
267-
changed_files=$(git_get_changed_files)
268267
local macros=
269268
for m in ${changed_files} ; do
270269
[[ "${m}" != *"MC/config"*".C" ]] && continue
@@ -279,7 +278,6 @@ collect_ini_files()
279278
add_ini_files_from_macros $(find_including_macros)
280279

281280
# also tests might have changed in which case we run them
282-
changed_files=$(git_get_changed_files)
283281
local macros=
284282
for m in ${changed_files} ; do
285283
[[ "${m}" != *"MC/"*"ini/tests"*".C" ]] && continue
@@ -387,7 +385,7 @@ if [[ -z "${INI_FILES}" ]] ; then
387385
fi
388386

389387
if [[ ! -z "${TEST_WITHOUT_INI}" ]] ; then
390-
echo_red "There are test macros that do not correspond to any INI file:"
388+
echo_red "Warning: There are test macros that do not correspond to any INI file:"
391389
for twi in ${TEST_WITHOUT_INI} ; do
392390
echo " - ${twi}"
393391
done
@@ -422,6 +420,23 @@ ret_global=0
422420

423421
# check each of the INI files
424422
for ini in ${ini_files_full_paths} ; do
423+
424+
# we can apply some matching if it is asked
425+
check_this="1"
426+
echo "Checking ${ini}"
427+
if [[ "${O2DPG_CHECK_FILTER}" ]]; then
428+
echo "Checking with filter ${O2DPG_CHECK_FILTER}"
429+
if [[ "${ini}" == *"${O2DPG_CHECK_FILTER}"* ]]; then
430+
check_this="1"
431+
else
432+
check_this="0"
433+
fi
434+
fi
435+
436+
if [[ "${check_this}" == "0" ]]; then
437+
continue
438+
fi
439+
425440
check_generators ${ini}
426441
RET=${?}
427442
if [[ "${RET}" != "0" ]] ; then

0 commit comments

Comments
 (0)