From 85f693f3320aad53213cbb2166dab082ee1b58dd Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Tue, 13 Dec 2011 07:49:49 +1030 Subject: Add automatic RPM build testing --- runtests.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/runtests.sh b/runtests.sh index ed78cc5..3876b45 100755 --- a/runtests.sh +++ b/runtests.sh @@ -1,7 +1,10 @@ #!/bin/sh EGREP="grep -E" -#EGREP="egrep" + +PLATFORM="`uname -s`" + +[ "$PLATFORM" = "SunOS" ] && EGREP=egrep set -e @@ -40,3 +43,16 @@ cp cjson.so tests do_tests make clean rm -f tests/cjson.so + +if [ "$PLATFORM" = "Linux" ] +then + echo "===== Testing RPM build =====" + make package + LOG=/tmp/build.$$ + rpmbuild -tb lua-cjson-1.0.4.tar.gz | tee "$LOG" + RPM="`awk '/^Wrote: / && ! /debuginfo/ { print $2}' < "$LOG"`" + sudo -- rpm -Uvh \"$RPM\" + do_tests + sudo -- rpm -e lua-cjson + rm -f "$LOG" +fi -- cgit v1.2.3-55-g6feb