From 883f117643e91d213451f5aebde765e67d2706aa Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Wed, 3 Sep 2014 23:47:28 -0500 Subject: runtests.pl: switch the order of arguments Putting the spec file first lets us consume all the other arguments as the program to run. This makes it easier to use complex commands to run the tests. --- runtests.pl | 10 +++++----- 1 file 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; -- cgit v1.2.3