2 ###########################
4 ###########################
6 # testcurl.sh is the master script to use for automatic testing of CVS-curl.
7 # This is written for the purpose of being run from a crontab job or similar
8 # at a regular interval. The output will be suitable to be mailed automaticly
9 # to "curl-autocompile@haxx.se" to be dealt with automaticly. The most
10 # current build status (with a resonable backlog) will be published on the
11 # curl site, at http://curl.haxx.se/auto/
14 # testcurl.sh > output
16 # version of this script
25 echo "testcurl: ENDING HERE"
34 if [ -z "$name" ]; then
35 echo "please enter your name"
40 if [ -z "$email" ]; then
41 echo "please enter your contact email address"
46 if [ -z "$desc" ]; then
47 echo "please enter a one line system desrciption"
52 if [ -z "$confopts" ]; then
53 if [ $infixed -lt 4 ]; then
54 echo "please enter your additional arguments to configure"
55 echo "examples: --with-ssl --enable-debug --enable-ipv6 --with-krb4"
62 if [ "$fixed" -gt "0" ]; then
63 echo "name='$name'" > setup
64 echo "email='$email'" >> setup
65 echo "desc='$desc'" >> setup
66 echo "confopts='$confopts'" >> setup
67 echo "fixed='$fixed'" >> setup
70 echo "testcurl: STARTING HERE"
71 echo "testcurl: NAME = $name"
72 echo "testcurl: EMAIL = $email"
73 echo "testcurl: DESC = $desc"
74 echo "testcurl: CONFOPTS = $confopts"
75 echo "testcurl: version = $version"
76 echo "testcurl: date = `date -u`"
78 # Make $pwd to become the path without newline. We'll use that in order to cut
79 # off that path from all possible logs and error messages etc.
81 pwd=`echo $ipwd | sed -e 's/$//g'`
83 if [ -d curl -a -d curl/CVS ]; then
84 echo "testcurl: curl is verified to be a fine source dir"
86 echo "testcurl: curl is not a source dir checked out from CVS!"
92 # remove any previous left-overs
95 # create a dir to build in
98 if [ -d $build ]; then
99 echo "testcurl: build dir $build was created fine"
101 echo "testcurl: failed to create dir $build"
105 # get in the curl source tree root
108 echo "testcurl: update from CVS"
109 # update quietly to the latest CVS
113 echo "testcurl: cvs returned: $cvsstat"
115 if [ "$cvsstat" -ne "0" ]; then
116 echo "testcurl: failed to update from CVS, exiting"
120 # figure out the current collected CVS status
121 newstat="../allcvs.log"
122 oldstat="../oldcvs.log"
123 find . -name Entries -exec cat {} \; > "$newstat"
125 if [ -r "$oldstat" ]; then
126 # there is a previous cvs stat file to compare with
127 if { cmp "$oldstat" "$newstat"; } then
128 echo "testcurl: this is the same CVS status as before"
129 echo "testcurl: ALREADY TESTED THIS SETUP BEFORE"
132 echo "testcurl: there has been a change in the CVS"
136 # remove possible left-overs from the past
138 rm -rf autom4te.cache
140 # generate the build files
143 if [ -f configure ]; then
144 echo "testcurl: configure created"
146 echo "testcurl: no configure created"
150 # change to build dir
153 # run configure script
154 ../curl/configure $confopts 2>&1
156 if [ -f lib/Makefile ]; then
157 echo "testcurl: configure seems to have finished fine"
159 echo "testcurl: configure didn't work"
163 echo "testcurl: display lib/config.h"
164 grep "^ *#" lib/config.h
166 echo "testcurl: now run make"
167 make -i 2>&1 | sed -e "s:$pwd::g"
169 if [ -f src/curl ]; then
170 echo "testcurl: src/curl was created fine"
172 echo "testcurl: src/curl was not created"
176 echo "testcurl: now run make test-full"
177 make test-full 2>&1 | sed -e "s:$pwd::g" | tee build.log
179 if { grep "^TESTFAIL:" build.log; } then
180 echo "testcurl: the tests were not successful"
182 echo "testcurl: the tests were successful!"
185 # store the cvs status for the next time