mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 07:38:49 -05:00
provide a source path to the servers to make them find the tests when run
outside the source dir, not needing any symlinks
This commit is contained in:
parent
f9a6e7b68d
commit
49ab1d914c
@ -92,8 +92,15 @@ sub getpart {
|
||||
sub loadtest {
|
||||
my ($file)=@_;
|
||||
|
||||
my $dir;
|
||||
$dir = $ENV{'srcdir'};
|
||||
if(!$dir) {
|
||||
$dir=".";
|
||||
}
|
||||
|
||||
|
||||
undef @xml;
|
||||
open(XML, "<$file") ||
|
||||
open(XML, "<$dir/$file") ||
|
||||
return 1; # failure!
|
||||
binmode XML; # for crapage systems, use binary
|
||||
while(<XML>) {
|
||||
|
@ -4,14 +4,19 @@ use strict;
|
||||
|
||||
my $verbose=0; # set to 1 for debugging
|
||||
|
||||
my $dir=".";
|
||||
my $port = 8999; # just a default
|
||||
do {
|
||||
if($ARGV[0] eq "-v") {
|
||||
$verbose=1;
|
||||
}
|
||||
elsif($ARGV[0] eq "-d") {
|
||||
$dir=$ARGV[1];
|
||||
shift @ARGV;
|
||||
}
|
||||
elsif($ARGV[0] =~ /^(\d+)$/) {
|
||||
$port = $1;
|
||||
}
|
||||
} while(shift @ARGV);
|
||||
|
||||
exec("server/sws $port");
|
||||
exec("server/sws $port $dir");
|
||||
|
@ -39,7 +39,7 @@ my $FTPSPORT=8821; # this is the FTPS server port
|
||||
my $CURL="../src/curl"; # what curl executable to run on the tests
|
||||
my $DBGCURL=$CURL; #"../src/.libs/curl"; # alternative for debugging
|
||||
my $LOGDIR="log";
|
||||
my $TESTDIR="data";
|
||||
my $TESTDIR="$srcdir/data";
|
||||
my $LIBDIR="./libtest";
|
||||
my $SERVERIN="$LOGDIR/server.input"; # what curl sent the server
|
||||
my $CURLLOG="$LOGDIR/curl.log"; # all command lines run
|
||||
@ -354,6 +354,10 @@ sub runhttpserver {
|
||||
}
|
||||
|
||||
my $flag=$debugprotocol?"-v ":"";
|
||||
my $dir=$ENV{'srcdir'};
|
||||
if($dir) {
|
||||
$flag .= "-d \"$dir\" ";
|
||||
}
|
||||
$cmd="$perl $srcdir/httpserver.pl $flag $HOSTPORT &";
|
||||
system($cmd);
|
||||
if($verbose) {
|
||||
@ -691,6 +695,9 @@ sub checkcurl {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$curl) {
|
||||
die "couldn't run curl!"
|
||||
}
|
||||
|
||||
my $hostname=`hostname`;
|
||||
my $hosttype=`uname -a`;
|
||||
|
@ -70,7 +70,10 @@ spitout(FILE *stream,
|
||||
#define REQUEST_DUMP "log/server.input"
|
||||
#define RESPONSE_DUMP "log/server.response"
|
||||
|
||||
#define TEST_DATA_PATH "data/test%d"
|
||||
#define TEST_DATA_PATH "%s/data/test%d"
|
||||
|
||||
/* global variable, where to find the 'data' dir */
|
||||
char *path=".";
|
||||
|
||||
enum {
|
||||
DOCNUMBER_QUIT = -6,
|
||||
@ -442,7 +445,7 @@ static int send_doc(int sock,
|
||||
if(0 != part_no)
|
||||
sprintf(partbuf, "data%d", part_no);
|
||||
|
||||
sprintf(filename, TEST_DATA_PATH, doc);
|
||||
sprintf(filename, TEST_DATA_PATH, path, doc);
|
||||
|
||||
stream=fopen(filename, "rb");
|
||||
if(!stream) {
|
||||
@ -537,9 +540,14 @@ int main(int argc, char *argv[])
|
||||
int part_no;
|
||||
FILE *pidfile;
|
||||
|
||||
if(argc>1)
|
||||
if(argc>1) {
|
||||
port = atoi(argv[1]);
|
||||
|
||||
if(argc>2) {
|
||||
path = argv[2];
|
||||
}
|
||||
}
|
||||
|
||||
logfp = fopen(logfile, "a");
|
||||
if (!logfp) {
|
||||
perror(logfile);
|
||||
|
Loading…
Reference in New Issue
Block a user