This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In t/porting/diag.t, use TestInit to chdir and set up @INC.
authorNicholas Clark <nick@ccl4.org>
Sun, 8 Apr 2012 11:08:28 +0000 (13:08 +0200)
committerNicholas Clark <nick@ccl4.org>
Thu, 23 May 2013 12:32:40 +0000 (14:32 +0200)
Also eliminate the $|=1, as it's really not necessary for tests that neither
fork nor shell out to other processes.

t/porting/diag.t

index 423a197..4da2fc5 100644 (file)
@@ -1,15 +1,15 @@
 #!/usr/bin/perl
-use warnings;
-use strict;
 
 BEGIN {
-  chdir 't';
-  require './test.pl';
+  @INC = '..' if -f '../TestInit.pm';
 }
+use TestInit qw(T); # T is chdir to the top level
 
-plan('no_plan');
+use warnings;
+use strict;
 
-$|=1;
+require 't/test.pl';
+plan('no_plan');
 
 # --make-exceptions-list outputs the list of strings that don't have
 # perldiag.pod entries to STDERR without TAP formatting, so they can
@@ -19,8 +19,7 @@ $|=1;
 # Just add the documentation instead.
 my $make_exceptions_list = ($ARGV[0]||'') eq '--make-exceptions-list';
 
-chdir '..' or die "Can't chdir ..: $!";
-BEGIN { defined $ENV{PERL_UNICODE} and push @INC, "lib"; }
+require 'regen/embed_lib.pl';
 
 my @functions;