1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 01:57:09 +03:00
mal/.travis_test.sh

29 lines
669 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}
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="--soft --debug-file ../${ACTION}.err" \
2015-10-26 00:17:09 +03:00
MAL_IMPL=${MAL_IMPL} ${ACTION}^${IMPL}
# no failure so remove error log
rm -f ${ACTION}.err || true