1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-11 00:52:44 +03:00
mal/.travis_test.sh
2017-09-11 18:31:55 -05:00

34 lines
757 B
Bash
Executable File

#!/bin/bash
set -ex
ACTION=${1}
IMPL=${2}
MAL_IMPL=${3:-js}
mode_var=${IMPL}_MODE
mode_val=${!mode_var}
echo "ACTION: ${ACTION}"
echo "IMPL: ${IMPL}"
echo "MAL_IMPL: ${MAL_IMPL}"
# 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:]')
MAKE="docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${img_impl} make"
fi
${MAKE} TEST_OPTS="--debug-file ../${ACTION}.err" \
MAL_IMPL=${MAL_IMPL} \
${mode_val:+${mode_var}=${mode_val}} \
${ACTION}^${IMPL}
# no failure so remove error log
rm -f ${ACTION}.err || true