diff options
author | Yang Tse <yangsita@gmail.com> | 2005-12-08 11:29:47 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2005-12-08 11:29:47 +0000 |
commit | 93d59520e44915d6cd5f60db4a200d6882a5c678 (patch) | |
tree | 7f0ecea47a4d4ab27b50922babd71427032c0b0e | |
parent | b68d3a073ba7aaed0644b93c2c0c1fbab2a32f9d (diff) |
If unable to get curl's version, log all failure details.
-rwxr-xr-x | tests/runtests.pl | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl index 5ae341742..e4a7b1071 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -843,9 +843,24 @@ sub checksystem { my $feat; my $curl; my $libcurl; - my $versionerr="$LOGDIR/versionerr.log"; - my $versioncmd="$CURL --version 2>$versionerr"; - my @version=`$versioncmd`; + my $versretval; + my $versnoexec; + my @version=(); + + my $curlverout="$LOGDIR/curlverout.log"; + my $curlvererr="$LOGDIR/curlvererr.log"; + my $versioncmd="$CURL --version 1>$curlverout 2>$curlvererr"; + + unlink($curlverout); + unlink($curlvererr); + + $versretval = system($versioncmd); + $versnoexec = $!; + + open(VERSOUT, $curlverout); + @version = <VERSOUT>; + close(VERSOUT); + for(@version) { chomp; @@ -956,17 +971,23 @@ sub checksystem { } if(!$curl) { logmsg "unable to get curl's version! further details are:\n"; - logmsg "CURL: \n"; - logmsg "$CURL \n"; - logmsg "VERSIONCMD: \n"; + logmsg "issued command: \n"; logmsg "$versioncmd \n"; - logmsg "STDOUT: \n"; - for(@version) { - chomp; - logmsg "$_ \n"; + if ($versretval == -1) { + logmsg "command failed with: \n"; + logmsg "$versnoexec \n"; + } + elsif ($versretval & 127) { + logmsg sprintf("command died with signal %d, and %s coredump. \n", + ($versretval & 127), ($versretval & 128)?"a":"no"); + } + else { + logmsg sprintf("command exited with value %d \n", $versretval >> 8); } - logmsg "STDERR: \n"; - displaylogcontent("$versionerr"); + logmsg "contents of $curlverout: \n"; + displaylogcontent("$curlverout"); + logmsg "contents of $curlvererr: \n"; + displaylogcontent("$curlvererr"); die "couldn't get curl's version!"; } |