Merge pull request #106 from dubek/tcl-impl
[jackhill/mal.git] / .travis_test.sh
1 #!/bin/bash
2
3 set -ex
4
5 ACTION=${1}
6 IMPL=${2}
7 MAL_IMPL=${3:-js}
8
9 echo "ACTION: ${ACTION}"
10 echo "IMPL: ${IMPL}"
11 echo "MAL_IMPL: ${MAL_IMPL}"
12
13 # If NO_DOCKER is blank then launch use a docker image, otherwise use
14 # the Travis image/tools directly.
15 if [ "${NO_DOCKER}" ]; then
16 MAKE="make"
17 else
18 impl=$(echo "${IMPL}" | tr '[:upper:]' '[:lower:]')
19 img_impl=$(echo "${3:-${IMPL}}" | tr '[:upper:]' '[:lower:]')
20
21 MAKE="docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${img_impl} make"
22 fi
23
24 ${MAKE} TEST_OPTS="--debug-file ../${ACTION}.err" \
25 MAL_IMPL=${MAL_IMPL} ${ACTION}^${IMPL}
26
27 # no failure so remove error log
28 rm -f ${ACTION}.err || true