From 9f411ee00bbb53fcfba01d16a74f5503c569bb8c Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sat, 14 Feb 2015 22:39:55 -0800 Subject: [PATCH] clean up the output of tests --- Makefile | 7 ++++--- testfilter.sh | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100755 testfilter.sh diff --git a/Makefile b/Makefile index 38ca5f7..9c4855c 100644 --- a/Makefile +++ b/Makefile @@ -31,10 +31,11 @@ vet: go vet ./src/... test: - go test ./src/... + go test ./src/... | ./testfilter.sh -autotest: test - fswatch -or ./src | xargs -n1 -I{} go test ./src/... +autotest: + fswatch -or ./src | \ + xargs -n1 -I{} ${SHELL} -c 'echo ; date ; echo ----------------------------; go test ./src/... | ./testfilter.sh' run: build ./bin/${APPNAME} diff --git a/testfilter.sh b/testfilter.sh new file mode 100755 index 0000000..57cc952 --- /dev/null +++ b/testfilter.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# colorize the output of "go test" + +sed ''/ok/s//$(printf "\033[32;1m&\033[0m")/'' | \ + sed ''/PASS/s//$(printf "\033[32;1m&\033[0m")/'' | \ + sed ''/FAIL/s//$(printf "\033[31;1m&\033[0m")/''