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-15 12:34:55 +0400
committerMark Pulford <mark@kyne.com.au>2011-12-15 12:34:55 +0400
commit1d8eba4368aa53ad5e534b68873d24b3ee69cc51 (patch)
treeb89337163d96a0f48e0eda487ef36aa48e1cc1cd /runtests.sh
parent353784724505b23539aa693bd2aed3932493ed62 (diff)
Automate package releases with build-packages.sh
build-packages.sh has several advantages: - Automatically bumps version numbers - Builds HTML documentation on the fly
Diffstat (limited to 'runtests.sh')
-rwxr-xr-xruntests.sh37
1 files changed, 25 insertions, 12 deletions
diff --git a/runtests.sh b/runtests.sh
index c520be0..d313db3 100755
--- a/runtests.sh
+++ b/runtests.sh
@@ -1,13 +1,14 @@
#!/bin/sh
PLATFORM="`uname -s`"
+[ "$1" ] && VERSION="$1" || VERSION="1.0devel"
set -e
# Portable "ggrep -A" replacement
# contextgrep PATTERN POST_MATCH_LINES
contextgrep() {
- awk "/$1/ { count = ($2 + 1) } count { count--; print }"
+ awk "/$1/ { count = ($2 + 1) } count { count--; print }"
}
do_tests() {
@@ -33,11 +34,11 @@ echo "===== Verifying cjson.so is not installed ====="
cd tests
if lua -e 'require "cjson"' 2>/dev/null
then
- cat <<EOT
+ cat <<EOT
Please ensure you do not have the Lua CJSON module installed before
running these tests.
EOT
- exit
+ exit
fi
cd ..
@@ -66,13 +67,25 @@ rm -rf build 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"
+ echo "===== Testing RPM build ====="
+ SRCTGZ=""
+ TGZ=lua-cjson-$VERSION.tar.gz
+ for D in .. packages .
+ do
+ [ -r "$D/$TGZ" ] && SRCTGZ="$D/$TGZ"
+ done
+ if [ "$SRCTGZ" ]
+ then
+ LOG=/tmp/build.$$
+ rpmbuild -tb "$SRCTGZ" > "$LOG"
+ RPM="`awk '/^Wrote: / && ! /debuginfo/ { print $2}' < "$LOG"`"
+ sudo -- rpm -Uvh \"$RPM\"
+ do_tests
+ sudo -- rpm -e lua-cjson
+ rm -f "$LOG"
+ else
+ echo "==> skipping, $TGZ not found"
+ fi
fi
+
+# vi:ai et sw=4 ts=4: