Add core switch to CGI.pm distribution tests
authorchromatic <chromatic@wgz.org>
Sat, 10 Nov 2001 01:28:09 +0000 (18:28 -0700)
committerAbhijit Menon-Sen <ams@wiw.org>
Sat, 10 Nov 2001 07:46:53 +0000 (07:46 +0000)
(was Re: perl@12892)
Message-Id: <20011110083514.86488.qmail@onion.perl.org>

p4raw-link: @12892 on //depot/perl: a1e868e78b738bf013a42fa7247d72d0e6b6bba1

p4raw-id: //depot/perl@12930

12 files changed:
lib/CGI/t/apache.t
lib/CGI/t/carp.t
lib/CGI/t/cookie.t
lib/CGI/t/fast.t
lib/CGI/t/form.t
lib/CGI/t/function.t
lib/CGI/t/html.t
lib/CGI/t/pretty.t
lib/CGI/t/push.t
lib/CGI/t/request.t
lib/CGI/t/switch.t
lib/CGI/t/util.t

index 7f92155..637ac88 100644 (file)
@@ -1,10 +1,15 @@
 #!/usr/local/bin/perl -w
 
-use lib qw(t/lib);
-
-# Due to a bug in older versions of MakeMaker & Test::Harness, we must
-# ensure the blib's are in @INC, else we might use the core CGI.pm
-use lib qw(blib/lib blib/arch);
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               # Due to a bug in older versions of MakeMaker & Test::Harness, we must
+               # ensure the blib's are in @INC, else we might use the core CGI.pm
+               unshift @INC, qw( ../blib/lib ../blib/arch lib );
+       }
+}
 
 use strict;
 use Test::More tests => 1;
index 9bf5465..b17f014 100644 (file)
@@ -1,12 +1,18 @@
 # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 2 -*-
 #!/usr/local/bin/perl -w
 
-use strict;
-use lib qw(t/lib);
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               # Due to a bug in older versions of MakeMaker & Test::Harness, we must
+               # ensure the blib's are in @INC, else we might use the core CGI.pm
+               unshift @INC, qw( ../blib/lib ../blib/arch lib );
+       }
+}
 
-# Due to a bug in older versions of MakeMaker & Test::Harness, we must
-# ensure the blib's are in @INC, else we might use the core CGI.pm
-use lib qw(blib/lib blib/arch);
+use strict;
 
 use Test::More tests => 42;
 use IO::Handle;
@@ -171,7 +177,7 @@ untie *STDOUT;
 open(STDOUT, ">&REAL_STDOUT");
 my $fname = $0;
 $fname =~ tr/<>-/\253\273\255/; # _warn does this so we have to also
-is( $fake_out, "<!-- warning: There is a problem at $fname line 100. -->\n",
+is( $fake_out, "<!-- warning: There is a problem at $fname line 106. -->\n",
                         'warningsToBrowser() on' );
 
 is($CGI::Carp::EMIT_WARNINGS, 1, "Warnings turned off");
index f02d113..c523d7a 100644 (file)
@@ -1,12 +1,17 @@
 #!/usr/local/bin/perl -w
 
-use lib qw(t/lib);
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               # Due to a bug in older versions of MakeMaker & Test::Harness, we must
+               # ensure the blib's are in @INC, else we might use the core CGI.pm
+               unshift @INC, qw( ../blib/lib ../blib/arch lib );
+       }
+}
 use strict;
 
-# Due to a bug in older versions of MakeMaker & Test::Harness, we must
-# ensure the blib's are in @INC, else we might use the core CGI.pm
-use lib qw(blib/lib blib/arch);
-
 use Test::More tests => 86;
 use CGI::Util qw(escape unescape);
 use POSIX qw(strftime);
index 45f8e12..d8ad973 100644 (file)
@@ -1,10 +1,15 @@
 #!./perl -w
 
-use lib qw(t/lib);
-
-# Due to a bug in older versions of MakeMaker & Test::Harness, we must
-# ensure the blib's are in @INC, else we might use the core CGI.pm
-use lib qw(blib/lib blib/arch);
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               # Due to a bug in older versions of MakeMaker & Test::Harness, we must
+               # ensure the blib's are in @INC, else we might use the core CGI.pm
+               unshift @INC, qw( ../blib/lib ../blib/arch lib );
+       }
+}
 
 my $fcgi;
 BEGIN {
index 344e7f0..ae6ed59 100755 (executable)
@@ -1,10 +1,15 @@
 #!/usr/local/bin/perl -w
 
-use lib qw(t/lib);
-
-# Due to a bug in older versions of MakeMaker & Test::Harness, we must
-# ensure the blib's are in @INC, else we might use the core CGI.pm
-use lib qw(blib/lib blib/arch);
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               # Due to a bug in older versions of MakeMaker & Test::Harness, we must
+               # ensure the blib's are in @INC, else we might use the core CGI.pm
+               unshift @INC, qw( ../blib/lib ../blib/arch lib );
+       }
+}
 
 use Test::More tests => 17;
 
index d72382c..26fc32a 100755 (executable)
@@ -1,10 +1,13 @@
 #!/usr/local/bin/perl -w
 
-use lib qw(t/lib);
-
-# Test ability to retrieve HTTP request info
-######################### We start with some black magic to print on failure.
-use lib '../blib/lib','../blib/arch';
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               unshift @INC, qw( ../blib/lib ../blib/arch lib );
+       }
+}
 
 BEGIN {$| = 1; print "1..28\n"; }
 END {print "not ok 1\n" unless $loaded;}
@@ -38,9 +41,6 @@ if ($^O eq 'VMS') { $CRLF = "\n"; }
 
 if (ord("\t") != 9) { $CRLF = "\r\n"; }
 
-# Web servers on EBCDIC hosts are typically set up to do an EBCDIC -> ASCII
-# translation hence CRLF is used as \r\n within CGI.pm on such machines.
-
 if (ord("\t") != 9) { $CRLF = "\r\n"; }
  
 # Set up a CGI environment
index 761951f..97fdb0a 100755 (executable)
@@ -1,8 +1,15 @@
 #!/usr/local/bin/perl -w
 
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               unshift @INC, qw( ../blib/lib ../blib/arch lib );
+       }
+}
 # Test ability to retrieve HTTP request info
 ######################### We start with some black magic to print on failure.
-use lib '../blib/lib','../blib/arch';
 
 BEGIN {$| = 1; print "1..24\n"; }
 END {print "not ok 1\n" unless $loaded;}
index 9a311fb..033bcbf 100755 (executable)
@@ -1,7 +1,15 @@
 #!/usr/local/bin/perl -w
 
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               unshift @INC, qw( ../blib/lib ../blib/arch lib );
+       }
+}
+
 use strict;
-use lib 't/lib','../blib/lib','./blib/lib';
 use Test::More tests => 5;
 
 BEGIN { use_ok('CGI::Pretty') };
index 2c48d60..dbe4551 100644 (file)
@@ -1,10 +1,15 @@
 #!./perl -wT
 
-use lib qw(t/lib);
-
-# Due to a bug in older versions of MakeMaker & Test::Harness, we must
-# ensure the blib's are in @INC, else we might use the core CGI.pm
-use lib qw(blib/lib blib/arch);
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               # Due to a bug in older versions of MakeMaker & Test::Harness, we must
+               # ensure the blib's are in @INC, else we might use the core CGI.pm
+               unshift @INC, qw( ../blib/lib  ../blib/arch lib );
+       }
+}      
 
 use Test::More tests => 12; 
 
index 96775a9..5c79050 100755 (executable)
@@ -1,8 +1,16 @@
 #!/usr/local/bin/perl -w
 
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               unshift @INC, qw( ../blib/lib ../blib/arch lib );
+       }
+}
+
 # Test ability to retrieve HTTP request info
 ######################### We start with some black magic to print on failure.
-use lib '../blib/lib','../blib/arch';
 
 BEGIN {$| = 1; print "1..33\n"; }
 END {print "not ok 1\n" unless $loaded;}
index ac58618..eda3e82 100644 (file)
@@ -1,10 +1,15 @@
 #!/usr/local/bin/perl -w
 
-use lib qw(t/lib);
-
-# Due to a bug in older versions of MakeMaker & Test::Harness, we must
-# ensure the blib's are in @INC, else we might use the core CGI.pm
-use lib qw(blib/lib blib/arch);
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               # Due to a bug in older versions of MakeMaker & Test::Harness, we must
+               # ensure the blib's are in @INC, else we might use the core CGI.pm
+               unshift @INC, qw( ../blib/lib  ../blib/arch lib );
+       }
+}
 
 use strict;
 use Test::More tests => 1;
index 8f9da3b..c5ec617 100644 (file)
@@ -1,10 +1,17 @@
 #!/usr/local/bin/perl -w
 
+BEGIN {
+       chdir 't' if -d 't';
+       if ($ENV{PERL_CORE}) {
+               @INC = '../lib';
+       } else {
+               unshift @INC, qw( ../blib/lib ../blib/arch lib );
+       }
+}
+
 # Test ability to escape() and unescape() punctuation characters
 # except for qw(- . _).
 ######################### We start with some black magic to print on failure.
-use lib '../blib/lib','../blib/arch';
-
 BEGIN {$| = 1; print "1..59\n"; }
 END {print "not ok 1\n" unless $loaded;}
 use Config;