2003-01-20 15:07:49 -05:00
|
|
|
#!/bin/sh
|
2003-11-07 03:06:03 -05:00
|
|
|
|
2003-01-20 15:07:49 -05:00
|
|
|
###########################
|
|
|
|
# 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 02:37:21 -05:00
|
|
|
# curl site, at http://curl.haxx.se/auto/
|
2003-01-20 15:07:49 -05:00
|
|
|
|
|
|
|
# USAGE:
|
2003-11-07 03:06:03 -05:00
|
|
|
# testcurl.sh [curl-daily-name] > output
|
|
|
|
|
|
|
|
# Updated:
|
|
|
|
# v1.1 6-Nov-03 - to take an optional parameter, the name of a daily-build
|
|
|
|
# directory. If present, build from that directory, otherwise
|
|
|
|
# perform a normal CVS build.
|
2003-01-20 15:07:49 -05:00
|
|
|
|
|
|
|
# version of this script
|
2003-11-07 03:06:03 -05:00
|
|
|
version=1.1
|
2003-01-20 15:07:49 -05:00
|
|
|
fixed=0
|
|
|
|
|
2003-11-07 03:06:03 -05:00
|
|
|
# Determine if we're running from CVS or a canned copy of curl
|
|
|
|
if [ "$#" -ge "1" -a "$1" ]; then
|
|
|
|
CURLDIR=$1
|
|
|
|
CVS=0
|
|
|
|
else
|
|
|
|
CURLDIR="curl"
|
|
|
|
CVS=1
|
|
|
|
fi
|
|
|
|
|
2003-01-22 04:46:33 -05:00
|
|
|
LANG="C"
|
|
|
|
|
|
|
|
export LANG
|
|
|
|
|
2003-01-20 15:07:49 -05:00
|
|
|
die(){
|
2003-01-21 05:33:29 -05:00
|
|
|
echo "testcurl: ENDING HERE"
|
2003-12-15 03:14:30 -05:00
|
|
|
if test -n "$build"; then
|
|
|
|
# we have a build directory name, remove the dir
|
|
|
|
rm -rf $build
|
|
|
|
fi
|
2003-01-21 05:33:29 -05:00
|
|
|
exit 1
|
2003-01-20 15:07:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ -f setup ]; then
|
|
|
|
. "./setup"
|
2003-01-22 02:57:52 -05:00
|
|
|
infixed="$fixed"
|
2003-11-07 03:06:03 -05:00
|
|
|
else
|
|
|
|
infixed=0 # so that "additional args to configure" works properly first time...
|
2003-01-20 15:07:49 -05: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
|
2004-01-05 09:20:08 -05:00
|
|
|
echo "please enter a one line system description"
|
2003-01-20 15:07:49 -05:00
|
|
|
read desc
|
|
|
|
fixed="3"
|
|
|
|
fi
|
|
|
|
|
2003-01-23 02:37:21 -05: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 01:59:52 -05:00
|
|
|
fi
|
|
|
|
|
2003-01-20 15:07:49 -05:00
|
|
|
|
|
|
|
if [ "$fixed" -gt "0" ]; then
|
|
|
|
echo "name='$name'" > setup
|
|
|
|
echo "email='$email'" >> setup
|
|
|
|
echo "desc='$desc'" >> setup
|
2003-01-22 01:59:52 -05:00
|
|
|
echo "confopts='$confopts'" >> setup
|
2003-01-22 02:57:52 -05:00
|
|
|
echo "fixed='$fixed'" >> setup
|
2003-01-20 15:07:49 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "testcurl: STARTING HERE"
|
|
|
|
echo "testcurl: NAME = $name"
|
|
|
|
echo "testcurl: EMAIL = $email"
|
|
|
|
echo "testcurl: DESC = $desc"
|
2003-01-22 01:59:52 -05:00
|
|
|
echo "testcurl: CONFOPTS = $confopts"
|
2003-01-20 15:07:49 -05: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'`
|
|
|
|
|
2003-11-07 03:06:03 -05:00
|
|
|
if [ -d "$CURLDIR" ]; then
|
|
|
|
if [ $CVS -eq 1 -a -d $CURLDIR/CVS ]; then
|
|
|
|
echo "testcurl: curl is verified to be a fine source dir"
|
|
|
|
elif [ $CVS -eq 0 -a -f $CURLDIR/testcurl.sh ]; then
|
|
|
|
echo "testcurl: curl is verified to be a fine daily source dir"
|
|
|
|
else
|
|
|
|
echo "testcurl: curl is not a daily source dir or checked out from CVS!"
|
|
|
|
die
|
|
|
|
fi
|
2003-01-20 15:07:49 -05:00
|
|
|
fi
|
2003-01-20 15:20:51 -05:00
|
|
|
build="build-$$"
|
|
|
|
|
2003-01-20 15:07:49 -05:00
|
|
|
# remove any previous left-overs
|
2003-02-17 04:15:26 -05:00
|
|
|
rm -rf build-*
|
2003-01-20 15:07:49 -05:00
|
|
|
|
|
|
|
# create a dir to build in
|
2003-01-20 15:20:51 -05:00
|
|
|
mkdir $build
|
2003-01-20 15:07:49 -05:00
|
|
|
|
2003-01-22 01:59:52 -05: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 15:07:49 -05:00
|
|
|
# get in the curl source tree root
|
2003-11-07 03:06:03 -05:00
|
|
|
cd $CURLDIR
|
|
|
|
|
|
|
|
# Do the CVS thing, or not...
|
|
|
|
if [ $CVS -eq 1 ]; then
|
|
|
|
echo "testcurl: update from CVS"
|
|
|
|
|
|
|
|
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 - $cvsstat`
|
|
|
|
}
|
|
|
|
|
|
|
|
att="0"
|
|
|
|
while cvsup; do
|
|
|
|
att=`expr $att + 1`
|
|
|
|
echo "testcurl: failed CVS update attempt number $att."
|
|
|
|
if [ $att -gt 10 ]; then
|
|
|
|
cvsstat="111"
|
|
|
|
break # get out of the loop
|
|
|
|
fi
|
|
|
|
sleep 5
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "testcurl: cvs returned: $cvsstat"
|
|
|
|
|
|
|
|
if [ "$cvsstat" -ne "0" ]; then
|
|
|
|
echo "testcurl: failed to update from CVS, exiting"
|
|
|
|
die
|
2003-05-27 08:03:24 -04:00
|
|
|
fi
|
2003-11-07 03:06:03 -05:00
|
|
|
|
|
|
|
# remove possible left-overs from the past
|
|
|
|
rm -f configure
|
|
|
|
rm -rf autom4te.cache
|
2003-01-20 15:07:49 -05:00
|
|
|
|
2003-11-07 03:06:03 -05:00
|
|
|
# generate the build files
|
2004-01-29 02:29:28 -05:00
|
|
|
./buildconf 2>&1 | tee build.log
|
|
|
|
|
2004-01-30 04:48:55 -05:00
|
|
|
if { grep "^buildconf: OK" build.log >/dev/null 2>&1; } then
|
2004-01-29 02:29:28 -05:00
|
|
|
echo "testcurl: buildconf was successful"
|
|
|
|
else
|
|
|
|
echo "testcurl: buildconf was NOT successful"
|
|
|
|
die
|
|
|
|
fi
|
|
|
|
|
2003-11-07 03:06:03 -05:00
|
|
|
fi
|
2003-01-20 15:07:49 -05:00
|
|
|
|
|
|
|
if [ -f configure ]; then
|
|
|
|
echo "testcurl: configure created"
|
|
|
|
else
|
|
|
|
echo "testcurl: no configure created"
|
|
|
|
die
|
|
|
|
fi
|
|
|
|
|
|
|
|
# change to build dir
|
2003-01-20 15:20:51 -05:00
|
|
|
cd "../$build"
|
2003-01-20 15:07:49 -05:00
|
|
|
|
|
|
|
# run configure script
|
2003-11-07 03:06:03 -05:00
|
|
|
../$CURLDIR/configure $confopts 2>&1
|
2003-01-20 15:07:49 -05: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 01:59:52 -05:00
|
|
|
echo "testcurl: display lib/config.h"
|
|
|
|
grep "^ *#" lib/config.h
|
|
|
|
|
2003-12-12 10:06:17 -05:00
|
|
|
if { grep "define USE_ARES" lib/config.h; } then
|
2003-10-24 18:30:40 -04:00
|
|
|
echo "testcurl: setup to build ares"
|
|
|
|
|
|
|
|
echo "testcurl: build ares"
|
2003-12-11 05:20:44 -05:00
|
|
|
cd ares
|
2004-02-13 02:15:36 -05:00
|
|
|
make 2>&1 | sed -e "s:$pwd::g"
|
2003-10-24 18:30:40 -04:00
|
|
|
echo "testcurl: ares is now built"
|
|
|
|
|
|
|
|
# cd back to the curl build dir
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
2003-01-20 15:07:49 -05:00
|
|
|
echo "testcurl: now run make"
|
2003-01-22 01:59:52 -05:00
|
|
|
make -i 2>&1 | sed -e "s:$pwd::g"
|
2003-01-20 15:07:49 -05: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 05:36:35 -05:00
|
|
|
echo "testcurl: now run make test-full"
|
|
|
|
make test-full 2>&1 | sed -e "s:$pwd::g" | tee build.log
|
2003-01-20 15:07:49 -05:00
|
|
|
|
|
|
|
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
|
2003-01-20 15:20:51 -05:00
|
|
|
rm -rf "$build"
|
2003-01-20 15:07:49 -05:00
|
|
|
|
|
|
|
die
|