diff options
author | Mark Pulford <mark@kyne.com.au> | 2011-12-13 07:49:49 +1030 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2011-12-13 07:49:49 +1030 |
commit | 85f693f3320aad53213cbb2166dab082ee1b58dd (patch) | |
tree | 875d982d32b744ef6e7a3d9b1b62f69244c11ddf | |
parent | 7ca3ce91b075668428be26379e9952a6430b9ca1 (diff) | |
download | lua-cjson-85f693f3320aad53213cbb2166dab082ee1b58dd.tar.gz lua-cjson-85f693f3320aad53213cbb2166dab082ee1b58dd.tar.bz2 lua-cjson-85f693f3320aad53213cbb2166dab082ee1b58dd.zip |
Add automatic RPM build testing
-rwxr-xr-x | runtests.sh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/runtests.sh b/runtests.sh index ed78cc5..3876b45 100755 --- a/runtests.sh +++ b/runtests.sh | |||
@@ -1,7 +1,10 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | EGREP="grep -E" | 3 | EGREP="grep -E" |
4 | #EGREP="egrep" | 4 | |
5 | PLATFORM="`uname -s`" | ||
6 | |||
7 | [ "$PLATFORM" = "SunOS" ] && EGREP=egrep | ||
5 | 8 | ||
6 | set -e | 9 | set -e |
7 | 10 | ||
@@ -40,3 +43,16 @@ cp cjson.so tests | |||
40 | do_tests | 43 | do_tests |
41 | make clean | 44 | make clean |
42 | rm -f tests/cjson.so | 45 | rm -f tests/cjson.so |
46 | |||
47 | if [ "$PLATFORM" = "Linux" ] | ||
48 | then | ||
49 | echo "===== Testing RPM build =====" | ||
50 | make package | ||
51 | LOG=/tmp/build.$$ | ||
52 | rpmbuild -tb lua-cjson-1.0.4.tar.gz | tee "$LOG" | ||
53 | RPM="`awk '/^Wrote: / && ! /debuginfo/ { print $2}' < "$LOG"`" | ||
54 | sudo -- rpm -Uvh \"$RPM\" | ||
55 | do_tests | ||
56 | sudo -- rpm -e lua-cjson | ||
57 | rm -f "$LOG" | ||
58 | fi | ||