'norm=s' => \$OPTS{norm},
'perlargs=s' => \$OPTS{perlargs},
'raw' => \$OPTS{raw},
- 'read|r=s' => \$OPTS{read},
+ 'read|r=s@' => \$OPTS{read},
'show!' => \$OPTS{show},
'sort=s' => \$OPTS{sort},
'tests=s' => \$OPTS{tests},
if $bisect_min > $bisect_max;
}
- if ($OPTS{read}) {
- open my $in, '<:encoding(UTF-8)', $OPTS{read}
- or die " Error: can't open '$OPTS{read}' for reading: $!\n";
+ foreach my $file (@{$OPTS{read}}) {
+ open my $in, '<:encoding(UTF-8)', $file
+ or die " Error: can't open '$file' for reading: $!\n";
my $data = do { local $/; <$in> };
close $in;
my $hash = JSON::PP::decode_json($data);
if (int($FORMAT_VERSION) < int($hash->{version})) {
die "Error: unsupported version $hash->{version} in file"
- . "'$OPTS{read}' (too new)\n";
+ . "'$file' (too new)\n";
}
- ($loop_counts, $perls, $results, $tests, $order) =
+ my ($read_loop_counts, $read_perls, $read_results, $read_tests, $read_order) =
@$hash{qw(loop_counts perls results tests order)};
+ filter_tests($read_results);
+ filter_tests($read_tests);
+ if (!$read_order) {
+ $order = [ sort keys %$read_tests ];
+ }
+ if (!$loop_counts) {
+ ($loop_counts, $perls, $results, $tests, $order) =
+ ($read_loop_counts, $read_perls, $read_results, $read_tests, $read_order);
+ filter_tests($results);
+ filter_tests($tests);
+ if (!$order) {
+ $order = [ sort keys %$tests ];
+ }
+ } else {
+ my @have_keys= sort keys %$read_tests;
+ my @want_keys= sort keys %$tests;
+
+ if ("@have_keys" ne "@want_keys" or
+ "@$read_loop_counts" ne "@$loop_counts")
+ {
+ die "tests run aren't the same, cant merge read files";
+ }
- filter_tests($results);
- filter_tests($tests);
-
- if (!$order) {
- $order = [ sort keys %$tests ];
+ push @$perls, @{$hash->{perls}};
+ foreach my $test (keys %{$hash->{results}}) {
+ foreach my $perl (keys %{$hash->{results}{$test}}) {
+ $results->{$test}{$perl}= $hash->{results}{$test}{$perl};
+ }
+ }
}
}