Variables are first substituted as in the <command> section.
</setenv>
-<command [option="no-output"] [timeout="secs"] [delay="secs"]>
+<command [option="no-output"] [timeout="secs"] [delay="secs"] [type="perl"]>
command line to run, there's a bunch of %variables that get replaced
accordingly.
number given in the CONNECT request will be used to identify which test that
is being run, if the proxy host name is said to start with 'test'.
+Set type="perl" to write the test case as a perl script. It implies that
+there's no memory debugging and valgrind gets shut off for this test.
+
Set option="no-output" to prevent the test script to slap on the --output
argument that directs the output to a file. The --output is also not added if
the verify/stdout section is used.
my $why;
my %feature;
my $cmd;
+ my $disablevalgrind;
# copy test number to a global scope var, this allows
# testnum checking when starting test harness servers.
@reply=@replycheck;
}
- # curl command to run
- my @curlcmd= fixarray ( getpart("client", "command") );
-
# this is the valid protocol blurb curl should generate
my @protocol= fixarray ( getpart("verify", "protocol") );
my @blaha;
($cmd, @blaha)= getpart("client", "command");
- # make some nice replace operations
- $cmd =~ s/\n//g; # no newlines please
-
- # substitute variables in the command line
- subVariables \$cmd;
-
+ if($cmd) {
+ # make some nice replace operations
+ $cmd =~ s/\n//g; # no newlines please
+ # substitute variables in the command line
+ subVariables \$cmd;
+ }
if($curl_debug) {
unlink($memdump);
}
}
}
+ my $CMDLINE;
my $cmdargs;
- if(!$tool) {
+ my $cmdtype = $cmdhash{'type'} || "default";
+ if($cmdtype eq "perl") {
+ # run the command line prepended with "perl"
+ $cmdargs ="$cmd";
+ $CMDLINE = "perl ";
+ $tool=$CMDLINE;
+ $disablevalgrind=1;
+ }
+ elsif(!$tool) {
# run curl, add --verbose for debug information output
$cmdargs ="$out --include --verbose --trace-time $cmd";
}
else {
$cmdargs = " $cmd"; # $cmd is the command line for the test file
$CURLOUT = $STDOUT; # sends received data to stdout
+
+ $CMDLINE="$LIBDIR/$tool";
+ if(! -f $CMDLINE) {
+ print "The tool set in the test case for this: '$tool' does not exist\n";
+ timestampskippedevents($testnum);
+ return -1;
+ }
+ $DBGCURL=$CMDLINE;
}
my @stdintest = getpart("client", "stdin");
$cmdargs .= " <$stdinfile";
}
- my $CMDLINE;
if(!$tool) {
$CMDLINE="$CURL";
}
- else {
- $CMDLINE="$LIBDIR/$tool";
- if(! -f $CMDLINE) {
- print "The tool set in the test case for this: '$tool' does not exist\n";
- timestampskippedevents($testnum);
- return -1;
- }
- $DBGCURL=$CMDLINE;
- }
my $usevalgrind;
- if($valgrind) {
+ if($valgrind && !$disablevalgrind) {
my @valgrindoption = getpart("verify", "valgrind");
if((!@valgrindoption) || ($valgrindoption[0] !~ /disable/)) {
$usevalgrind = 1;
if($curl_debug) {
if(! -f $memdump) {
- logmsg "\n** ALERT! memory debugging with no output file?\n";
+ logmsg "\n** ALERT! memory debugging with no output file?\n"
+ if(!$cmdtype eq "perl");
}
else {
my @memdata=`$memanalyze $memdump`;
$ok .= "v";
}
else {
- if(!$short) {
+ if(!$short && !$disablevalgrind) {
logmsg " valgrind SKIPPED\n";
}
$ok .= "-"; # skipped