From e94fc238cf87b90547803d29b04f55e0bb211daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 6 Oct 2017 06:04:12 -0500 Subject: fixing bashisms in test code This fixed the build on ubuntu/debian, where dash is the sh. --- mk/tests.mk | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mk') diff --git a/mk/tests.mk b/mk/tests.mk index aa97d6427..d18b91058 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -10,13 +10,12 @@ endef # Color code from https://unix.stackexchange.com/a/10065 installcheck: @total=0; failed=0; \ - pad=" "; \ red=""; \ green=""; \ normal=""; \ if [ -t 1 ]; then \ ncolors="$$(tput colors)"; \ - if [[ -n "$$ncolors" && $$ncolors -ge 8 ]]; then \ + if [ -n "$$ncolors" ] && [ "$$ncolors" -ge 8 ]; then \ red="$$(tput setaf 1)"; \ green="$$(tput setaf 2)"; \ normal="$$(tput sgr0)"; \ @@ -24,9 +23,9 @@ installcheck: fi; \ for i in $(_installcheck-list); do \ total=$$((total + 1)); \ - printf "running test $$i... $${pad:$${#i}}"; \ + printf "running test $$i..."; \ log="$$(cd $$(dirname $$i) && $(tests-environment) $$(basename $$i) 2>&1)"; \ - if [ $$? == 0 ]; then \ + if [ $$? -eq 0 ]; then \ echo "[$${green}PASS$$normal]"; \ else \ echo "[$${red}FAIL$$normal]"; \ -- cgit v1.2.3