2003-01-20 21:07:49 +01:00
|
|
|
#!/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
|
2003-01-23 08:37:21 +01:00
|
|
|
# curl site, at http://curl.haxx.se/auto/
|
2003-01-20 21:07:49 +01:00
|
|
|
|
|
|
|
# USAGE:
|
2003-02-17 10:15:26 +01:00
|
|
|
# testcurl.sh > output
|
2003-01-20 21:07:49 +01:00
|
|
|
|
|
|
|
# version of this script
|
|
|
|
version=1
|
|
|
|
fixed=0
|
|
|
|
|
2003-01-22 10:46:33 +01:00
|
|
|
LANG="C"
|
|
|
|
|
|
|
|
export LANG
|
|
|
|
|
2003-01-20 21:07:49 +01:00
|
|
|
die(){
|
2003-01-21 11:33:29 +01:00
|
|
|
echo "testcurl: ENDING HERE"
|
|
|
|
exit 1
|
2003-01-20 21:07:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ -f setup ]; then
|
|
|
|
. "./setup"
|
2003-01-22 08:57:52 +01:00
|
|
|
infixed="$fixed"
|
2003-01-20 21:07:49 +01:00
|
|
|
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
|
|
|
|
|
2003-01-23 08:37:21 +01:00
|
|
|
if [ -z "$confopts" ]; then
|
|
|
|
if [ $infixed -lt 4 ]; then
|
|
|
|
echo "please enter your additional arguments to configure"
|
|
|
|
echo "examples: --with-ssl --enable-debug --enable-ipv6 --with-krb4"
|
|
|
|
read confopts
|
|
|
|
fixed="4"
|
|
|
|
fi
|
2003-01-22 07:59:52 +01:00
|
|
|
fi
|
|
|
|
|
2003-01-20 21:07:49 +01:00
|
|
|
|
|
|
|
if [ "$fixed" -gt "0" ]; then
|
|
|
|
echo "name='$name'" > setup
|
|
|
|
echo "email='$email'" >> setup
|
|
|
|
echo "desc='$desc'" >> setup
|
2003-01-22 07:59:52 +01:00
|
|
|
echo "confopts='$confopts'" >> setup
|
2003-01-22 08:57:52 +01:00
|
|
|
echo "fixed='$fixed'" >> setup
|
2003-01-20 21:07:49 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "testcurl: STARTING HERE"
|
|
|
|
echo "testcurl: NAME = $name"
|
|
|
|
echo "testcurl: EMAIL = $email"
|
|
|
|
echo "testcurl: DESC = $desc"
|
2003-01-22 07:59:52 +01:00
|
|
|
echo "testcurl: CONFOPTS = $confopts"
|
2003-01-20 21:07:49 +01:00
|
|
|
echo "testcurl: version = $version"
|
|
|
|
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
|
|
|
|
|
2003-01-20 21:20:51 +01:00
|
|
|
build="build-$$"
|
|
|
|
|
2003-01-20 21:07:49 +01:00
|
|
|
# remove any previous left-overs
|
2003-02-17 10:15:26 +01:00
|
|
|
rm -rf build-*
|
2003-01-20 21:07:49 +01:00
|
|
|
|
|
|
|
# create a dir to build in
|
2003-01-20 21:20:51 +01:00
|
|
|
mkdir $build
|
2003-01-20 21:07:49 +01:00
|
|
|
|
2003-01-22 07:59:52 +01:00
|
|
|
if [ -d $build ]; then
|
|
|
|
echo "testcurl: build dir $build was created fine"
|
|
|
|
else
|
|
|
|
echo "testcurl: failed to create dir $build"
|
|
|
|
die
|
|
|
|
fi
|
|
|
|
|
2003-01-20 21:07:49 +01:00
|
|
|
# get in the curl source tree root
|
|
|
|
cd curl
|
|
|
|
|
|
|
|
echo "testcurl: update from CVS"
|
|
|
|
|
2003-05-27 14:03:24 +02:00
|
|
|
cvsup() {
|
|
|
|
# update quietly to the latest CVS
|
|
|
|
echo "testcurl: run cvs up"
|
|
|
|
cvs -Q up -dP 2>&1
|
|
|
|
|
|
|
|
cvsstat=$?
|
|
|
|
|
|
|
|
# return (1 - RETURNVALUE) so that errors return 0 while goodness
|
|
|
|
# returns 1
|
|
|
|
return `expr 1 - $?`
|
|
|
|
}
|
|
|
|
|
|
|
|
att="0"
|
|
|
|
while cvsup; do
|
|
|
|
att=`expr $att + 1`
|
|
|
|
echo "testcurl: failed CVS update attempt number $att."
|
|
|
|
if [ $att -gt 50 ]; then
|
|
|
|
cvsstat="BADNESS"
|
|
|
|
break # get out of the loop
|
|
|
|
fi
|
|
|
|
sleep 5
|
|
|
|
done
|
|
|
|
|
2003-03-13 16:56:31 +01:00
|
|
|
echo "testcurl: cvs returned: $cvsstat"
|
|
|
|
|
2003-03-20 15:38:42 +01:00
|
|
|
if [ "$cvsstat" -ne "0" ]; then
|
|
|
|
echo "testcurl: failed to update from CVS, exiting"
|
|
|
|
die
|
|
|
|
fi
|
|
|
|
|
2003-01-22 07:59:52 +01:00
|
|
|
# figure out the current collected CVS status
|
|
|
|
newstat="../allcvs.log"
|
|
|
|
oldstat="../oldcvs.log"
|
|
|
|
find . -name Entries -exec cat {} \; > "$newstat"
|
|
|
|
|
|
|
|
if [ -r "$oldstat" ]; then
|
|
|
|
# there is a previous cvs stat file to compare with
|
|
|
|
if { cmp "$oldstat" "$newstat"; } then
|
|
|
|
echo "testcurl: this is the same CVS status as before"
|
|
|
|
echo "testcurl: ALREADY TESTED THIS SETUP BEFORE"
|
|
|
|
#die
|
2003-01-22 13:29:19 +01:00
|
|
|
else
|
|
|
|
echo "testcurl: there has been a change in the CVS"
|
2003-01-22 07:59:52 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2003-01-20 21:07:49 +01:00
|
|
|
# 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
|
2003-01-20 21:20:51 +01:00
|
|
|
cd "../$build"
|
2003-01-20 21:07:49 +01:00
|
|
|
|
|
|
|
# run configure script
|
2003-01-22 08:57:52 +01:00
|
|
|
../curl/configure $confopts 2>&1
|
2003-01-20 21:07:49 +01:00
|
|
|
|
|
|
|
if [ -f lib/Makefile ]; then
|
|
|
|
echo "testcurl: configure seems to have finished fine"
|
|
|
|
else
|
|
|
|
echo "testcurl: configure didn't work"
|
|
|
|
die
|
|
|
|
fi
|
|
|
|
|
2003-01-22 07:59:52 +01:00
|
|
|
echo "testcurl: display lib/config.h"
|
|
|
|
grep "^ *#" lib/config.h
|
|
|
|
|
2003-01-20 21:07:49 +01:00
|
|
|
echo "testcurl: now run make"
|
2003-01-22 07:59:52 +01:00
|
|
|
make -i 2>&1 | sed -e "s:$pwd::g"
|
2003-01-20 21:07:49 +01:00
|
|
|
|
|
|
|
if [ -f src/curl ]; then
|
|
|
|
echo "testcurl: src/curl was created fine"
|
|
|
|
else
|
|
|
|
echo "testcurl: src/curl was not created"
|
|
|
|
die
|
|
|
|
fi
|
|
|
|
|
2003-01-21 11:36:35 +01:00
|
|
|
echo "testcurl: now run make test-full"
|
|
|
|
make test-full 2>&1 | sed -e "s:$pwd::g" | tee build.log
|
2003-01-20 21:07:49 +01:00
|
|
|
|
|
|
|
if { grep "^TESTFAIL:" build.log; } then
|
|
|
|
echo "testcurl: the tests were not successful"
|
|
|
|
else
|
|
|
|
echo "testcurl: the tests were successful!"
|
|
|
|
fi
|
|
|
|
|
2003-01-22 07:59:52 +01:00
|
|
|
# store the cvs status for the next time
|
|
|
|
mv $newstat $oldstat
|
|
|
|
|
2003-01-20 21:07:49 +01:00
|
|
|
# get out of dir
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# delete build dir
|
2003-01-20 21:20:51 +01:00
|
|
|
rm -rf "$build"
|
2003-01-20 21:07:49 +01:00
|
|
|
|
|
|
|
die
|