aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-01-20 20:07:49 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-01-20 20:07:49 +0000
commit49bc4567bbbc5b05016cb99466c77411c9d577cb (patch)
treec5c7de89d09e0319ead46336bb8b37b5383f1cc6
parent2ac52705c66ce03b497581b9c524cd9e277aa0e8 (diff)
first attempt at script for distributed testing on various unix hosts
-rwxr-xr-xtestcurl.sh139
1 files changed, 139 insertions, 0 deletions
diff --git a/testcurl.sh b/testcurl.sh
new file mode 100755
index 000000000..a5ecd1775
--- /dev/null
+++ b/testcurl.sh
@@ -0,0 +1,139 @@
+#!/bin/sh
+###########################
+# What is This Script?
+###########################
+
+# testcurl.sh is the master script to use for automatic testing of CVS-curl.
+# This is written for the purpose of being run from a crontab job or similar
+# at a regular interval. The output will be suitable to be mailed automaticly
+# to "curl-autocompile@haxx.se" to be dealt with automaticly. The most
+# current build status (with a resonable backlog) will be published on the
+# curl site, at http://curl.haxx.se/
+
+# USAGE:
+# testcurl.sh [configure options] > output
+
+# version of this script
+version=1
+fixed=0
+
+die(){
+ echo "testcurl: ENDING HERE"
+ exit 1
+}
+
+if [ -f setup ]; then
+ . "./setup"
+fi
+
+if [ -z "$name" ]; then
+ echo "please enter your name"
+ read name
+ fixed="1"
+fi
+
+if [ -z "$email" ]; then
+ echo "please enter your contact email address"
+ read email
+ fixed="2"
+fi
+
+if [ -z "$desc" ]; then
+ echo "please enter a one line system desrciption"
+ read desc
+ fixed="3"
+fi
+
+
+if [ "$fixed" -gt "0" ]; then
+ echo "name='$name'" > setup
+ echo "email='$email'" >> setup
+ echo "desc='$desc'" >> setup
+fi
+
+echo "testcurl: STARTING HERE"
+echo "testcurl: NAME = $name"
+echo "testcurl: EMAIL = $email"
+echo "testcurl: DESC = $desc"
+echo "testcurl: version = $version"
+echo "testcurl: confopts = $1"
+echo "testcurl: date = `date -u`"
+
+# Make $pwd to become the path without newline. We'll use that in order to cut
+# off that path from all possible logs and error messages etc.
+ipwd=`pwd`
+pwd=`echo $ipwd | sed -e 's/$//g'`
+
+if [ -d curl -a -d curl/CVS ]; then
+ echo "testcurl: curl is verified to be a fine source dir"
+else
+ echo "testcurl: curl is not a source dir checked out from CVS!"
+ die
+fi
+
+# remove any previous left-overs
+rm -rf build
+
+# create a dir to build in
+mkdir build
+
+# get in the curl source tree root
+cd curl
+
+echo "testcurl: update from CVS"
+# update quietly to the latest CVS
+cvs -Q up -dP 2>&1
+
+# remove possible left-overs from the past
+rm -f configure
+rm -rf autom4te.cache
+
+# generate the build files
+./buildconf 2>&1
+
+if [ -f configure ]; then
+ echo "testcurl: configure created"
+else
+ echo "testcurl: no configure created"
+ die
+fi
+
+# change to build dir
+cd ../build
+
+# run configure script
+../curl/configure $1 2>&1
+
+if [ -f lib/Makefile ]; then
+ echo "testcurl: configure seems to have finished fine"
+else
+ echo "testcurl: configure didn't work"
+ die
+fi
+
+echo "testcurl: now run make"
+make 2>&1 | sed -e "s:$pwd::g"
+
+if [ -f src/curl ]; then
+ echo "testcurl: src/curl was created fine"
+else
+ echo "testcurl: src/curl was not created"
+ die
+fi
+
+echo "testcurl: now run make test"
+make test 2>&1 | sed -e "s:$pwd::g" | tee build.log
+
+if { grep "^TESTFAIL:" build.log; } then
+ echo "testcurl: the tests were not successful"
+else
+ echo "testcurl: the tests were successful!"
+fi
+
+# get out of dir
+cd ..
+
+# delete build dir
+rm -rf build
+
+die