1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-11 08:56:41 +03:00
mal/.travis_test.sh

34 lines
757 B
Bash
Raw Normal View History

#!/bin/bash
set -ex
2015-10-10 18:54:08 +03:00
ACTION=${1}
IMPL=${2}
MAL_IMPL=${3:-js}
2017-09-12 02:30:29 +03:00
mode_var=${IMPL}_MODE
mode_val=${!mode_var}
2015-10-10 18:54:08 +03:00
echo "ACTION: ${ACTION}"
echo "IMPL: ${IMPL}"
echo "MAL_IMPL: ${MAL_IMPL}"
2015-10-26 00:17:09 +03:00
# If NO_DOCKER is blank then launch use a docker image, otherwise use
# the Travis image/tools directly.
if [ "${NO_DOCKER}" ]; then
MAKE="make"
else
impl=$(echo "${IMPL}" | tr '[:upper:]' '[:lower:]')
img_impl=$(echo "${3:-${IMPL}}" | tr '[:upper:]' '[:lower:]')
2015-10-26 00:17:09 +03:00
MAKE="docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${img_impl} make"
fi
2015-10-26 00:17:09 +03:00
${MAKE} TEST_OPTS="--debug-file ../${ACTION}.err" \
2017-07-27 08:52:31 +03:00
MAL_IMPL=${MAL_IMPL} \
${mode_val:+${mode_var}=${mode_val}} \
2017-07-27 08:52:31 +03:00
${ACTION}^${IMPL}
2015-10-26 00:17:09 +03:00
# no failure so remove error log
rm -f ${ACTION}.err || true