aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2016-03-13 14:07:59 +1300
committerDavid Phillips <dbphillipsnz@gmail.com>2016-03-13 14:07:59 +1300
commitf3beb9fc8612b12a6a19a446d543dce3d90b3ac5 (patch)
treecea6e72036688b5d3b8351208cc9a281fa925591 /test
parentae76bffb0df0e51a16662722fb307c2f3e3fd913 (diff)
downloadcue-bin-split-f3beb9fc8612b12a6a19a446d543dce3d90b3ac5.tar.xz
Run test from makefile, add colour to test results
Diffstat (limited to 'test')
-rwxr-xr-xtest/run-tests.sh13
1 files changed, 10 insertions, 3 deletions
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