[FYI] {micro} maint: make output of 'gen-testsuite-part' deterministic

Stefano Lattarini <[email protected]>
Newsgroups gmane.comp.sysutils.automake.patches
Message-ID <cfc6916ef499014b71e874924f1077e8c0604f89.1419251901.git.stefano.lattarini@gmail.com>
So that diffs displayed by the 'compare-autodiffs' target are
less spurious and more useful.

* gen-testsuite-part: Sort keys of %deps_extractor, %wrapper_setups
and %depmodes before iterating on them.

Signed-off-by: Stefano Lattarini <[email protected]>
---
 gen-testsuite-part | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gen-testsuite-part b/gen-testsuite-part
index 3bd5c9f..32158ba 100755
--- a/gen-testsuite-part
+++ b/gen-testsuite-part
@@ -297,8 +297,9 @@ foreach my $test (@all_tests)
     $wrapper_setups{$test} = \@setups if @setups;
   }
 # And now create all the wrapper tests.
-while (my ($wrapped_test, $setup_list) = each %wrapper_setups)
+for my $wrapped_test (sort keys %wrapper_setups)
   {
+    my $setup_list = $wrapper_setups{$wrapped_test};
     (my $base = $wrapped_test) =~ s/\.([^.]*)$//;
     my $suf = $1 or die "$me: test '$wrapped_test' lacks a suffix\n";
     my $count = 0;
@@ -359,7 +360,7 @@ my %depmodes =
 
 foreach my $lt (TRUE, FALSE)
   {
-    foreach my $m (keys %depmodes)
+    foreach my $m (sort keys %depmodes)
       {
         my $planned = ($lt && $m eq "auto") ? 84 : 28;
         my @required =
@@ -414,8 +415,9 @@ print <<EOF;
 
 EOF
 
-while (my ($k, $x) = each %deps_extractor)
+for my $k (sort keys %deps_extractor)
   {
+    my $x = $deps_extractor{$k};
     my $dist_prereqs = $x->{dist_prereqs} || "";
     my $nodist_prereqs = $x->{nodist_prereqs} || "";
     my @tests = grep { line_match $x->{line_matcher}, $_ } @all_tests;
-- 
2.1.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.