2004-03-25 20:16:42 +08:00
|
|
|
#!/usr/bin/env perl
|
2004-03-24 00:07:02 +08:00
|
|
|
#***************************************************************************
|
|
|
|
# _ _ ____ _
|
|
|
|
# Project ___| | | | _ \| |
|
|
|
|
# / __| | | | |_) | |
|
|
|
|
# | (__| |_| | _ <| |___
|
|
|
|
# \___|\___/|_| \_\_____|
|
|
|
|
#
|
2015-03-25 06:43:32 +08:00
|
|
|
# Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2004-03-24 00:07:02 +08:00
|
|
|
#
|
|
|
|
# This software is licensed as described in the file COPYING, which
|
|
|
|
# you should have received as part of this distribution. The terms
|
2016-02-03 07:19:02 +08:00
|
|
|
# are also available at https://curl.haxx.se/docs/copyright.html.
|
2004-03-24 00:07:02 +08:00
|
|
|
#
|
|
|
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
# copies of the Software, and permit persons to whom the Software is
|
|
|
|
# furnished to do so, under the terms of the COPYING file.
|
|
|
|
#
|
|
|
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
# KIND, either express or implied.
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
###########################
|
|
|
|
# What is This Script?
|
|
|
|
###########################
|
|
|
|
|
2010-03-25 05:26:41 +08:00
|
|
|
# testcurl.pl is the master script to use for automatic testing of curl
|
|
|
|
# directly off its source repository.
|
2004-03-24 00:07:02 +08:00
|
|
|
# This is written for the purpose of being run from a crontab job or similar
|
2005-03-15 20:13:37 +08:00
|
|
|
# at a regular interval. The output is suitable to be 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
|
|
|
|
# otherwise). The most current build status (with a resonable backlog) will
|
2016-02-03 07:19:02 +08:00
|
|
|
# be published on the curl site, at https://curl.haxx.se/auto/
|
2004-03-24 00:07:02 +08:00
|
|
|
|
|
|
|
# USAGE:
|
2005-03-15 15:35:36 +08:00
|
|
|
# testcurl.pl [options] [curl-daily-name] > output
|
2004-03-24 00:07:02 +08:00
|
|
|
|
2005-03-15 15:35:36 +08:00
|
|
|
# Options:
|
|
|
|
#
|
|
|
|
# --configure=[options] Configure options
|
|
|
|
# --crosscompile This is a crosscompile
|
|
|
|
# --desc=[desc] Description of your test system
|
|
|
|
# --email=[email] Set email address to report as
|
2008-03-21 00:10:54 +08:00
|
|
|
# --extvercmd=[command] Command to use for displaying version with cross compiles.
|
2005-03-15 15:35:36 +08:00
|
|
|
# --mktarball=[command] Command to run after completed test
|
|
|
|
# --name=[name] Set name to report as
|
2015-03-25 06:43:32 +08:00
|
|
|
# --notes=[notes] More human-readable information about this configuration
|
2010-03-25 05:26:41 +08:00
|
|
|
# --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
|
2005-05-20 19:24:55 +08:00
|
|
|
# --nobuildconf Don't run buildconf
|
2010-10-14 06:57:36 +08:00
|
|
|
# --noconfigure Don't run configure
|
2005-03-19 02:03:38 +08:00
|
|
|
# --runtestopts=[options] Options to pass to runtests.pl
|
2005-03-15 15:35:36 +08:00
|
|
|
# --setup=[file name] File name to read setup from (deprecated)
|
|
|
|
# --target=[your os] Specify your target environment.
|
|
|
|
#
|
2010-03-25 05:26:41 +08:00
|
|
|
# if [curl-daily-name] is omitted, a 'curl' git directory is assumed.
|
2005-03-15 15:35:36 +08:00
|
|
|
#
|
2004-03-24 00:07:02 +08:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
use Cwd;
|
2015-05-24 18:02:30 +08:00
|
|
|
use File::Spec;
|
2004-03-24 00:07:02 +08:00
|
|
|
|
2004-03-25 20:16:42 +08:00
|
|
|
# Turn on warnings (equivalent to -w, which can't be used with /usr/bin/env)
|
2005-03-15 15:35:36 +08:00
|
|
|
#BEGIN { $^W = 1; }
|
2004-03-25 20:16:42 +08:00
|
|
|
|
2010-03-25 05:26:41 +08:00
|
|
|
use vars qw($version $fixed $infixed $CURLDIR $git $pwd $build $buildlog
|
2010-08-20 08:33:29 +08:00
|
|
|
$buildlogname $configurebuild $targetos $confheader $binext
|
2005-03-15 15:35:36 +08:00
|
|
|
$libext);
|
2010-03-25 05:26:41 +08:00
|
|
|
|
2005-03-17 08:57:17 +08:00
|
|
|
use vars qw($name $email $desc $confopts $runtestopts $setupfile $mktarball
|
2010-03-25 05:26:41 +08:00
|
|
|
$extvercmd $nogitpull $nobuildconf $crosscompile
|
2011-06-24 13:38:33 +08:00
|
|
|
$timestamp $notes);
|
2004-03-24 00:07:02 +08:00
|
|
|
|
|
|
|
# version of this script
|
2014-11-25 18:22:09 +08:00
|
|
|
$version='2014-11-25';
|
2004-03-24 00:07:02 +08:00
|
|
|
$fixed=0;
|
|
|
|
|
2010-03-25 05:26:41 +08:00
|
|
|
# Determine if we're running from git or a canned copy of curl,
|
2004-06-29 21:20:37 +08:00
|
|
|
# or if we got a specific target option or setup file option.
|
2004-06-23 04:02:49 +08:00
|
|
|
$CURLDIR="curl";
|
2010-03-28 13:50:07 +08:00
|
|
|
if (-f ".git/config") {
|
|
|
|
$CURLDIR = "./";
|
|
|
|
}
|
|
|
|
|
2010-03-25 05:26:41 +08:00
|
|
|
$git=1;
|
2004-06-29 21:20:37 +08:00
|
|
|
$setupfile = 'setup';
|
2010-10-14 06:57:36 +08:00
|
|
|
$configurebuild = 1;
|
2004-06-29 21:20:37 +08:00
|
|
|
while ($ARGV[0]) {
|
2004-06-23 04:02:49 +08:00
|
|
|
if ($ARGV[0] =~ /--target=/) {
|
2015-03-21 22:38:56 +08:00
|
|
|
$targetos = (split(/=/, shift @ARGV, 2))[1];
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
|
|
|
elsif ($ARGV[0] =~ /--setup=/) {
|
2015-03-21 22:38:56 +08:00
|
|
|
$setupfile = (split(/=/, shift @ARGV, 2))[1];
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
2008-03-21 00:10:54 +08:00
|
|
|
elsif ($ARGV[0] =~ /--extvercmd=/) {
|
2015-03-21 22:38:56 +08:00
|
|
|
$extvercmd = (split(/=/, shift @ARGV, 2))[1];
|
2008-03-21 00:10:54 +08:00
|
|
|
}
|
2005-03-15 15:35:36 +08:00
|
|
|
elsif ($ARGV[0] =~ /--mktarball=/) {
|
2015-03-21 22:38:56 +08:00
|
|
|
$mktarball = (split(/=/, shift @ARGV, 2))[1];
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
|
|
|
elsif ($ARGV[0] =~ /--name=/) {
|
2015-03-21 22:38:56 +08:00
|
|
|
$name = (split(/=/, shift @ARGV, 2))[1];
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
|
|
|
elsif ($ARGV[0] =~ /--email=/) {
|
2015-03-21 22:38:56 +08:00
|
|
|
$email = (split(/=/, shift @ARGV, 2))[1];
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
|
|
|
elsif ($ARGV[0] =~ /--desc=/) {
|
2015-03-21 22:38:56 +08:00
|
|
|
$desc = (split(/=/, shift @ARGV, 2))[1];
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
2015-03-25 06:43:32 +08:00
|
|
|
elsif ($ARGV[0] =~ /--notes=/) {
|
|
|
|
$notes = (split(/=/, shift @ARGV, 2))[1];
|
|
|
|
}
|
2011-05-31 16:44:10 +08:00
|
|
|
elsif ($ARGV[0] =~ /--configure=(.*)/) {
|
|
|
|
$confopts = $1;
|
|
|
|
shift @ARGV;
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
2010-03-25 05:26:41 +08:00
|
|
|
elsif (($ARGV[0] eq "--nocvsup") || ($ARGV[0] eq "--nogitpull")) {
|
|
|
|
$nogitpull=1;
|
2005-03-15 15:35:36 +08:00
|
|
|
shift @ARGV;
|
|
|
|
}
|
2005-05-20 19:24:55 +08:00
|
|
|
elsif ($ARGV[0] =~ /--nobuildconf/) {
|
|
|
|
$nobuildconf=1;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
2010-10-14 06:57:36 +08:00
|
|
|
elsif ($ARGV[0] =~ /--noconfigure/) {
|
|
|
|
$configurebuild=0;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
2005-03-15 15:35:36 +08:00
|
|
|
elsif ($ARGV[0] =~ /--crosscompile/) {
|
|
|
|
$crosscompile=1;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
2005-03-17 08:57:17 +08:00
|
|
|
elsif ($ARGV[0] =~ /--runtestopts=/) {
|
|
|
|
$runtestopts = (split(/=/, shift @ARGV, 2))[1];
|
|
|
|
}
|
2005-03-15 15:35:36 +08:00
|
|
|
else {
|
2004-06-29 21:20:37 +08:00
|
|
|
$CURLDIR=shift @ARGV;
|
2010-03-25 05:26:41 +08:00
|
|
|
$git=0; # a given dir, assume not using git
|
2004-06-23 04:02:49 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Do the platform-specific stuff here
|
2010-08-20 08:33:29 +08:00
|
|
|
$confheader = 'curl_config.h';
|
2004-06-23 04:02:49 +08:00
|
|
|
$binext = '';
|
2004-07-25 14:03:10 +08:00
|
|
|
$libext = '.la'; # .la since both libcurl and libcares are made with libtool
|
2005-03-15 15:35:36 +08:00
|
|
|
if ($^O eq 'MSWin32' || $targetos) {
|
|
|
|
if (!$targetos) {
|
2004-06-23 04:02:49 +08:00
|
|
|
# If no target defined on Win32 lets assume vc
|
|
|
|
$targetos = 'vc';
|
|
|
|
}
|
2010-08-10 10:09:35 +08:00
|
|
|
if ($targetos =~ /vc/ || $targetos =~ /borland/ || $targetos =~ /watcom/) {
|
2004-06-23 04:02:49 +08:00
|
|
|
$binext = '.exe';
|
2006-05-27 19:36:05 +08:00
|
|
|
$libext = '.lib';
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
2009-05-21 20:59:49 +08:00
|
|
|
elsif ($targetos =~ /mingw/) {
|
2007-01-19 04:32:46 +08:00
|
|
|
$binext = '.exe';
|
2007-01-25 22:06:38 +08:00
|
|
|
if ($^O eq 'MSWin32') {
|
|
|
|
$libext = '.a';
|
|
|
|
}
|
2007-01-19 04:32:46 +08:00
|
|
|
}
|
2005-03-15 15:35:36 +08:00
|
|
|
elsif ($targetos =~ /netware/) {
|
2005-03-19 02:03:38 +08:00
|
|
|
$configurebuild = 0;
|
2004-06-23 04:02:49 +08:00
|
|
|
$binext = '.nlm';
|
2007-03-27 01:18:36 +08:00
|
|
|
if ($^O eq 'MSWin32') {
|
|
|
|
$libext = '.lib';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$libext = '.a';
|
|
|
|
}
|
2004-06-23 04:02:49 +08:00
|
|
|
}
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
|
2010-08-10 13:10:57 +08:00
|
|
|
if (($^O eq 'MSWin32' || $^O eq 'msys') &&
|
2010-08-10 10:09:35 +08:00
|
|
|
($targetos =~ /vc/ || $targetos =~ /mingw32/ ||
|
|
|
|
$targetos =~ /borland/ || $targetos =~ /watcom/)) {
|
2005-03-15 15:35:36 +08:00
|
|
|
|
2005-08-12 02:02:09 +08:00
|
|
|
# Set these things only when building ON Windows and for Win32 platform.
|
2005-03-15 15:35:36 +08:00
|
|
|
# FOR Windows since we might be cross-compiling on another system. Non-
|
2010-08-20 08:33:29 +08:00
|
|
|
# Windows builds still default to configure-style builds with curl_config.h.
|
2005-03-15 15:35:36 +08:00
|
|
|
|
|
|
|
$configurebuild = 0;
|
2010-08-20 08:33:29 +08:00
|
|
|
$confheader = 'config-win32.h';
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
|
|
|
|
2009-05-12 19:24:29 +08:00
|
|
|
$ENV{LC_ALL}="C" if (($ENV{LC_ALL}) && ($ENV{LC_ALL} !~ /^C$/));
|
|
|
|
$ENV{LC_CTYPE}="C" if (($ENV{LC_CTYPE}) && ($ENV{LC_CTYPE} !~ /^C$/));
|
2004-03-24 00:07:02 +08:00
|
|
|
$ENV{LANG}="C";
|
|
|
|
|
|
|
|
sub rmtree($) {
|
|
|
|
my $target = $_[0];
|
|
|
|
if ($^O eq 'MSWin32') {
|
|
|
|
foreach (glob($target)) {
|
|
|
|
s:/:\\:g;
|
|
|
|
system("rd /s /q $_");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
system("rm -rf $target");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub grepfile($$) {
|
|
|
|
my ($target, $fn) = @_;
|
|
|
|
open(F, $fn) or die;
|
|
|
|
while (<F>) {
|
|
|
|
if (/$target/) {
|
|
|
|
close(F);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub logit($) {
|
|
|
|
my $text=$_[0];
|
|
|
|
if ($text) {
|
|
|
|
print "testcurl: $text\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-05-01 01:06:58 +08:00
|
|
|
sub logit_spaced($) {
|
|
|
|
my $text=$_[0];
|
|
|
|
if ($text) {
|
|
|
|
print "\ntestcurl: $text\n\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-24 00:07:02 +08:00
|
|
|
sub mydie($){
|
|
|
|
my $text=$_[0];
|
|
|
|
logit "$text";
|
|
|
|
chdir $pwd; # cd back to the original root dir
|
|
|
|
|
|
|
|
if ($pwd && $build) {
|
|
|
|
# we have a build directory name, remove the dir
|
|
|
|
logit "removing the $build dir";
|
|
|
|
rmtree "$pwd/$build";
|
|
|
|
}
|
|
|
|
if (-r $buildlog) {
|
|
|
|
# we have a build log output file left, remove it
|
|
|
|
logit "removing the $buildlogname file";
|
|
|
|
unlink "$buildlog";
|
|
|
|
}
|
|
|
|
logit "ENDING HERE"; # last line logged!
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
|
2009-06-11 09:22:35 +08:00
|
|
|
sub get_host_triplet {
|
|
|
|
my $triplet;
|
2009-07-14 21:25:14 +08:00
|
|
|
my $configfile = "$pwd/$build/lib/curl_config.h";
|
2009-06-11 09:22:35 +08:00
|
|
|
|
|
|
|
if(-f $configfile && -s $configfile && open(LIBCONFIGH, "<$configfile")) {
|
|
|
|
while(<LIBCONFIGH>) {
|
|
|
|
if($_ =~ /^\#define\s+OS\s+"*([^"][^"]*)"*\s*/) {
|
|
|
|
$triplet = $1;
|
|
|
|
last;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(LIBCONFIGH);
|
|
|
|
}
|
|
|
|
return $triplet;
|
|
|
|
}
|
|
|
|
|
2014-11-25 17:36:47 +08:00
|
|
|
if($name && $email && $desc) {
|
|
|
|
# having these fields set are enough to continue, skip reading the setup
|
|
|
|
# file
|
|
|
|
$infixed=4;
|
|
|
|
$fixed=4;
|
|
|
|
}
|
|
|
|
elsif (open(F, "$setupfile")) {
|
2004-03-24 00:07:02 +08:00
|
|
|
while (<F>) {
|
|
|
|
if (/(\w+)=(.*)/) {
|
|
|
|
eval "\$$1=$2;";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
$infixed=$fixed;
|
2014-11-25 17:36:47 +08:00
|
|
|
}
|
|
|
|
else {
|
2004-07-06 05:32:18 +08:00
|
|
|
$infixed=0; # so that "additional args to configure" works properly first time...
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!$name) {
|
|
|
|
print "please enter your name\n";
|
|
|
|
$name = <>;
|
|
|
|
chomp $name;
|
|
|
|
$fixed=1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$email) {
|
|
|
|
print "please enter your contact email address\n";
|
|
|
|
$email = <>;
|
|
|
|
chomp $email;
|
|
|
|
$fixed=2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$desc) {
|
|
|
|
print "please enter a one line system description\n";
|
|
|
|
$desc = <>;
|
|
|
|
chomp $desc;
|
|
|
|
$fixed=3;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$confopts) {
|
|
|
|
if ($infixed < 4) {
|
|
|
|
print "please enter your additional arguments to configure\n";
|
|
|
|
print "examples: --with-ssl --enable-debug --enable-ipv6 --with-krb4\n";
|
|
|
|
$confopts = <>;
|
|
|
|
chomp $confopts;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-11 08:20:30 +08:00
|
|
|
if ($fixed < 4) {
|
2005-03-15 15:35:36 +08:00
|
|
|
$fixed=4;
|
|
|
|
open(F, ">$setupfile") or die;
|
|
|
|
print F "name='$name'\n";
|
|
|
|
print F "email='$email'\n";
|
|
|
|
print F "desc='$desc'\n";
|
|
|
|
print F "confopts='$confopts'\n";
|
2011-06-24 13:38:33 +08:00
|
|
|
print F "notes='$notes'\n";
|
2005-03-15 15:35:36 +08:00
|
|
|
print F "fixed='$fixed'\n";
|
|
|
|
close(F);
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
|
2008-10-02 11:59:25 +08:00
|
|
|
# Enable picky compiler warnings unless explicitly disabled
|
|
|
|
if (($confopts !~ /--enable-debug/) &&
|
|
|
|
($confopts !~ /--enable-warnings/) &&
|
|
|
|
($confopts !~ /--disable-warnings/)) {
|
|
|
|
$confopts .= " --enable-warnings";
|
|
|
|
}
|
|
|
|
|
2007-02-28 07:46:48 +08:00
|
|
|
my $str1066os = 'o' x 1066;
|
|
|
|
|
2007-02-20 13:28:41 +08:00
|
|
|
# Set timestamp to the UTC this script is running. Its value might
|
|
|
|
# be changed later in the script to the value present in curlver.h
|
|
|
|
$timestamp = scalar(gmtime)." UTC";
|
|
|
|
|
2005-03-15 15:35:36 +08:00
|
|
|
logit "STARTING HERE"; # first line logged, for scripts to trigger on
|
2007-02-28 07:46:48 +08:00
|
|
|
logit 'TRANSFER CONTROL ==== 1120 CHAR LINE' . $str1066os . 'LINE_END';
|
2004-03-24 00:07:02 +08:00
|
|
|
logit "NAME = $name";
|
|
|
|
logit "EMAIL = $email";
|
|
|
|
logit "DESC = $desc";
|
2011-06-24 13:38:33 +08:00
|
|
|
logit "NOTES = $notes";
|
2004-03-24 00:07:02 +08:00
|
|
|
logit "CONFOPTS = $confopts";
|
2014-07-17 06:00:23 +08:00
|
|
|
logit "RUNTESTOPTS = ".$runtestopts;
|
2005-12-14 03:07:33 +08:00
|
|
|
logit "CPPFLAGS = ".$ENV{CPPFLAGS};
|
2005-03-14 20:26:29 +08:00
|
|
|
logit "CFLAGS = ".$ENV{CFLAGS};
|
|
|
|
logit "LDFLAGS = ".$ENV{LDFLAGS};
|
2012-04-12 23:11:17 +08:00
|
|
|
logit "LIBS = ".$ENV{LIBS};
|
2005-03-14 20:26:29 +08:00
|
|
|
logit "CC = ".$ENV{CC};
|
2012-04-12 23:11:17 +08:00
|
|
|
logit "TMPDIR = ".$ENV{TMPDIR};
|
2009-04-28 03:21:45 +08:00
|
|
|
logit "MAKEFLAGS = ".$ENV{MAKEFLAGS};
|
2011-12-27 00:09:44 +08:00
|
|
|
logit "ACLOCAL_FLAGS = ".$ENV{ACLOCAL_FLAGS};
|
2009-07-14 07:33:57 +08:00
|
|
|
logit "PKG_CONFIG_PATH = ".$ENV{PKG_CONFIG_PATH};
|
2012-04-12 23:11:17 +08:00
|
|
|
logit "DYLD_LIBRARY_PATH = ".$ENV{DYLD_LIBRARY_PATH};
|
|
|
|
logit "LD_LIBRARY_PATH = ".$ENV{LD_LIBRARY_PATH};
|
|
|
|
logit "LIBRARY_PATH = ".$ENV{LIBRARY_PATH};
|
|
|
|
logit "SHLIB_PATH = ".$ENV{SHLIB_PATH};
|
|
|
|
logit "LIBPATH = ".$ENV{LIBPATH};
|
2005-03-14 20:26:29 +08:00
|
|
|
logit "target = ".$targetos;
|
2005-03-15 15:35:36 +08:00
|
|
|
logit "version = $version"; # script version
|
2007-02-20 13:28:41 +08:00
|
|
|
logit "date = $timestamp"; # When the test build starts
|
2004-03-24 00:07:02 +08:00
|
|
|
|
2007-02-28 07:46:48 +08:00
|
|
|
$str1066os = undef;
|
|
|
|
|
2004-03-24 00:07:02 +08:00
|
|
|
# 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.
|
2007-12-21 05:21:43 +08:00
|
|
|
$pwd = getcwd();
|
2004-03-24 00:07:02 +08:00
|
|
|
|
2012-07-03 02:21:48 +08:00
|
|
|
my $have_embedded_ares = 0;
|
|
|
|
|
2004-03-24 00:07:02 +08:00
|
|
|
if (-d $CURLDIR) {
|
2010-03-25 05:26:41 +08:00
|
|
|
if ($git && -d "$CURLDIR/.git") {
|
|
|
|
logit "$CURLDIR is verified to be a fine git source dir";
|
2004-03-24 00:07:02 +08:00
|
|
|
# remove the generated sources to force them to be re-generated each
|
|
|
|
# time we run this test
|
2012-12-27 06:30:54 +08:00
|
|
|
unlink "$CURLDIR/src/tool_hugehelp.c";
|
2012-07-03 02:21:48 +08:00
|
|
|
# find out if curl source dir has an in-tree c-ares repo
|
|
|
|
$have_embedded_ares = 1 if (-f "$CURLDIR/ares/GIT-INFO");
|
2010-03-25 05:26:41 +08:00
|
|
|
} elsif (!$git && -f "$CURLDIR/tests/testcurl.pl") {
|
2012-07-03 05:22:10 +08:00
|
|
|
logit "$CURLDIR is verified to be a fine daily source dir";
|
2012-07-03 02:21:48 +08:00
|
|
|
# find out if curl source dir has an in-tree c-ares extracted tarball
|
|
|
|
$have_embedded_ares = 1 if (-f "$CURLDIR/ares/ares_build.h");
|
2004-03-24 00:07:02 +08:00
|
|
|
} else {
|
2010-03-25 05:26:41 +08:00
|
|
|
mydie "$CURLDIR is not a daily source dir or checked out from git!"
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
}
|
2015-05-21 15:10:31 +08:00
|
|
|
|
|
|
|
# make the path absolute so we can use it everywhere
|
2015-05-24 18:02:30 +08:00
|
|
|
$CURLDIR = File::Spec->rel2abs("$CURLDIR");
|
2015-05-21 15:10:31 +08:00
|
|
|
|
2004-03-24 00:07:02 +08:00
|
|
|
$build="build-$$";
|
|
|
|
$buildlogname="buildlog-$$";
|
|
|
|
$buildlog="$pwd/$buildlogname";
|
|
|
|
|
|
|
|
# remove any previous left-overs
|
|
|
|
rmtree "build-*";
|
|
|
|
rmtree "buildlog-*";
|
|
|
|
|
|
|
|
# this is to remove old build logs that ended up in the wrong dir
|
|
|
|
foreach (glob("$CURLDIR/buildlog-*")) { unlink $_; }
|
|
|
|
|
|
|
|
# create a dir to build in
|
2004-03-25 05:28:31 +08:00
|
|
|
mkdir $build, 0777;
|
2004-03-24 00:07:02 +08:00
|
|
|
|
|
|
|
if (-d $build) {
|
|
|
|
logit "build dir $build was created fine";
|
|
|
|
} else {
|
|
|
|
mydie "failed to create dir $build";
|
|
|
|
}
|
|
|
|
|
|
|
|
# get in the curl source tree root
|
|
|
|
chdir $CURLDIR;
|
|
|
|
|
2010-03-28 01:57:24 +08:00
|
|
|
# Do the git thing, or not...
|
|
|
|
if ($git) {
|
2014-01-05 07:09:20 +08:00
|
|
|
my $gitstat = 0;
|
|
|
|
my @commits;
|
|
|
|
|
2010-04-13 09:15:31 +08:00
|
|
|
# update quietly to the latest git
|
|
|
|
if($nogitpull) {
|
|
|
|
logit "skipping git pull (--nogitpull)";
|
|
|
|
} else {
|
|
|
|
logit "run git pull in curl";
|
|
|
|
system("git pull 2>&1");
|
|
|
|
$gitstat += $?;
|
|
|
|
logit "failed to update from curl git ($?), continue anyway" if ($?);
|
2014-01-05 07:09:20 +08:00
|
|
|
|
|
|
|
# Set timestamp to the UTC the git update took place.
|
|
|
|
$timestamp = scalar(gmtime)." UTC" if (!$gitstat);
|
|
|
|
}
|
|
|
|
|
|
|
|
# get the last 5 commits for show (even if no pull was made)
|
|
|
|
@commits=`git log --pretty=oneline --abbrev-commit -5`;
|
|
|
|
logit "The most recent curl git commits:";
|
|
|
|
for (@commits) {
|
|
|
|
chomp ($_);
|
|
|
|
logit " $_";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (-d "ares/.git") {
|
|
|
|
chdir "ares";
|
|
|
|
|
|
|
|
if($nogitpull) {
|
|
|
|
logit "skipping git pull (--nogitpull) in ares";
|
|
|
|
} else {
|
|
|
|
logit "run git pull in ares";
|
|
|
|
system("git pull 2>&1");
|
|
|
|
$gitstat += $?;
|
|
|
|
logit "failed to update from ares git ($?), continue anyway" if ($?);
|
|
|
|
|
|
|
|
# Set timestamp to the UTC the git update took place.
|
|
|
|
$timestamp = scalar(gmtime)." UTC" if (!$gitstat);
|
|
|
|
}
|
|
|
|
|
2010-04-13 10:05:43 +08:00
|
|
|
# get the last 5 commits for show (even if no pull was made)
|
|
|
|
@commits=`git log --pretty=oneline --abbrev-commit -5`;
|
2014-01-05 07:09:20 +08:00
|
|
|
logit "The most recent ares git commits:";
|
2010-04-13 10:05:43 +08:00
|
|
|
for (@commits) {
|
|
|
|
chomp ($_);
|
|
|
|
logit " $_";
|
|
|
|
}
|
2014-01-05 07:09:20 +08:00
|
|
|
|
2015-05-21 15:10:31 +08:00
|
|
|
chdir "$CURLDIR";
|
2010-03-25 20:56:01 +08:00
|
|
|
}
|
2004-03-24 00:07:02 +08:00
|
|
|
|
2005-05-20 19:24:55 +08:00
|
|
|
if($nobuildconf) {
|
2010-04-13 09:15:31 +08:00
|
|
|
logit "told to not run buildconf";
|
2005-05-20 19:24:55 +08:00
|
|
|
}
|
|
|
|
elsif ($configurebuild) {
|
|
|
|
# remove possible left-overs from the past
|
|
|
|
unlink "configure";
|
|
|
|
unlink "autom4te.cache";
|
2004-03-24 00:07:02 +08:00
|
|
|
|
|
|
|
# generate the build files
|
2011-12-23 18:08:06 +08:00
|
|
|
logit "invoke buildconf";
|
2004-03-24 00:07:02 +08:00
|
|
|
open(F, "./buildconf 2>&1 |") or die;
|
|
|
|
open(LOG, ">$buildlog") or die;
|
|
|
|
while (<F>) {
|
2011-12-27 20:23:47 +08:00
|
|
|
my $ll = $_;
|
2011-12-27 00:01:04 +08:00
|
|
|
# ignore messages pertaining to third party m4 files we don't care
|
2011-12-27 20:23:47 +08:00
|
|
|
next if ($ll =~ /aclocal\/gtk\.m4/);
|
|
|
|
next if ($ll =~ /aclocal\/gtkextra\.m4/);
|
|
|
|
print $ll;
|
|
|
|
print LOG $ll;
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
close(LOG);
|
|
|
|
|
|
|
|
if (grepfile("^buildconf: OK", $buildlog)) {
|
2004-07-06 05:32:18 +08:00
|
|
|
logit "buildconf was successful";
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
|
|
|
else {
|
2004-07-06 05:32:18 +08:00
|
|
|
mydie "buildconf was NOT successful";
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
logit "buildconf was successful (dummy message)";
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-03-25 05:26:41 +08:00
|
|
|
# Set timestamp to the one in curlver.h if this isn't a git test build.
|
2007-02-23 01:34:02 +08:00
|
|
|
if ((-f "include/curl/curlver.h") &&
|
|
|
|
(open(F, "<include/curl/curlver.h"))) {
|
2007-02-20 13:28:41 +08:00
|
|
|
while (<F>) {
|
|
|
|
chomp;
|
|
|
|
if ($_ =~ /^\#define\s+LIBCURL_TIMESTAMP\s+\"(.+)\".*$/) {
|
|
|
|
my $stampstring = $1;
|
2010-03-25 05:26:41 +08:00
|
|
|
if ($stampstring !~ /DEV/) {
|
2007-02-20 13:28:41 +08:00
|
|
|
$stampstring =~ s/\s+UTC//;
|
|
|
|
$timestamp = $stampstring." UTC";
|
|
|
|
}
|
|
|
|
last;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Show timestamp we are using for this test build.
|
|
|
|
logit "timestamp = $timestamp";
|
|
|
|
|
2005-03-15 15:35:36 +08:00
|
|
|
if ($configurebuild) {
|
2004-03-24 00:07:02 +08:00
|
|
|
if (-f "configure") {
|
2005-05-20 19:24:55 +08:00
|
|
|
logit "configure created (at least it exists)";
|
2004-03-24 00:07:02 +08:00
|
|
|
} else {
|
2005-05-20 19:24:55 +08:00
|
|
|
mydie "no configure created/found";
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
logit "configure created (dummy message)"; # dummy message to feign success
|
|
|
|
}
|
|
|
|
|
2005-05-17 20:07:08 +08:00
|
|
|
sub findinpath {
|
2005-08-31 02:37:08 +08:00
|
|
|
my $c;
|
|
|
|
my $e;
|
2009-05-21 23:18:26 +08:00
|
|
|
my $x = ($^O eq 'MSWin32') ? '.exe' : '';
|
|
|
|
my $s = ($^O eq 'MSWin32') ? ';' : ':';
|
2005-08-31 02:37:08 +08:00
|
|
|
my $p=$ENV{'PATH'};
|
|
|
|
my @pa = split($s, $p);
|
|
|
|
for $c (@_) {
|
|
|
|
for $e (@pa) {
|
|
|
|
if( -x "$e/$c$x") {
|
|
|
|
return $c;
|
|
|
|
}
|
2005-05-17 20:07:08 +08:00
|
|
|
}
|
2005-08-31 02:37:08 +08:00
|
|
|
}
|
2005-05-17 20:07:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
my $make = findinpath("gmake", "make", "nmake");
|
|
|
|
if(!$make) {
|
|
|
|
mydie "Couldn't find make in the PATH";
|
|
|
|
}
|
2009-05-21 23:18:26 +08:00
|
|
|
# force to 'nmake' for VC builds
|
|
|
|
$make = "nmake" if ($targetos =~ /vc/);
|
2010-08-10 10:09:35 +08:00
|
|
|
# force to 'wmake' for Watcom builds
|
|
|
|
$make = "wmake" if ($targetos =~ /watcom/);
|
2005-05-17 20:07:08 +08:00
|
|
|
logit "going with $make as make";
|
|
|
|
|
2004-03-24 00:07:02 +08:00
|
|
|
# change to build dir
|
2004-03-24 18:52:21 +08:00
|
|
|
chdir "$pwd/$build";
|
2004-03-24 00:07:02 +08:00
|
|
|
|
2005-03-15 15:35:36 +08:00
|
|
|
if ($configurebuild) {
|
2004-03-24 00:07:02 +08:00
|
|
|
# run configure script
|
2015-05-21 15:10:31 +08:00
|
|
|
print `$CURLDIR/configure $confopts 2>&1`;
|
2004-03-24 00:07:02 +08:00
|
|
|
|
|
|
|
if (-f "lib/Makefile") {
|
|
|
|
logit "configure seems to have finished fine";
|
|
|
|
} else {
|
|
|
|
mydie "configure didn't work";
|
|
|
|
}
|
|
|
|
} else {
|
2007-06-29 06:31:18 +08:00
|
|
|
logit "copying files to build dir ...";
|
2004-07-06 10:37:52 +08:00
|
|
|
if (($^O eq 'MSWin32') && ($targetos !~ /netware/)) {
|
2015-05-24 18:02:30 +08:00
|
|
|
system("xcopy /s /q \"$CURLDIR\" .");
|
2004-07-06 05:32:18 +08:00
|
|
|
system("buildconf.bat");
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
2008-08-11 02:33:41 +08:00
|
|
|
elsif ($targetos =~ /netware/) {
|
2015-05-21 15:10:31 +08:00
|
|
|
system("cp -afr $CURLDIR/* .");
|
|
|
|
system("cp -af $CURLDIR/Makefile.dist Makefile");
|
2008-08-11 02:33:41 +08:00
|
|
|
system("$make -i -C lib -f Makefile.netware prebuild");
|
|
|
|
system("$make -i -C src -f Makefile.netware prebuild");
|
2015-05-21 15:10:31 +08:00
|
|
|
if (-d "$CURLDIR/ares") {
|
2009-04-30 01:57:49 +08:00
|
|
|
system("$make -i -C ares -f Makefile.netware prebuild");
|
|
|
|
}
|
2008-08-11 02:33:41 +08:00
|
|
|
}
|
|
|
|
elsif ($^O eq 'linux') {
|
2015-05-21 15:10:31 +08:00
|
|
|
system("cp -afr $CURLDIR/* .");
|
|
|
|
system("cp -af $CURLDIR/Makefile.dist Makefile");
|
|
|
|
system("cp -af $CURLDIR/include/curl/curlbuild.h.dist ./include/curl/curlbuild.h");
|
2005-05-17 20:07:08 +08:00
|
|
|
system("$make -i -C lib -f Makefile.$targetos prebuild");
|
|
|
|
system("$make -i -C src -f Makefile.$targetos prebuild");
|
2015-05-21 15:10:31 +08:00
|
|
|
if (-d "$CURLDIR/ares") {
|
|
|
|
system("cp -af $CURLDIR/ares/ares_build.h.dist ./ares/ares_build.h");
|
2009-04-30 01:57:49 +08:00
|
|
|
system("$make -i -C ares -f Makefile.$targetos prebuild");
|
|
|
|
}
|
2004-06-23 04:02:49 +08:00
|
|
|
}
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
|
2009-05-01 01:06:58 +08:00
|
|
|
if(-f "./libcurl.pc") {
|
|
|
|
logit_spaced "display libcurl.pc";
|
|
|
|
if(open(F, "<./libcurl.pc")) {
|
|
|
|
while(<F>) {
|
|
|
|
my $ll = $_;
|
|
|
|
print $ll if(($ll !~ /^ *#/) && ($ll !~ /^ *$/));
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-11 08:15:20 +08:00
|
|
|
if(-f "./include/curl/curlbuild.h") {
|
2009-05-01 01:06:58 +08:00
|
|
|
logit_spaced "display include/curl/curlbuild.h";
|
2008-08-11 08:15:20 +08:00
|
|
|
if(open(F, "<./include/curl/curlbuild.h")) {
|
|
|
|
while(<F>) {
|
|
|
|
my $ll = $_;
|
2009-04-30 03:02:22 +08:00
|
|
|
print $ll if(($ll =~ /^ *# *define *CURL_/) && ($ll !~ /__CURL_CURLBUILD_H/));
|
2008-08-11 08:15:20 +08:00
|
|
|
}
|
|
|
|
close(F);
|
2008-08-10 07:14:40 +08:00
|
|
|
}
|
2008-08-11 08:15:20 +08:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
mydie "no curlbuild.h created/found";
|
2008-08-10 07:14:40 +08:00
|
|
|
}
|
|
|
|
|
2010-08-20 08:33:29 +08:00
|
|
|
logit_spaced "display lib/$confheader";
|
|
|
|
open(F, "lib/$confheader") or die "lib/$confheader: $!";
|
2004-03-24 00:07:02 +08:00
|
|
|
while (<F>) {
|
|
|
|
print if /^ *#/;
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
|
2012-07-03 02:21:48 +08:00
|
|
|
if (($have_embedded_ares) &&
|
|
|
|
(grepfile("^#define USE_ARES", "lib/$confheader"))) {
|
2009-05-01 01:06:58 +08:00
|
|
|
print "\n";
|
2004-03-24 00:07:02 +08:00
|
|
|
logit "setup to build ares";
|
|
|
|
|
2009-05-01 01:06:58 +08:00
|
|
|
if(-f "./ares/libcares.pc") {
|
|
|
|
logit_spaced "display ares/libcares.pc";
|
|
|
|
if(open(F, "<./ares/libcares.pc")) {
|
|
|
|
while(<F>) {
|
|
|
|
my $ll = $_;
|
|
|
|
print $ll if(($ll !~ /^ *#/) && ($ll !~ /^ *$/));
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-04-29 09:31:37 +08:00
|
|
|
if(-f "./ares/ares_build.h") {
|
2009-05-01 01:06:58 +08:00
|
|
|
logit_spaced "display ares/ares_build.h";
|
2009-04-29 09:31:37 +08:00
|
|
|
if(open(F, "<./ares/ares_build.h")) {
|
|
|
|
while(<F>) {
|
|
|
|
my $ll = $_;
|
2009-04-30 03:02:22 +08:00
|
|
|
print $ll if(($ll =~ /^ *# *define *CARES_/) && ($ll !~ /__CARES_BUILD_H/));
|
2009-04-29 09:31:37 +08:00
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
mydie "no ares_build.h created/found";
|
|
|
|
}
|
|
|
|
|
2010-08-20 08:33:29 +08:00
|
|
|
$confheader =~ s/curl/ares/;
|
|
|
|
logit_spaced "display ares/$confheader";
|
|
|
|
if(open(F, "ares/$confheader")) {
|
2005-05-10 19:19:12 +08:00
|
|
|
while (<F>) {
|
|
|
|
print if /^ *#/;
|
|
|
|
}
|
|
|
|
close(F);
|
2005-05-09 15:45:30 +08:00
|
|
|
}
|
|
|
|
|
2009-05-01 01:06:58 +08:00
|
|
|
print "\n";
|
2004-03-24 00:07:02 +08:00
|
|
|
logit "build ares";
|
|
|
|
chdir "ares";
|
2004-07-25 05:24:03 +08:00
|
|
|
|
2005-03-18 17:21:25 +08:00
|
|
|
if ($targetos && !$configurebuild) {
|
2005-05-17 20:07:08 +08:00
|
|
|
logit "$make -f Makefile.$targetos";
|
|
|
|
open(F, "$make -f Makefile.$targetos 2>&1 |") or die;
|
2005-03-18 17:21:25 +08:00
|
|
|
}
|
|
|
|
else {
|
2005-05-17 20:07:08 +08:00
|
|
|
logit "$make";
|
|
|
|
open(F, "$make 2>&1 |") or die;
|
2004-07-06 05:32:18 +08:00
|
|
|
}
|
2004-03-24 00:07:02 +08:00
|
|
|
while (<F>) {
|
|
|
|
s/$pwd//g;
|
|
|
|
print;
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
|
2006-05-27 19:36:05 +08:00
|
|
|
if (-f "libcares$libext") {
|
2004-07-06 10:37:52 +08:00
|
|
|
logit "ares is now built successfully (libcares$libext)";
|
2004-03-24 00:07:02 +08:00
|
|
|
} else {
|
2009-06-03 08:07:46 +08:00
|
|
|
mydie "ares build failed (libcares$libext)";
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# cd back to the curl build dir
|
2004-03-24 18:52:21 +08:00
|
|
|
chdir "$pwd/$build";
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
|
2009-05-21 23:18:26 +08:00
|
|
|
my $mkcmd = "$make -i" . ($targetos && !$configurebuild ? " $targetos" : "");
|
|
|
|
logit "$mkcmd";
|
|
|
|
open(F, "$mkcmd 2>&1 |") or die;
|
2009-05-21 21:23:49 +08:00
|
|
|
while (<F>) {
|
|
|
|
s/$pwd//g;
|
|
|
|
print;
|
|
|
|
}
|
|
|
|
close(F);
|
2004-03-24 00:07:02 +08:00
|
|
|
|
2006-05-27 19:36:05 +08:00
|
|
|
if (-f "lib/libcurl$libext") {
|
2006-05-25 19:04:08 +08:00
|
|
|
logit "libcurl was created fine (libcurl$libext)";
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
|
|
|
else {
|
2006-05-25 19:04:08 +08:00
|
|
|
mydie "libcurl was not created (libcurl$libext)";
|
2004-07-06 10:37:52 +08:00
|
|
|
}
|
|
|
|
|
2004-06-23 04:02:49 +08:00
|
|
|
if (-f "src/curl$binext") {
|
2006-05-25 19:04:08 +08:00
|
|
|
logit "curl was created fine (curl$binext)";
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
|
|
|
else {
|
2006-05-25 19:04:08 +08:00
|
|
|
mydie "curl was not created (curl$binext)";
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
|
2008-03-21 00:10:54 +08:00
|
|
|
if (!$crosscompile || (($extvercmd ne '') && (-x $extvercmd))) {
|
|
|
|
logit "display curl${binext} --version output";
|
|
|
|
my $cmd = ($extvercmd ne '' ? $extvercmd.' ' : '')."./src/curl${binext} --version|";
|
|
|
|
open(F, $cmd);
|
2005-04-18 13:46:10 +08:00
|
|
|
while(<F>) {
|
2009-05-21 22:14:57 +08:00
|
|
|
# strip CR from output on non-win32 platforms (wine on Linux)
|
|
|
|
s/\r// if ($^O ne 'MSWin32');
|
2009-05-21 21:02:34 +08:00
|
|
|
print;
|
2005-04-18 13:46:10 +08:00
|
|
|
}
|
|
|
|
close(F);
|
2004-06-23 04:02:49 +08:00
|
|
|
}
|
2004-03-24 00:07:02 +08:00
|
|
|
|
2005-03-15 15:35:36 +08:00
|
|
|
if ($configurebuild && !$crosscompile) {
|
2012-12-01 02:13:50 +08:00
|
|
|
my $host_triplet = get_host_triplet();
|
|
|
|
# build example programs for selected build targets
|
|
|
|
if(($host_triplet =~ /([^-]+)-([^-]+)-irix(.*)/) ||
|
|
|
|
($host_triplet =~ /([^-]+)-([^-]+)-aix(.*)/) ||
|
|
|
|
($host_triplet =~ /([^-]+)-([^-]+)-osf(.*)/) ||
|
|
|
|
($host_triplet =~ /([^-]+)-([^-]+)-solaris2(.*)/)) {
|
|
|
|
chdir "$pwd/$build/docs/examples";
|
|
|
|
logit_spaced "build examples";
|
|
|
|
open(F, "$make -i 2>&1 |") or die;
|
|
|
|
open(LOG, ">$buildlog") or die;
|
|
|
|
while (<F>) {
|
|
|
|
s/$pwd//g;
|
|
|
|
print;
|
|
|
|
print LOG;
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
close(LOG);
|
|
|
|
chdir "$pwd/$build";
|
|
|
|
}
|
|
|
|
# build and run full test suite
|
2005-03-17 17:44:09 +08:00
|
|
|
my $o;
|
|
|
|
if($runtestopts) {
|
|
|
|
$o = "TEST_F=\"$runtestopts\" ";
|
|
|
|
}
|
2005-09-16 05:49:26 +08:00
|
|
|
logit "$make -k ${o}test-full";
|
|
|
|
open(F, "$make -k ${o}test-full 2>&1 |") or die;
|
2004-03-24 00:07:02 +08:00
|
|
|
open(LOG, ">$buildlog") or die;
|
|
|
|
while (<F>) {
|
|
|
|
s/$pwd//g;
|
|
|
|
print;
|
|
|
|
print LOG;
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
close(LOG);
|
|
|
|
|
|
|
|
if (grepfile("^TEST", $buildlog)) {
|
|
|
|
logit "tests were run";
|
|
|
|
} else {
|
|
|
|
mydie "test suite failure";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (grepfile("^TESTFAIL:", $buildlog)) {
|
|
|
|
logit "the tests were not successful";
|
|
|
|
} else {
|
|
|
|
logit "the tests were successful!";
|
|
|
|
}
|
2009-06-11 09:22:35 +08:00
|
|
|
}
|
|
|
|
else {
|
2005-03-15 15:35:36 +08:00
|
|
|
if($crosscompile) {
|
2009-06-11 09:22:35 +08:00
|
|
|
my $host_triplet = get_host_triplet();
|
2012-04-13 03:14:53 +08:00
|
|
|
# build example programs for selected cross-compiles
|
2012-04-14 01:33:45 +08:00
|
|
|
if(($host_triplet =~ /([^-]+)-([^-]+)-mingw(.*)/) ||
|
|
|
|
($host_triplet =~ /([^-]+)-([^-]+)-android(.*)/)) {
|
2012-04-13 03:14:53 +08:00
|
|
|
chdir "$pwd/$build/docs/examples";
|
|
|
|
logit_spaced "build examples";
|
|
|
|
open(F, "$make -i 2>&1 |") or die;
|
|
|
|
open(LOG, ">$buildlog") or die;
|
|
|
|
while (<F>) {
|
|
|
|
s/$pwd//g;
|
|
|
|
print;
|
|
|
|
print LOG;
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
close(LOG);
|
|
|
|
chdir "$pwd/$build";
|
|
|
|
}
|
|
|
|
# build test harness programs for selected cross-compiles
|
2009-06-11 09:22:35 +08:00
|
|
|
if($host_triplet =~ /([^-]+)-([^-]+)-mingw(.*)/) {
|
|
|
|
chdir "$pwd/$build/tests";
|
|
|
|
logit_spaced "build test harness";
|
|
|
|
open(F, "$make -i 2>&1 |") or die;
|
|
|
|
open(LOG, ">$buildlog") or die;
|
|
|
|
while (<F>) {
|
|
|
|
s/$pwd//g;
|
|
|
|
print;
|
|
|
|
print LOG;
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
close(LOG);
|
|
|
|
chdir "$pwd/$build";
|
|
|
|
}
|
|
|
|
logit_spaced "cross-compiling, can't run tests";
|
2005-03-15 15:35:36 +08:00
|
|
|
}
|
2009-06-11 09:22:35 +08:00
|
|
|
# dummy message to feign success
|
2005-03-15 15:35:36 +08:00
|
|
|
print "TESTDONE: 1 tests out of 0 (dummy message)\n";
|
2004-03-24 00:07:02 +08:00
|
|
|
}
|
|
|
|
|
2004-07-06 06:35:00 +08:00
|
|
|
# create a tarball if we got that option.
|
2008-03-21 00:10:54 +08:00
|
|
|
if (($mktarball ne '') && (-x $mktarball)) {
|
2004-07-06 06:35:00 +08:00
|
|
|
system($mktarball);
|
2004-07-06 05:41:28 +08:00
|
|
|
}
|
|
|
|
|
2004-03-24 00:07:02 +08:00
|
|
|
# mydie to cleanup
|
|
|
|
mydie "ending nicely";
|