@@ -392,7 +392,7 @@ sub usage {
392
392
' norm=s' => \$OPTS {norm },
393
393
' perlargs=s' => \$OPTS {perlargs },
394
394
' raw' => \$OPTS {raw },
395
- ' read|r=s' => \$OPTS {read },
395
+ ' read|r=s@ ' => \$OPTS {read },
396
396
' show!' => \$OPTS {show },
397
397
' sort=s' => \$OPTS {sort },
398
398
' tests=s' => \$OPTS {tests },
@@ -679,25 +679,48 @@ sub do_grind {
679
679
if $bisect_min > $bisect_max ;
680
680
}
681
681
682
- if ( $OPTS {read }) {
683
- open my $in , ' <:encoding(UTF-8)' , $OPTS { read }
684
- or die " Error: can't open '$OPTS {read} ' for reading: $! \n " ;
682
+ foreach my $file (@{ $OPTS {read } }) {
683
+ open my $in , ' <:encoding(UTF-8)' , $file
684
+ or die " Error: can't open '$file ' for reading: $! \n " ;
685
685
my $data = do { local $/ ; <$in > };
686
686
close $in ;
687
687
688
688
my $hash = JSON::PP::decode_json($data );
689
689
if (int ($FORMAT_VERSION ) < int ($hash -> {version })) {
690
690
die " Error: unsupported version $hash ->{version} in file"
691
- . " '$OPTS {read} ' (too new)\n " ;
691
+ . " '$file ' (too new)\n " ;
692
692
}
693
- ( $loop_counts , $perls , $results , $tests , $order ) =
693
+ my ( $read_loop_counts , $read_perls , $read_results , $read_tests , $read_order ) =
694
694
@$hash {qw( loop_counts perls results tests order) };
695
+ filter_tests($read_results );
696
+ filter_tests($read_tests );
697
+ if (!$read_order ) {
698
+ $order = [ sort keys %$read_tests ];
699
+ }
700
+ if (!$loop_counts ) {
701
+ ($loop_counts , $perls , $results , $tests , $order ) =
702
+ ($read_loop_counts , $read_perls , $read_results , $read_tests , $read_order );
703
+ filter_tests($results );
704
+ filter_tests($tests );
705
+ if (!$order ) {
706
+ $order = [ sort keys %$tests ];
707
+ }
708
+ } else {
709
+ my @have_keys = sort keys %$read_tests ;
710
+ my @want_keys = sort keys %$tests ;
711
+
712
+ if (" @have_keys " ne " @want_keys " or
713
+ " @$read_loop_counts " ne " @$loop_counts " )
714
+ {
715
+ die " tests run aren't the same, cant merge read files" ;
716
+ }
695
717
696
- filter_tests($results );
697
- filter_tests($tests );
698
-
699
- if (!$order ) {
700
- $order = [ sort keys %$tests ];
718
+ push @$perls , @{$hash -> {perls }};
719
+ foreach my $test (keys %{$hash -> {results }}) {
720
+ foreach my $perl (keys %{$hash -> {results }{$test }}) {
721
+ $results -> {$test }{$perl }= $hash -> {results }{$test }{$perl };
722
+ }
723
+ }
701
724
}
702
725
}
703
726
0 commit comments