Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpx/lua-cjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2011-12-13 16:36:06 +0400
committerMark Pulford <mark@kyne.com.au>2011-12-13 16:36:06 +0400
commit8e5aa7cfe7b873b4eb8dd522054e16a67fb66ca8 (patch)
tree22e820373823eb0d76e170724eb7be8668a3e285 /runtests.sh
parent2be899558e59230c9fc866f6e004f6b6a17272a4 (diff)
Update build testing to show test counts/failures
Display failed tests, and successful/total test counts. Use "awk" to provide a portable "ggrep -E" with context.
Diffstat (limited to 'runtests.sh')
-rwxr-xr-xruntests.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/runtests.sh b/runtests.sh
index 45b1b8c..f273385 100755
--- a/runtests.sh
+++ b/runtests.sh
@@ -1,17 +1,20 @@
#!/bin/sh
-EGREP="grep -E"
-
PLATFORM="`uname -s`"
-[ "$PLATFORM" = "SunOS" ] && EGREP=egrep
-
set -e
+# Portable "ggrep -A" replacement
+# contextgrep PATTERN POST_MATCH_LINES
+contextgrep() {
+ awk "/$1/ { count = ($2 + 1) } count { count--; print }"
+}
+
do_tests() {
echo
cd tests
- ./test.lua | $EGREP 'version|PASS|FAIL'
+ lua -e 'require "cjson"; print("Testing Lua CJSON version " .. cjson.version)'
+ ./test.lua | contextgrep 'FAIL|Summary' 3 | grep -v PASS | cut -c -70
cd ..
}