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-11-29 16:25:54 +0400
committerMark Pulford <mark@kyne.com.au>2011-11-29 16:25:54 +0400
commita5f6b3e2f9ed7eb6788bf6568c31746185bcfa86 (patch)
treeabeacad12b1911ca9249310a0371715106ad7552 /runtests.sh
parent630bb3f16f27c72e3fc2daf3161c96f0fd9c1ba0 (diff)
Add automated build testing (LuaRocks, Makefile)
Diffstat (limited to 'runtests.sh')
-rwxr-xr-xruntests.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/runtests.sh b/runtests.sh
new file mode 100755
index 0000000..1e0a5cd
--- /dev/null
+++ b/runtests.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+MAKE=make
+#MAKE=gmake
+
+EGREP="grep -E"
+#EGREP="egrep"
+
+set -e
+
+do_tests() {
+ echo
+ cd tests
+ ./test.lua | $EGREP 'version|PASS|FAIL'
+ cd ..
+}
+
+cat <<EOT
+Please ensure you do not have the Lua CJSON module installed before
+running these tests.
+
+EOT
+
+echo "===== Setting LuaRocks PATH ====="
+eval "`luarocks path`"
+
+echo "===== Building UTF-8 test data ====="
+( cd tests && ./genutf8.pl; )
+
+echo "===== Cleaning old build data ====="
+$MAKE clean
+rm -f tests/cjson.so
+
+echo "===== Testing LuaRocks build ====="
+luarocks make --local
+do_tests
+luarocks remove --local lua-cjson
+$MAKE clean
+
+echo "===== Testing Makefile build ====="
+$MAKE
+cp cjson.so tests
+do_tests
+$MAKE clean
+rm -f tests/cjson.so