Merge pull request #1762 from ZyX-I/travis-folds

Use custom travis folds
This commit is contained in:
Nikolai Aleksandrovich Pavlov 2017-05-01 06:19:53 +03:00 committed by GitHub
commit 5e46d3b1ef
2 changed files with 13 additions and 1 deletions

View File

@ -17,7 +17,7 @@ checkout_cached_dir() {
fi
if ! test -d "$target" ; then
git clone --depth=1 "$url" "$target"
git rev-parse HEAD > .version
git rev-parse HEAD > "$target/.version"
rm -rf "$target"/.git
fi
}

View File

@ -16,9 +16,20 @@ if test -z "$FAILED" ; then
FAILURES_FILE="$ROOT/tests/failures"
fi
ANSI_CLEAR="\033[0K"
travis_fold() {
local action="$1"
local name="$2"
name="$(echo -n "$name" | tr '\n\0' '--' | sed -r 's/[^A-Za-z0-9]+/-/g')"
name="$(echo -n "$name" | sed -r 's/-$//')"
echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
}
enter_suite() {
local suite_name="$1" ; shift
export POWERLINE_CURRENT_SUITE="${POWERLINE_CURRENT_SUITE}/$suite_name"
travis_fold start "$POWERLINE_CURRENT_SUITE"
}
exit_suite() {
@ -29,6 +40,7 @@ exit_suite() {
echo "Suite ${POWERLINE_CURRENT_SUITE} failed, summary:"
echo "${FAIL_SUMMARY}"
fi
travis_fold end "$POWERLINE_CURRENT_SUITE"
export POWERLINE_CURRENT_SUITE="${POWERLINE_CURRENT_SUITE%/*}"
if test "$1" != "--continue" ; then
exit $FAILED