Skip to content

Commit

Permalink
bin/test-examples: Handle testing of exercises with additional files
Browse files Browse the repository at this point in the history
  • Loading branch information
fapdash committed Jun 30, 2024
1 parent d374db3 commit 183b6ba
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/test-examples
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,20 @@ for exercise in *; do
pushd $exercise
mv "${exercise}.el" "${exercise}.el.bak"
cp .meta/example.el "${exercise}.el"
files=()
pushd .meta
for file in example-*.el; do
if [[ -e "$file" ]]; then
mv "../${file#example-}" "../${file#example-}.bak"
cp "$file" "../${file#example-}"
files+=("${file#example-}")
fi
done
popd
emacs -batch -l ert -l "${exercise}-test.el" -f ert-run-tests-batch-and-exit
let "err_cnt += $?"
mv "${exercise}.el.bak" "${exercise}.el"
for file in "${files[@]}"; do mv "${file}.bak" "${file}"; done;
popd
done
popd > /dev/null
Expand Down

0 comments on commit 183b6ba

Please sign in to comment.