From 1d7dd708f19f7129b80977f9c9ccf5553121166a Mon Sep 17 00:00:00 2001 From: witek-formanski Date: Sat, 4 Nov 2023 17:47:30 +0100 Subject: [PATCH] configure pipeline for new Bash script --- scripts/test_detector.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/test_detector.sh b/scripts/test_detector.sh index 0cf6173..6b6a968 100644 --- a/scripts/test_detector.sh +++ b/scripts/test_detector.sh @@ -4,19 +4,24 @@ test_folder=$1 declare -A tests_dict -for file in tests/$test_folder/*; do +shopt -s globstar +for file in tests/*/*/$test_folder/*.in; do + file_path=$(dirname "${file#tests/}") + src_file_path=$(dirname "$file_path") file_name=$(basename "$file") base_name="${file_name%.*}" file_number=$(echo $base_name | grep -o '[0-9]\+$') name=$(echo $base_name | sed "s/$file_number//") - if [ ${tests_dict[$name]+_} ]; then - if (( $file_number > ${tests_dict[$name]} )); then - tests_dict[$name]=$file_number + full_name="$src_file_path/$name" + if [ ${tests_dict[$full_name]+_} ]; then + if (( $file_number > ${tests_dict[$full_name]} )); then + tests_dict[$full_name]=$file_number fi else - tests_dict[$name]=$file_number + tests_dict[$full_name]=$file_number fi done +shopt -u globstar output_env_var="" for test_name in "${!tests_dict[@]}"; do