1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 00:28:48 -05:00

Merge branch 'master' of github.com:bagder/curl

This commit is contained in:
Bill Hoffman 2010-03-24 23:49:26 -04:00
commit bed30bc6df
2 changed files with 40 additions and 49 deletions

View File

@ -20,14 +20,14 @@
.\" * .\" *
.\" ************************************************************************** .\" **************************************************************************
.\" .\"
.TH testcurl.pl 1 "20 May 2005" "Curl 7.14.1" "testcurl" .TH testcurl.pl 1 "24 Mar 2010" "Curl 7.20.1" "testcurl"
.SH NAME .SH NAME
testcurl.pl \- (automatically) test curl testcurl.pl \- (automatically) test curl
.SH SYNOPSIS .SH SYNOPSIS
.B testcurl.pl [options] [dir] > output .B testcurl.pl [options] [dir] > output
.SH DESCRIPTION .SH DESCRIPTION
\fItestcurl.pl\fP is the master script to use for automatic testing of curl \fItestcurl.pl\fP is the master script to use for automatic testing of curl
off CVS or daily snapshots. It is written for the purpose of being run from a off git or daily snapshots. It is written for the purpose of being run from a
crontab job or similar at a regular interval. The output is suitable to be crontab job or similar at a regular interval. The output is suitable to be
mailed to curl-autocompile@haxx.se to be dealt with automatically (make sure mailed to curl-autocompile@haxx.se to be dealt with automatically (make sure
the subject includes the word "autobuild" as the mail gets silently discarded the subject includes the word "autobuild" as the mail gets silently discarded
@ -62,8 +62,8 @@ Don't run buildconf. Useful when many builds use the same source tree, as then
only one need to do this. Also, if multiple processes run tests simultaneously only one need to do this. Also, if multiple processes run tests simultaneously
on the same source tree (like several hosts on a NFS mounted dir), on the same source tree (like several hosts on a NFS mounted dir),
simultaneous buildconf invokes may cause problems. (Added in 7.14.1) simultaneous buildconf invokes may cause problems. (Added in 7.14.1)
.IP "--nocvsup" .IP "--nogitpull"
Don't update from CVS even though it is a CVS tree. Useful to still be able to Don't update from git even though it is a git tree. Useful to still be able to
test even though your network is down, or similar. test even though your network is down, or similar.
.IP "--runtestopts=[options]" .IP "--runtestopts=[options]"
Options that is passed to the runtests.pl script. Useful for disabling valgrind Options that is passed to the runtests.pl script. Useful for disabling valgrind
@ -77,16 +77,14 @@ store the info in a 'setup' file, which it will look for on each invoke. Use
Specify your target environment. Recognized strings include 'vc', 'mingw32', Specify your target environment. Recognized strings include 'vc', 'mingw32',
\&'borland' and 'netware'. \&'borland' and 'netware'.
.SH "INITIAL SETUP" .SH "INITIAL SETUP"
First you make a checkout from CVS (or you write a script that downloads daily First you make a checkout from git (or you write a script that downloads daily
snapshots automatically, find inspiration at snapshots automatically, find inspiration at
http://curl.haxx.se/auto/autocurl.txt): http://curl.haxx.se/auto/autocurl.txt):
.nf .nf
$ mkdir daily-curl $ mkdir daily-curl
$ cd daily-curl $ cd daily-curl
$ cvs -d :pserver:anonymous@cool.haxx.se:/cvsroot/curl login $ git clone git://github.com/bagder/curl.git
[enter return when prompted for password ]
$ cvs -d :pserver:anonymous@cool.haxx.se:/cvsroot/curl checkout curl
.fi .fi
With the curl sources checked out, or downloaded, you can start testing right With the curl sources checked out, or downloaded, you can start testing right

View File

@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. # Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
# #
# This software is licensed as described in the file COPYING, which # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@ -25,7 +25,8 @@
# What is This Script? # What is This Script?
########################### ###########################
# testcurl.pl is the master script to use for automatic testing of CVS-curl. # testcurl.pl is the master script to use for automatic testing of curl
# directly off its source repository.
# This is written for the purpose of being run from a crontab job or similar # This is written for the purpose of being run from a crontab job or similar
# at a regular interval. The output is suitable to be mailed to # at a regular interval. The output is suitable to be mailed to
# curl-autocompile@haxx.se to be dealt with automatically (make sure the # curl-autocompile@haxx.se to be dealt with automatically (make sure the
@ -45,13 +46,14 @@
# --extvercmd=[command] Command to use for displaying version with cross compiles. # --extvercmd=[command] Command to use for displaying version with cross compiles.
# --mktarball=[command] Command to run after completed test # --mktarball=[command] Command to run after completed test
# --name=[name] Set name to report as # --name=[name] Set name to report as
# --nocvsup Don't update from CVS even though it is a CVS tree # --nocvsup Don't pull from git even though it is a git tree
# --nogitpull Don't pull from git even though it is a git tree
# --nobuildconf Don't run buildconf # --nobuildconf Don't run buildconf
# --runtestopts=[options] Options to pass to runtests.pl # --runtestopts=[options] Options to pass to runtests.pl
# --setup=[file name] File name to read setup from (deprecated) # --setup=[file name] File name to read setup from (deprecated)
# --target=[your os] Specify your target environment. # --target=[your os] Specify your target environment.
# #
# if [curl-daily-name] is omitted, a 'curl' CVS directory is assumed. # if [curl-daily-name] is omitted, a 'curl' git directory is assumed.
# #
use strict; use strict;
@ -61,20 +63,22 @@ use Cwd;
# Turn on warnings (equivalent to -w, which can't be used with /usr/bin/env) # Turn on warnings (equivalent to -w, which can't be used with /usr/bin/env)
#BEGIN { $^W = 1; } #BEGIN { $^W = 1; }
use vars qw($version $fixed $infixed $CURLDIR $CVS $pwd $build $buildlog use vars qw($version $fixed $infixed $CURLDIR $git $pwd $build $buildlog
$buildlogname $configurebuild $targetos $confsuffix $binext $buildlogname $configurebuild $targetos $confsuffix $binext
$libext); $libext);
use vars qw($name $email $desc $confopts $runtestopts $setupfile $mktarball use vars qw($name $email $desc $confopts $runtestopts $setupfile $mktarball
$extvercmd $nocvsup $nobuildconf $crosscompile $timestamp); $extvercmd $nogitpull $nobuildconf $crosscompile
$timestamp);
# version of this script # version of this script
$version='$Revision$'; $version='2010-03-24';
$fixed=0; $fixed=0;
# Determine if we're running from CVS or a canned copy of curl, # Determine if we're running from git or a canned copy of curl,
# or if we got a specific target option or setup file option. # or if we got a specific target option or setup file option.
$CURLDIR="curl"; $CURLDIR="curl";
$CVS=1; $git=1;
$setupfile = 'setup'; $setupfile = 'setup';
while ($ARGV[0]) { while ($ARGV[0]) {
if ($ARGV[0] =~ /--target=/) { if ($ARGV[0] =~ /--target=/) {
@ -101,8 +105,8 @@ while ($ARGV[0]) {
elsif ($ARGV[0] =~ /--configure=/) { elsif ($ARGV[0] =~ /--configure=/) {
$confopts = (split(/=/, shift @ARGV))[1]; $confopts = (split(/=/, shift @ARGV))[1];
} }
elsif ($ARGV[0] =~ /--nocvsup/) { elsif (($ARGV[0] eq "--nocvsup") || ($ARGV[0] eq "--nogitpull")) {
$nocvsup=1; $nogitpull=1;
shift @ARGV; shift @ARGV;
} }
elsif ($ARGV[0] =~ /--nobuildconf/) { elsif ($ARGV[0] =~ /--nobuildconf/) {
@ -118,7 +122,7 @@ while ($ARGV[0]) {
} }
else { else {
$CURLDIR=shift @ARGV; $CURLDIR=shift @ARGV;
$CVS=0; $git=0; # a given dir, assume not using git
} }
} }
@ -333,15 +337,15 @@ $str1066os = undef;
$pwd = getcwd(); $pwd = getcwd();
if (-d $CURLDIR) { if (-d $CURLDIR) {
if ($CVS && -d "$CURLDIR/CVS") { if ($git && -d "$CURLDIR/.git") {
logit "$CURLDIR is verified to be a fine source dir"; logit "$CURLDIR is verified to be a fine git source dir";
# remove the generated sources to force them to be re-generated each # remove the generated sources to force them to be re-generated each
# time we run this test # time we run this test
unlink "$CURLDIR/src/hugehelp.c"; unlink "$CURLDIR/src/hugehelp.c";
} elsif (!$CVS && -f "$CURLDIR/tests/testcurl.pl") { } elsif (!$git && -f "$CURLDIR/tests/testcurl.pl") {
logit "$CURLDIR is verified to be a fine daily source dir" logit "$CURLDIR is verified to be a fine daily source dir"
} else { } else {
mydie "$CURLDIR is not a daily source dir or checked out from CVS!" mydie "$CURLDIR is not a daily source dir or checked out from git!"
} }
} }
$build="build-$$"; $build="build-$$";
@ -367,25 +371,25 @@ if (-d $build) {
# get in the curl source tree root # get in the curl source tree root
chdir $CURLDIR; chdir $CURLDIR;
# Do the CVS thing, or not... # Do the git thing, or not...
if ($CVS) { if ($git) {
# this is a temporary fix to make things work again, remove later # this is a temporary fix to make things work again, remove later
logit "remove ares/aclocal.m4"; logit "remove ares/aclocal.m4";
unlink "ares/aclocal.m4"; unlink "ares/aclocal.m4";
logit "update from CVS"; logit "update from git";
my $cvsstat; my $cvsstat;
sub cvsup() { sub gitpull() {
# update quietly to the latest CVS # update quietly to the latest git
if($nocvsup) { if($nogitpull) {
logit "Skipping CVS update (--nocvsup)"; logit "Skipping git pull (--nogitpull)";
return 1; return 1;
} }
else { else {
logit "run cvs up"; logit "run git pull";
system("cvs -Q up -dP 2>&1"); system("git pull 2>&1");
} }
$cvsstat=$?; $cvsstat=$?;
@ -395,22 +399,11 @@ if ($CVS) {
return !$cvsstat; return !$cvsstat;
} }
my $att=0;
while (!cvsup()) {
$att++;
logit "failed CVS update attempt number $att.";
if ($att > 20) {
$cvsstat=111;
last; # get out of the loop
}
sleep 5;
}
if ($cvsstat != 0) { if ($cvsstat != 0) {
mydie "failed to update from CVS ($cvsstat), exiting"; mydie "failed to update from git ($cvsstat), exiting";
} }
elsif (!$nocvsup) { elsif (!$nogitpull) {
# Set timestamp to the UTC the CVS update took place. # Set timestamp to the UTC the git update took place.
$timestamp = scalar(gmtime)." UTC"; $timestamp = scalar(gmtime)." UTC";
} }
@ -446,14 +439,14 @@ if ($CVS) {
} }
} }
# Set timestamp to the one in curlver.h if this isn't a CVS test build. # Set timestamp to the one in curlver.h if this isn't a git test build.
if ((-f "include/curl/curlver.h") && if ((-f "include/curl/curlver.h") &&
(open(F, "<include/curl/curlver.h"))) { (open(F, "<include/curl/curlver.h"))) {
while (<F>) { while (<F>) {
chomp; chomp;
if ($_ =~ /^\#define\s+LIBCURL_TIMESTAMP\s+\"(.+)\".*$/) { if ($_ =~ /^\#define\s+LIBCURL_TIMESTAMP\s+\"(.+)\".*$/) {
my $stampstring = $1; my $stampstring = $1;
if ($stampstring !~ /CVS/) { if ($stampstring !~ /DEV/) {
$stampstring =~ s/\s+UTC//; $stampstring =~ s/\s+UTC//;
$timestamp = $stampstring." UTC"; $timestamp = $stampstring." UTC";
} }