Skip to content

Commit

Permalink
ci: Allow for single exercise test exection
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasnorre committed Nov 8, 2024
1 parent 2e55e9b commit 5a08d1e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ file_ext="php"
function main {
has_failures=0

if [ $# -ge 1 ] && [ -n "$1" ]; then
specific_exercise=$(find ./exercises/{practice,concept} -name $1 -type d | sort)
for exercise_dir in $specific_exercise; do
test "${exercise_dir}" "example"
if [[ $? -ne 0 ]]; then
has_failures=1
fi
done
return $has_failures
fi

all_practice_exercise_dirs=$(find ./exercises/practice -maxdepth 1 -mindepth 1 -type d | sort)
for exercise_dir in $all_practice_exercise_dirs; do
test "${exercise_dir}" "example"
Expand Down

0 comments on commit 5a08d1e

Please sign in to comment.