summaryrefslogtreecommitdiff
path: root/runtests.pl
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-09-05 11:01:28 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-09-05 11:01:28 -0700
commit2e241165326031dd6f93d770c32eaa95a8dcfb4c (patch)
tree6c5f4e6098796b06a503c9e824ae0ae3c9c6c9b8 /runtests.pl
parentdb74dffd138bbe1e054b7bae4d8f5039d6c8844d (diff)
parent0a0cdcf1df12ef6a0dcdaf5d37894438aae50bc4 (diff)
Merge branch 'master' of github.com:jgm/stmd
Diffstat (limited to 'runtests.pl')
-rw-r--r--runtests.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/runtests.pl b/runtests.pl
index 5facbe6..2e2b795 100644
--- a/runtests.pl
+++ b/runtests.pl
@@ -5,13 +5,13 @@ use Term::ANSIColor;
use IO::Handle;
use IPC::Open2;
-my $usage="runtests.pl PROGRAM SPEC\nSet ANSI_COLORS_DISABLED=1 if you redirect to a file.\nSet PATT='...' to restrict tests to sections matching a regex.\n";
+my $usage="runtests.pl SPEC PROGRAM\nSet ANSI_COLORS_DISABLED=1 if you redirect to a file.\nSet PATT='...' to restrict tests to sections matching a regex.\n";
-my $PROG=$ARGV[0];
-my $SPEC=$ARGV[1];
+my $SPEC = shift @ARGV;
+my @PROG = @ARGV;
my $PATT=$ENV{'PATT'};
-if (!(defined $PROG && defined $SPEC)) {
+if (!(@PROG && defined $SPEC)) {
print STDERR $usage;
exit 1;
}
@@ -69,7 +69,7 @@ sub dotest
# We use → to indicate tab and ␣ space in the spec
$markdown =~ s/→/\t/g;s/␣/ /g;
$html =~ s/→/\t/g;s/␣/ /g;
- open2(my $out, my $in, $PROG);
+ open2(my $out, my $in, @PROG);
print $in $markdown;
close $in;
flush $out;