From f3beb9fc8612b12a6a19a446d543dce3d90b3ac5 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Sun, 13 Mar 2016 14:07:59 +1300 Subject: Run test from makefile, add colour to test results --- test/run-tests.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'test/run-tests.sh') diff --git a/test/run-tests.sh b/test/run-tests.sh index c6a7cce..87137fc 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -1,13 +1,17 @@ #!/bin/sh -EXECUTABLE="$PWD/../cue-bin-split" fail() { - echo "[FAIL] $i: $@" + echo -e '[\e[1;31mFAIL\e[0m] '$i: $@ exit 1 } +pass() +{ + echo -e '[\e[0;32mPASS\e[0m] '$i: $@ +} + check_expected() { [ -z $1 ] && echo WARN: check_expected called with no argument @@ -19,6 +23,8 @@ check_expected() fi } +pushd $(dirname $0) >/dev/null +EXECUTABLE="$PWD/../cue-bin-split" for i in *.test ; do pushd ${i} >/dev/null ( . ./run.sh ) 2>stderr.tmp >stdout.tmp @@ -29,8 +35,9 @@ for i in *.test ; do check_expected stdout check_expected stderr - echo "[PASS] $i" + pass $i rm std{err,out}.tmp popd >/dev/null done +popd >/dev/null -- cgit v1.1