# Basic: run the tests in t/perf/benchmarks against two or
# more perls
- bench.pl [options] perl1=[label1] perl2[=label2] ...
+ bench.pl [options] perl1[=label1] perl2[=label2] ...
# Run bench.pl's own built-in sanity tests
use Getopt::Long qw(:config no_auto_abbrev);
use IPC::Open2 ();
use IO::Select;
+use IO::File;
use POSIX ":sys_wait_h";
# The version of the file format used to save data. We refuse to process
# Validate the list of perl=label on the command line.
-# Also validate $OPTS{norm}, $OPTS{sort};
# Return a list of [ exe, label ] pairs.
sub process_perls {
die "Error: unable to execute '$perl': $r" if $r ne "ok\n";
push @results, [ $perl, $label ];
}
-
- $OPTS{norm} = select_a_perl($OPTS{norm}, \@results, "--norm");
- if (defined $OPTS{'sort-perl'}) {
- $OPTS{'sort-perl'} =
- select_a_perl($OPTS{'sort-perl'}, \@results, "--sort");
- }
-
return @results;
}
+
# Return a string containing perl test code wrapped in a loop
# that runs $ARGV[0] times
if defined $OPTS{bisect} and keys %$tests != 1;
$perls = [ process_perls(@$perl_args) ];
+
+
$results = grind_run($tests, $perls, $loop_counts);
}
+ # now that we have a list of perls, use it to process the
+ # 'perl' component of the --norm and --sort args
+
+ $OPTS{norm} = select_a_perl($OPTS{norm}, $perls, "--norm");
+ if (defined $OPTS{'sort-perl'}) {
+ $OPTS{'sort-perl'} =
+ select_a_perl($OPTS{'sort-perl'}, $perls, "--sort");
+ }
+
if (defined $OPTS{write}) {
my $json = JSON::PP::encode_json({
version => $FORMAT_VERSION,