From b0e1f12c22805091bceae3bd928c5c9f9d6f5cc7 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Thu, 14 Feb 2019 20:15:19 -0500 Subject: [PATCH] test: Add expanders when running in travis Hopefully this makes things more readable. --- test.sh | 2 ++ test/util.sh | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/test.sh b/test.sh index 88a986fb..69c86166 100755 --- a/test.sh +++ b/test.sh @@ -12,7 +12,9 @@ testsuite="$1" # print environment when running all testsuites +fold_start env.1 "environment" test -z "$testsuite" && (echo "ENV:"; env; echo; ) +fold_end env.1 # make it easy to split test into blocks label-block() { diff --git a/test/util.sh b/test/util.sh index e76ba665..ec815515 100755 --- a/test/util.sh +++ b/test/util.sh @@ -28,3 +28,16 @@ function run-test() { "$@" || failures=$( [ -n "$failures" ] && echo "$failures\\n$@" || echo "$@" ) } + +# travis expander helpers from: +# https://github.com/travis-ci/travis-rubies/blob/build/build.sh +fold_start() { + if env | grep -q -e '^TRAVIS=true$'; then + echo -e "travis_fold:start:$1\033[33;1m$2\033[0m" + fi +} +fold_end() { + if env | grep -q -e '^TRAVIS=true$'; then + echo -e "\ntravis_fold:end:$1\r" + fi +}