From: Gurusamy Sarathy <gsar@cpan.org>
Date: Thu, 2 Mar 2000 21:15:11 +0000 (+0000)
Subject: Test::Harness uses $ENV{HARNESS_PERL_SWITCHES} when running perl;
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2b32313b2334aed2d9d08b80aa13b6e89b87796e;p=p5sagit%2Fp5-mst-13.2.git

Test::Harness uses $ENV{HARNESS_PERL_SWITCHES} when running perl;
add test targets for -C switch on windows

p4raw-id: //depot/perl@5456
---

diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm
index 6d472a9..9902741 100644
--- a/lib/Test/Harness.pm
+++ b/lib/Test/Harness.pm
@@ -95,6 +95,8 @@ sub runtests {
 	$fh->open($test) or print "can't open $test. $!\n";
 	my $first = <$fh>;
 	my $s = $switches;
+	$s .= " $ENV{'HARNESS_PERL_SWITCHES'}"
+	    if exists $ENV{'HARNESS_PERL_SWITCHES'};
 	$s .= join " ", q[ "-T"], map {qq["-I$_"]} @INC
 	    if $first =~ /^#!.*\bperl.*-\w*T/;
 	$fh->close or print "can't close $test. $!\n";
@@ -509,6 +511,11 @@ If relative, directory name is with respect to the current directory at
 the moment runtests() was called.  Putting absolute path into 
 C<HARNESS_FILELEAK_IN_DIR> may give more predicatable results.
 
+The value of C<HARNESS_PERL_SWITCHES> will be prepended to the
+switches used to invoke perl on each test.  For example, setting
+C<HARNESS_PERL_SWITCHES> to "-W" will run all tests with all
+warnings enabled.
+
 Harness sets C<HARNESS_ACTIVE> before executing the individual tests.
 This allows the tests to determine if they are being executed through the
 harness or by any other means.
diff --git a/win32/Makefile b/win32/Makefile
index ddc7a9f..3909230 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -1070,6 +1070,19 @@ test-notty : test-prep
 	$(PERLEXE) -I..\lib harness
 	cd ..\win32
 
+test-wide : test-prep
+	set HARNESS_PERL_SWITCHES=-C
+	cd ..\t
+	$(PERLEXE) -I..\lib harness
+	cd ..\win32
+
+test-wide-notty : test-prep
+	set PERL_SKIP_TTY_TEST=1
+	set HARNESS_PERL_SWITCHES=-C
+	cd ..\t
+	$(PERLEXE) -I..\lib harness
+	cd ..\win32
+
 clean : 
 	-@erase miniperlmain$(o)
 	-@erase $(MINIPERL)
diff --git a/win32/makefile.mk b/win32/makefile.mk
index fd34a06..d727c9f 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -1284,7 +1284,16 @@ test : $(RIGHTMAKE) test-prep
 
 test-notty : test-prep
 	set PERL_SKIP_TTY_TEST=1 && \
-	cd ..\t && $(PERLEXE) -I.\lib harness
+	    cd ..\t && $(PERLEXE) -I.\lib harness
+
+test-wide : test-prep
+	set HARNESS_PERL_SWITCHES=-C && \
+	    cd ..\t && $(PERLEXE) -I..\lib harness
+
+test-wide-notty : test-prep
+	set PERL_SKIP_TTY_TEST=1 && \
+	    set HARNESS_PERL_SWITCHES=-C && \
+	    cd ..\t && $(PERLEXE) -I..\lib harness
 
 clean : 
 	-@erase miniperlmain$(o)