eris/test-all

24 lines
512 B
Text
Raw Normal View History

2015-12-14 18:03:11 +00:00
#!/bin/bash
2017-06-01 01:03:39 +01:00
# Copyright (C) 2017 Andrew Hamilton. All rights reserved.
# Licensed under the Artistic License 2.0.
2015-12-14 18:03:11 +00:00
FAILURE=0
CODEBASE_PATH=$(realpath $(dirname $0))
for test in ${CODEBASE_PATH}/tests/*_test.py; do
2015-12-14 18:03:11 +00:00
echo "Testing $test ..."
python3 -m unittest ${test} 2>&1
FAILURE=$(($FAILURE | $?))
2015-12-14 18:03:11 +00:00
echo
done
if [ $FAILURE -eq 0 ]; then
2016-11-10 17:58:40 +01:00
echo -e "\e[32m" # Green
echo "Tests passed."
else
2016-11-10 17:58:40 +01:00
echo -e "\e[91m" # Red
echo "Tests failed."
fi
2016-11-10 17:58:40 +01:00
echo -e "\e[39m" # Normal
exit $FAILURE