Zernit/QA/travis-ci/test.sh

36 lines
1.1 KiB
Bash
Raw Normal View History

2020-02-06 04:32:56 +01:00
#!/usr/bin/env bash
# Copyright 2019 Jacob Hrbek <kreyren@rixotstudio.cz>
# Distributed under the terms of the GNU General Public License v3 (https://www.gnu.org/licenses/gpl-3.0.en.html) or later
# shellcheck source=QA/travis-ci/travis-common.sh
2020-02-09 17:45:47 +01:00
. "QA/travis-ci/travis-common.sh"
2020-02-06 04:32:56 +01:00
# shellcheck source=QA/travis-ci/get-container.sh
2020-02-09 17:45:47 +01:00
. "QA/travis-ci/get-container.sh"
2020-02-06 04:32:56 +01:00
2020-02-09 19:35:35 +01:00
case "$TOOL" in
*check*) true ;;
*) die 0 "Skipping tests as instructed"
esac
2020-02-06 04:32:56 +01:00
# Linux as-is
if [ "$TRAVIS_OS_NAME" = linux ] && [ -z "$DOCKER" ] && [ -z "$QEMU" ]; then
2020-02-09 18:58:46 +01:00
make test-rustlang
2020-02-06 04:32:56 +01:00
# Linux via Docker
elif [ "$TRAVIS_OS_NAME" = linux ] && [ -n "$DOCKER" ] && [ -z "$QEMU" ]; then
2020-02-09 18:58:46 +01:00
sudo docker exec "$CONTAINER" make --directory="/travis/Zernit" test-rustlang
2020-02-06 04:32:56 +01:00
# MacOS X
elif [ "$TRAVIS_OS_NAME" = osx ]; then
make --directory="/Users/travis/build/Kreyrock/Kreyrock" check
elif [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$QEMU" = "FreeBSD" ]; then
ssh -p 8829 -oStrictHostKeyChecking=no -i "$HOME/.ssh/id_rsa" root@localhost \
make check
else
die "Invalid setting of TRAVIS_OS_NAME=$TRAVIS_OS_NAME, DOCKER=$DOCKER, QEMU=$QEMU!"
fi