]> sjero.net Git - wget/blobdiff - tests/WgetTest.pm.in
Improved exit status handling.
[wget] / tests / WgetTest.pm.in
index d0a62175cca9b0f08eb10478300b6d6142646780..c4c0d4d94dad44ccf3d4756fd5da59faeb397c93 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl -w
-
 # WARNING!
 # WgetTest.pm is a generated file! Do not edit! Edit WgetTest.pm.in
 # instead.
@@ -8,6 +6,7 @@ package WgetTest;
 $VERSION = 0.01;
 
 use strict;
+use warnings;
 
 use Cwd;
 use File::Path;
@@ -89,6 +88,7 @@ sub run {
         ($cmdline =~ m{^/.*})
             ? system ($cmdline)
             : system ("$self->{_workdir}/../src/$cmdline");
+    $errcode >>= 8; # XXX: should handle abnormal error codes.
 
     # Shutdown server
     # if we didn't explicitely kill the server, we would have to call
@@ -154,7 +154,7 @@ sub _cleanup {
     my $self = shift;
 
     chdir ($self->{_workdir});
-    File::Path::rmtree ($self->{_name});
+    File::Path::rmtree ($self->{_name}) unless $ENV{WGET_TEST_NO_CLEANUP};
 }