Change 13027 by jhi@alpha on 2001/11/15 21:16:57
Subject: [PATCH] -x (was Re: [PATCH] new tests for command-line switches)
From: Michael G Schwern <[EMAIL PROTECTED]>
Date: Thu, 15 Nov 2001 12:47:59 -0500
Message-ID: <20011115124759.E31399@blackrider>
Affected files ...
.... //depot/perl/MANIFEST#620 edit
.... //depot/perl/t/run/switches.t#2 edit
.... //depot/perl/t/run/switchx.aux#1 add
.... //depot/perl/t/run/switchx.t#1 add
Differences ...
==== //depot/perl/MANIFEST#620 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST.~1~ Thu Nov 15 14:30:05 2001
+++ perl/MANIFEST Thu Nov 15 14:30:05 2001
@@ -2272,9 +2272,11 @@
t/run/kill_perl.t Tests that kill perl.
t/run/runenv.t Test if perl honors its environment variables.
t/run/noswitch.t Test aliasing ARGV for other switch tests
+t/run/switcha.t Test the -a switch
+t/run/switchn.t Test the -n switch
t/run/switchp.t Test the -p switch
-t/run/switchn.t Test the -n switch
-t/run/switcha.t Test the -a switch
+t/run/switchx.t Test the -x switch
+t/run/switchx.aux Data for switchx.t
t/run/switchF.t Test the -F switch
t/run/switches.t Tests for the other switches
t/TEST The regression tester
==== //depot/perl/t/run/switches.t#2 (text) ====
Index: perl/t/run/switches.t
--- perl/t/run/switches.t.~1~ Thu Nov 15 14:30:05 2001
+++ perl/t/run/switches.t Thu Nov 15 14:30:05 2001
@@ -9,7 +9,7 @@
require "./test.pl";
-plan(tests => 15);
+plan(tests => 14);
my $r;
my @tmpfiles = ();
@@ -159,24 +159,3 @@
is( $r, '<swtest><foo><bar>', '-m with import parameters' );
push @tmpfiles, $filename;
}
-
-# Tests for -x
-
-$filename = 'swxtest.tmp';
-SKIP: {
- open my $f, ">$filename" or skip( "Can't write temp file $filename: $!" );
- print $f <<'SWTEST';
-print 1;
-#!perl
-print 2;
-__END__
-print 3;
-SWTEST
- close $f;
- $r = runperl(
- switches => [ '-x' ],
- progfile => $filename,
- );
- is( $r, '2', '-x' );
- push @tmpfiles, $filename;
-}
==== //depot/perl/t/run/switchx.aux#1 (text) ====
Index: perl/t/run/switchx.aux
--- perl/t/run/switchx.aux.~1~ Thu Nov 15 14:30:05 2001
+++ perl/t/run/switchx.aux Thu Nov 15 14:30:05 2001
@@ -0,0 +1,21 @@
+Some stuff that's not Perl
+
+This CPP directive should not be read.
+#define BARMAR 1
+
+#perl
+
+Still not perl.
+
+#!
+
+still not perl
+
+#!/something/else
+
+still not perl
+
+#!/some/path/that/leads/to/perl -l
+
+print "1..1";
+print "ok 1";
==== //depot/perl/t/run/switchx.t#1 (text) ====
Index: perl/t/run/switchx.t
--- perl/t/run/switchx.t.~1~ Thu Nov 15 14:30:05 2001
+++ perl/t/run/switchx.t Thu Nov 15 14:30:05 2001
@@ -0,0 +1,10 @@
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+require './test.pl';
+
+print runperl( switches => ['-x'], progfile => 'run/switchx.aux' );
End of Patch.