-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also, don't depend on tput (ncurses). It's really not needed since ANSI escape sequences have been standardized for 35 years or so.
- Loading branch information
Showing
3 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 \ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Mic92
Member
|
||
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/^/ /'; \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The motivation was here to not enable colors, when output is not a terminal. Otherwise garbage is printed.
This might or not might be relevant here.