diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-11-07T11·06+0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-11-07T11·09+0100 |
commit | fd10f6f2414521947ca60b9d1508d909f50e9faa (patch) | |
tree | 6a2c1608f9529a340e720b8352e93cba46c7f365 | |
parent | dc30856141a1ef3958dfe230611d9447d7a13957 (diff) |
Show when tests are skipped
Also, don't depend on tput (ncurses). It's really not needed since ANSI escape sequences have been standardized for 35 years or so.
-rw-r--r-- | mk/tests.mk | 16 | ||||
-rw-r--r-- | tests/fetchGit.sh | 2 | ||||
-rw-r--r-- | tests/fetchMercurial.sh | 2 |
3 files changed, 11 insertions, 9 deletions
diff --git a/mk/tests.mk b/mk/tests.mk index 1138857c3c16..e353d46a0d02 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -12,21 +12,23 @@ installcheck: @total=0; failed=0; \ red=""; \ green=""; \ + yellow=""; \ normal=""; \ if [ -t 1 ]; then \ - ncolors="$$(tput colors)"; \ - if [ -n "$$ncolors" ] && [ "$$ncolors" -ge 8 ]; then \ - red="$$(tput setaf 1)"; \ - green="$$(tput setaf 2)"; \ - normal="$$(tput sgr0)"; \ - fi; \ + red="[31;1m"; \ + green="[32;1m"; \ + yellow="[33;1m"; \ + normal="[m"; \ fi; \ for i in $(_installcheck-list); do \ total=$$((total + 1)); \ printf "running test $$i..."; \ log="$$(cd $$(dirname $$i) && $(tests-environment) $$(basename $$i) 2>&1)"; \ - if [ $$? -eq 0 ]; then \ + status=$$?; \ + if [ $$status -eq 0 ]; then \ echo " [$${green}PASS$$normal]"; \ + elif [ $$status -eq 99 ]; then \ + echo " [$${yellow}SKIP$$normal]"; \ else \ echo " [$${red}FAIL$$normal]"; \ echo "$$log" | sed 's/^/ /'; \ diff --git a/tests/fetchGit.sh b/tests/fetchGit.sh index a967380cd5b2..f13de89f7ff4 100644 --- a/tests/fetchGit.sh +++ b/tests/fetchGit.sh @@ -2,7 +2,7 @@ source common.sh if [[ -z $(type -p git) ]]; then echo "Git not installed; skipping Git tests" - exit 0 + exit 99 fi clearStore diff --git a/tests/fetchMercurial.sh b/tests/fetchMercurial.sh index 0c9f4bdbbc87..6cfc0a708e87 100644 --- a/tests/fetchMercurial.sh +++ b/tests/fetchMercurial.sh @@ -2,7 +2,7 @@ source common.sh if [[ -z $(type -p hg) ]]; then echo "Mercurial not installed; skipping Mercurial tests" - exit 0 + exit 99 fi clearStore |