Github Actions run unit tests. [ci skip]

This commit is contained in:
Pentarctagon 2020-11-20 12:47:16 -06:00
parent 7d9d3357cf
commit 7a90b3a134
No known key found for this signature in database
GPG key ID: 9456BC54A21DBFA0

View file

@ -6,3 +6,31 @@ scons wesnoth wesnothd campaignd boost_unit_tests build=release \
nls=false enable_lto=true sanitize="" jobs=2 --debug=time
ls -Al
# print given message ($1) and execute given command; sets EXIT_VAL on failure
execute() {
local message=$1; shift
printf 'Executing %s\n' "$message"
if "$@"; then
: # success
else
EXIT_VAL=$?
error "$message failed! ($*)"
fi
}
checkindent() {
make -C data/tools reindent &&
git diff-index --quiet HEAD
}
execute "WML validation" ./utils/travis/schema_validation.sh
execute "WML indentation check" checkindent
execute "WML tests" ./run_wml_tests -g -v -c -t "$WML_TEST_TIME"
execute "Play tests" ./utils/travis/play_test_executor.sh
execute "Boost unit tests" ./utils/travis/test_executor.sh
if [ -f "errors.log" ]; then
error $'\n*** \n*\n* Errors reported in wml unit tests, here is errors.log...\n*\n*** \n'
cat errors.log
fi