summaryrefslogtreecommitdiff
path: root/t/run
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2001-11-15 07:47:59 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-15 21:16:57 +0000
commit77818208643949320ba57536d6c01e6973ff7a4a (patch)
tree69908f605f3529b281c649b65637aaaf537b5501 /t/run
parentb844f03e71077069122b6f1194667733997dd055 (diff)
downloadperl-77818208643949320ba57536d6c01e6973ff7a4a.tar.gz
-x (was Re: [PATCH] new tests for command-line switches)
Message-ID: <20011115124759.E31399@blackrider> p4raw-id: //depot/perl@13027
Diffstat (limited to 't/run')
-rw-r--r--t/run/switches.t23
-rw-r--r--t/run/switchx.aux21
-rw-r--r--t/run/switchx.t10
3 files changed, 32 insertions, 22 deletions
diff --git a/t/run/switches.t b/t/run/switches.t
index 2d6645de34..04b9630622 100644
--- a/t/run/switches.t
+++ b/t/run/switches.t
@@ -9,7 +9,7 @@ BEGIN {
require "./test.pl";
-plan(tests => 15);
+plan(tests => 14);
my $r;
my @tmpfiles = ();
@@ -159,24 +159,3 @@ SWTESTPM
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;
-}
diff --git a/t/run/switchx.aux b/t/run/switchx.aux
new file mode 100644
index 0000000000..576730c80a
--- /dev/null
+++ b/t/run/switchx.aux
@@ -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";
diff --git a/t/run/switchx.t b/t/run/switchx.t
new file mode 100644
index 0000000000..4676d1abf4
--- /dev/null
+++ b/t/run/switchx.t
@@ -0,0 +1,10 @@
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+require './test.pl';
+
+print runperl( switches => ['-x'], progfile => 'run/switchx.aux' );