Skip to content

Commit

Permalink
configure pipeline for new Bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
witek-formanski committed Nov 4, 2023
1 parent 1e625c9 commit 1d7dd70
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions scripts/test_detector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d7dd70

Please sign in to comment.