2022-03-09 21:15:32 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
set -e
|
2020-01-19 14:04:59 +00:00
|
|
|
|
|
|
|
|
# Ensure we are in root directory
|
2021-01-02 20:32:30 -07:00
|
|
|
if [[ $(uname) == "Darwin" ]]; then
|
|
|
|
|
basedir="$(perl -MCwd=abs_path -le 'print abs_path readlink(shift);' `dirname $0`/..)"
|
|
|
|
|
else
|
|
|
|
|
basedir="$(readlink -f `dirname $0`/..)"
|
|
|
|
|
fi
|
2020-01-19 14:04:59 +00:00
|
|
|
cd $basedir/bin
|
|
|
|
|
|
|
|
|
|
# Scan objects first so that does not happen within a test
|
|
|
|
|
echo -e "\033[0;36mBuilding OpenRCT2 repository indexes...\033[0m"
|
2021-04-05 19:18:09 -06:00
|
|
|
./openrct2-cli scan-objects
|
2020-01-19 14:04:59 +00:00
|
|
|
|
2020-01-24 11:46:12 +00:00
|
|
|
if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then
|
|
|
|
|
# Now run all the tests
|
|
|
|
|
echo -e "\033[0;36mRunning OpenRCT2 tests...\033[0m"
|
2020-04-18 01:18:47 -03:00
|
|
|
./tests --gtest_output=xml:../artifacts/test-results.xml "$@"
|
2020-01-24 11:46:12 +00:00
|
|
|
else
|
|
|
|
|
echo -e "\033[0;36mRunning OpenRCT2 tests...\033[0m"
|
2023-05-06 14:54:33 +02:00
|
|
|
ctest -j 2 --output-on-failure --output-junit ../artifacts/test-results.xml "$@"
|
2020-01-24 11:46:12 +00:00
|
|
|
fi
|