forked from lix-project/lix
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.
This commit is contained in:
parent
dc30856141
commit
fd10f6f241
16
mk/tests.mk
16
mk/tests.mk
|
@ -12,21 +12,23 @@ installcheck:
|
||||||
@total=0; failed=0; \
|
@total=0; failed=0; \
|
||||||
red=""; \
|
red=""; \
|
||||||
green=""; \
|
green=""; \
|
||||||
|
yellow=""; \
|
||||||
normal=""; \
|
normal=""; \
|
||||||
if [ -t 1 ]; then \
|
if [ -t 1 ]; then \
|
||||||
ncolors="$$(tput colors)"; \
|
red="[31;1m"; \
|
||||||
if [ -n "$$ncolors" ] && [ "$$ncolors" -ge 8 ]; then \
|
green="[32;1m"; \
|
||||||
red="$$(tput setaf 1)"; \
|
yellow="[33;1m"; \
|
||||||
green="$$(tput setaf 2)"; \
|
normal="[m"; \
|
||||||
normal="$$(tput sgr0)"; \
|
|
||||||
fi; \
|
|
||||||
fi; \
|
fi; \
|
||||||
for i in $(_installcheck-list); do \
|
for i in $(_installcheck-list); do \
|
||||||
total=$$((total + 1)); \
|
total=$$((total + 1)); \
|
||||||
printf "running test $$i..."; \
|
printf "running test $$i..."; \
|
||||||
log="$$(cd $$(dirname $$i) && $(tests-environment) $$(basename $$i) 2>&1)"; \
|
log="$$(cd $$(dirname $$i) && $(tests-environment) $$(basename $$i) 2>&1)"; \
|
||||||
if [ $$? -eq 0 ]; then \
|
status=$$?; \
|
||||||
|
if [ $$status -eq 0 ]; then \
|
||||||
echo " [$${green}PASS$$normal]"; \
|
echo " [$${green}PASS$$normal]"; \
|
||||||
|
elif [ $$status -eq 99 ]; then \
|
||||||
|
echo " [$${yellow}SKIP$$normal]"; \
|
||||||
else \
|
else \
|
||||||
echo " [$${red}FAIL$$normal]"; \
|
echo " [$${red}FAIL$$normal]"; \
|
||||||
echo "$$log" | sed 's/^/ /'; \
|
echo "$$log" | sed 's/^/ /'; \
|
||||||
|
|
|
@ -2,7 +2,7 @@ source common.sh
|
||||||
|
|
||||||
if [[ -z $(type -p git) ]]; then
|
if [[ -z $(type -p git) ]]; then
|
||||||
echo "Git not installed; skipping Git tests"
|
echo "Git not installed; skipping Git tests"
|
||||||
exit 0
|
exit 99
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clearStore
|
clearStore
|
||||||
|
|
|
@ -2,7 +2,7 @@ source common.sh
|
||||||
|
|
||||||
if [[ -z $(type -p hg) ]]; then
|
if [[ -z $(type -p hg) ]]; then
|
||||||
echo "Mercurial not installed; skipping Mercurial tests"
|
echo "Mercurial not installed; skipping Mercurial tests"
|
||||||
exit 0
|
exit 99
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clearStore
|
clearStore
|
||||||
|
|
Loading…
Reference in a new issue