2015-10-09 20:13:05 +03:00
|
|
|
#!/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
|
2017-09-12 01:49:26 +03:00
|
|
|
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
|
2015-10-09 20:13:05 +03:00
|
|
|
impl=$(echo "${IMPL}" | tr '[:upper:]' '[:lower:]')
|
2015-10-10 22:46:42 +03:00
|
|
|
img_impl=$(echo "${3:-${IMPL}}" | tr '[:upper:]' '[:lower:]')
|
2015-10-09 20:13:05 +03:00
|
|
|
|
2015-10-26 00:17:09 +03:00
|
|
|
MAKE="docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${img_impl} make"
|
2015-10-10 06:45:48 +03:00
|
|
|
fi
|
2015-10-26 00:17:09 +03:00
|
|
|
|
2015-11-10 06:16:38 +03:00
|
|
|
${MAKE} TEST_OPTS="--debug-file ../${ACTION}.err" \
|
2017-07-27 08:52:31 +03:00
|
|
|
MAL_IMPL=${MAL_IMPL} \
|
2017-09-12 01:49:26 +03:00
|
|
|
${mode_val:+${mode_var}=${mode_val}} \
|
2017-07-27 08:52:31 +03:00
|
|
|
${ACTION}^${IMPL}
|
2015-10-26 00:17:09 +03:00
|
|
|
|
2015-10-10 22:46:42 +03:00
|
|
|
# no failure so remove error log
|
2015-10-26 00:29:32 +03:00
|
|
|
rm -f ${ACTION}.err || true
|