2020-01-19 09:04:59 -05:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Ensure we are in root directory
|
2021-01-02 22:32:30 -05: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 09:04:59 -05: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-03-21 18:54:33 -04:00
|
|
|
if [[ $(uname) == "Darwin" ]]; then
|
|
|
|
./openrct2-cli scan-objects
|
|
|
|
else
|
|
|
|
./openrct2 scan-objects
|
|
|
|
fi
|
2020-01-19 09:04:59 -05:00
|
|
|
|
2020-01-24 06:46:12 -05:00
|
|
|
if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then
|
|
|
|
# Now run all the tests
|
|
|
|
echo -e "\033[0;36mRunning OpenRCT2 tests...\033[0m"
|
2020-04-18 00:18:47 -04:00
|
|
|
./tests --gtest_output=xml:../artifacts/test-results.xml "$@"
|
2020-01-24 06:46:12 -05:00
|
|
|
else
|
|
|
|
echo -e "\033[0;36mRunning OpenRCT2 tests...\033[0m"
|
2020-04-18 00:18:47 -04:00
|
|
|
ctest --output-on-failure "$@"
|
2020-01-24 06:46:12 -05:00
|
|
|
fi
|