comfortable-swipe/tests/run_tests
2020-04-18 01:05:15 +08:00

25 lines
423 B
Bash
Executable File

#!/bin/bash
set -e
DIR="$(dirname "$0")"
# just call abort on error
tempout="$(mktemp)"
abort () {
rm "$tempout"
echo "Test aborted"
exit 1
}
# run all shell files in this directory
for sh in "$DIR/test_"*.sh; do
/bin/bash "$sh" || abort
done
# run all cpp files in this directory
for cpp in "$DIR/test_"*.cpp; do
g++ -std=c++11 -O2 "$cpp" -lxdo -o "$tempout" || abort
"$tempout" || abort
done