Parcourir la source

runtests and friends: Do not add undefined values to @INC

On FreeBSD this fixes the warning:
Use of uninitialized value $p in string eq at /usr/local/lib/perl5/5.14.2/BSDPAN/BSDPAN.pm line 36.
Fabian Keil il y a 11 ans
Parent
commit
ca5f4e2135
7 fichiers modifiés avec 14 ajouts et 7 suppressions
  1. 2 1
      tests/ftpserver.pl
  2. 2 1
      tests/httpserver.pl
  3. 2 1
      tests/keywords.pl
  4. 2 1
      tests/rtspserver.pl
  5. 2 1
      tests/runtests.pl
  6. 2 1
      tests/secureserver.pl
  7. 2 1
      tests/tftpserver.pl

+ 2 - 1
tests/ftpserver.pl

@@ -39,7 +39,8 @@
 #
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, '.');
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
     # sub second timestamping needs Time::HiRes
     eval {
         no warnings "all";

+ 2 - 1
tests/httpserver.pl

@@ -22,7 +22,8 @@
 #***************************************************************************
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, '.');
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
 }
 
 use strict;

+ 2 - 1
tests/keywords.pl

@@ -23,7 +23,8 @@
 
 use strict;
 
-@INC=(@INC, $ENV{'srcdir'}, ".");
+push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+push(@INC, ".");
 
 require "getpart.pm"; # array functions
 

+ 2 - 1
tests/rtspserver.pl

@@ -22,7 +22,8 @@
 #***************************************************************************
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, '.');
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
 }
 
 use strict;

+ 2 - 1
tests/runtests.pl

@@ -56,7 +56,8 @@
 # These should be the only variables that might be needed to get edited:
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, ".");
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
     # run time statistics needs Time::HiRes
     eval {
         no warnings "all";

+ 2 - 1
tests/secureserver.pl

@@ -26,7 +26,8 @@
 # non-secure test harness servers.
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, '.');
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
 }
 
 use strict;

+ 2 - 1
tests/tftpserver.pl

@@ -22,7 +22,8 @@
 #***************************************************************************
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, '.');
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
 }
 
 use strict;