1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
#!/bin/bash -ex
## Pull in /etc/os-release so we can see what we're running on
. /etc/os-release
## Default Vars
CLONE_DIRECTORY='/github_actions_build'
CTEST_TESTING_DIRECTORY='build'
GTEST_TESTING_DIRECTORY='build/testing'
RUN_CTEST=true
RUN_GTEST=true
usage() {
set +x
echo ""
echo "Usage: ${0}"
echo ""
echo "Optional Arguments:"
echo " -c : Run only the ctest suite"
echo " -g : Run only the gtest suite"
echo " -D <clone/directory>: The absolute path to the directory where Performous"
echo " is cloned to from GitHub. Defaults to ${CLONE_DIRECTORY}"
echo " -M <test/directory>: The relative path to the testing directory for 'make test'"
echo " under the clone of the Performous repo. Defaults to ${CTEST_TESTING_DIRECTORY}"
echo " -T <test/directory>: The relative path to the testing directory for google tests"
echo " under the clone of the Performous repo. Defaults to ${GTEST_TESTING_DIRECTORY}"
echo " -h : Show this help message"
exit 1
}
## Set up getopts
while getopts "cgD:M:T:h" OPTION; do
case ${OPTION} in
"c")
RUN_GTEST=false;;
"g")
RUN_CTEST=false;;
"D")
CLONE_DIRECTORY=${OPTARG};;
"M")
CTEST_TESTING_DIRECTORY=${OPTARG};;
"T")
GTEST_TESTING_DIRECTORY=${OPTARG};;
"h")
HELP=true;;
esac
done
if [ ${HELP} ]; then
usage
fi
## Run the ctests
echo "Run unit tests"
cd ${CLONE_DIRECTORY}/${CTEST_TESTING_DIRECTORY}
make test
echo -e "\n\n\n\n\n"
## Run the gtests
echo "Run gtest unit tests"
cd ${CLONE_DIRECTORY}/${GTEST_TESTING_DIRECTORY}
./performous_test --gtest_filter=UnitTest*
|