From 8faee3c26a531b398d17e53b2b82c105081deee5 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sun, 25 Apr 2021 18:48:01 -0500 Subject: [PATCH] ci.sh: re-order output to make log parsing easier. --- ci.sh | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/ci.sh b/ci.sh index b0b8a9dd..aa92de5b 100755 --- a/ci.sh +++ b/ci.sh @@ -5,6 +5,8 @@ set -ex ACTION=${1} IMPL=${2} +die() { local ret=$1; shift; echo >&2 "${*}"; exit $ret; } + # Environment variable configuration BUILD_IMPL=${BUILD_IMPL:-${IMPL}} @@ -12,40 +14,39 @@ if [ "${DO_SELF_HOST}" ]; then MAL_IMPL=${IMPL} IMPL=mal fi + if [ "${DO_HARD}" ]; then TEST_OPTS="${TEST_OPTS} --hard" fi -echo "ACTION: ${ACTION}" -echo "IMPL: ${IMPL}" -echo "BUILD_IMPL: ${BUILD_IMPL}" -echo "MAL_IMPL: ${MAL_IMPL}" - -if [ "${NO_PERF}" -a "${ACTION}" = "perf" ]; then - echo "Skipping perf test" - exit 0 -fi -if [ "${NO_SELF_HOST}" -a "${DO_SELF_HOST}" ]; then - echo "Skipping ${ACTION} of ${MAL_IMPL} self-host" - exit 0 -fi -if [ "${NO_SELF_HOST_PERF}" -a "${DO_SELF_HOST}" -a "${ACTION}" = "perf" ]; then - echo "Skipping only perf test for ${MAL_IMPL} self-host" - exit 0 -fi - raw_mode_var=${MAL_IMPL:-${IMPL}}_MODE mode_var=${raw_mode_var/-/__} mode_var=${mode_var/./__} mode_val=${!mode_var} +MAKE="make ${mode_val:+${mode_var}=${mode_val}}" + log_prefix="${ACTION}${REGRESS:+-regress}-${IMPL}${mode_val:+-${mode_val}}" TEST_OPTS="${TEST_OPTS} --debug-file ../../${log_prefix}.debug" # Log everything below this point: exec &> >(tee ./${log_prefix}.log) -MAKE="make ${mode_val:+${mode_var}=${mode_val}}" +if [ "${NO_PERF}" -a "${ACTION}" = "perf" ]; then + die 0 "Skipping perf test" +fi +if [ "${NO_SELF_HOST}" -a "${DO_SELF_HOST}" ]; then + die 0 "Skipping ${ACTION} of ${MAL_IMPL} self-host" +fi +if [ "${NO_SELF_HOST_PERF}" -a "${DO_SELF_HOST}" -a "${ACTION}" = "perf" ]; then + die 0 "Skipping only perf test for ${MAL_IMPL} self-host" +fi + +echo "ACTION: ${ACTION}" +echo "IMPL: ${IMPL}" +echo "BUILD_IMPL: ${BUILD_IMPL}" +echo "MAL_IMPL: ${MAL_IMPL}" +echo "TEST_OPTS: ${TEST_OPTS}" # If NO_DOCKER is blank then launch use a docker image, otherwise use # the Travis/Github Actions image/tools directly.