This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Balance uniprops tests
authorKarl Williamson <khw@cpan.org>
Mon, 20 Feb 2017 05:03:27 +0000 (22:03 -0700)
committerKarl Williamson <khw@cpan.org>
Mon, 20 Feb 2017 05:45:00 +0000 (22:45 -0700)
Commit 5656b1f654bb034c561558968ed3cf87a737b3e1 split the tests
generated by mktables so that 10 separate files each execute 10% of the
tests.  But it turns out that some tests are much more involved than
others, so that some of those 10 files still took much longer than
average.  This commit changes the split so that the amount of time each
file takes is more balanced.  It uses a natural breaking spot for the
tests for the \b{} flavors, except that GCB and SB are each short (so
are combined into being tested from one file), and LB is very long, so
is split into 4 test groups.

charclass_invlists.h
lib/unicore/mktables
regcharclass.h

index 732b6d0..7b5b7ea 100644 (file)
@@ -95407,7 +95407,7 @@ static const U8 WB_table[24][24] = {
  * 37f6186253da9824bdb27f4ad867bfe8c25d4dc6bdb2f05585e40a034675a348 lib/unicore/extracted/DLineBreak.txt
  * ef24061b5a5dc93d7e90c2e34530ec757180ee75d872cba65ffc946e52624ae8 lib/unicore/extracted/DNumType.txt
  * a197371fec9a1b517058b440841f60f9378d81682084eef8db22a88cb2f96e90 lib/unicore/extracted/DNumValues.txt
- * 4bcfb4545be21663ca38a2acbfcbf2b0f3252652a34b50f1a56ef76cb959861b lib/unicore/mktables
+ * 79a7216aceb1d291f2857085545fdda289518bc540a09bc0a15cde105d76028d lib/unicore/mktables
  * cdecb300baad839a6f62791229f551a4fa33f3cbdca08e378dc976466354e778 lib/unicore/version
  * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl
  * 9534d0cc3914fa1f5d574332c3199605c3d14f8691a0729d68d8498ac2b36280 regen/mk_invlists.pl
index 5424617..e3336f5 100644 (file)
@@ -18835,31 +18835,56 @@ EOF_CODE
                              ? "\nsub TODO_FAILING_BREAKS { 1 }\n"
                              : "\nsub TODO_FAILING_BREAKS { 0 }\n";
 
-
-    push @output,
-            (map {"Test_GCB('$_');\n"} @backslash_X_tests),
-            (map {"Test_LB('$_');\n"} @LB_tests),
-            (map {"Test_SB('$_');\n"} @SB_tests),
-            (map {"Test_WB('$_');\n"} @WB_tests);
-
     @output= map {
         map s/^/    /mgr,
         map "$_;\n",
         split /;\n/, $_
     } @output;
 
+    # Cause there to be 'if' statements to only execute a portion of this
+    # long-running test each time, so that we can have a bunch of .t's running
+    # in parallel
+    my $chunks = 10     # Number of test files
+               - 1      # For GCB & SB
+               - 1      # For WB
+               - 4;     # LB split into this many files
     my @output_chunked;
     my $chunk_count=0;
-    my $chunk_size= int(@output/10)+1;
+    my $chunk_size= int(@output / $chunks) + 1;
     while (@output) {
         $chunk_count++;
         my @chunk= splice @output, 0, $chunk_size;
         push @output_chunked,
-            "if (!\$::TESTCHUNK or \$::TESTCHUNK == $chunk_count){\n",
-            @chunk,
+            "if (!\$::TESTCHUNK or \$::TESTCHUNK == $chunk_count) {\n",
+                @chunk,
+            "}\n";
+    }
+
+    $chunk_count++;
+    push @output_chunked,
+        "if (!\$::TESTCHUNK or \$::TESTCHUNK == $chunk_count) {\n",
+            (map {"    Test_GCB('$_');\n"} @backslash_X_tests),
+            (map {"    Test_SB('$_');\n"} @SB_tests),
+        "}\n";
+
+
+    $chunk_size= int(@LB_tests / 4) + 1;
+    @LB_tests = map {"    Test_LB('$_');\n"} @LB_tests;
+    while (@LB_tests) {
+        $chunk_count++;
+        my @chunk= splice @LB_tests, 0, $chunk_size;
+        push @output_chunked,
+            "if (!\$::TESTCHUNK or \$::TESTCHUNK == $chunk_count) {\n",
+                @chunk,
             "}\n";
     }
 
+    $chunk_count++;
+    push @output_chunked,
+        "if (!\$::TESTCHUNK or \$::TESTCHUNK == $chunk_count) {\n",
+            (map {"    Test_WB('$_');\n"} @WB_tests),
+        "}\n";
+
     &write($t_path,
            0,           # Not utf8;
            [$HEADER,
index 4be75bc..f66d147 100644 (file)
  * 37f6186253da9824bdb27f4ad867bfe8c25d4dc6bdb2f05585e40a034675a348 lib/unicore/extracted/DLineBreak.txt
  * ef24061b5a5dc93d7e90c2e34530ec757180ee75d872cba65ffc946e52624ae8 lib/unicore/extracted/DNumType.txt
  * a197371fec9a1b517058b440841f60f9378d81682084eef8db22a88cb2f96e90 lib/unicore/extracted/DNumValues.txt
- * 4bcfb4545be21663ca38a2acbfcbf2b0f3252652a34b50f1a56ef76cb959861b lib/unicore/mktables
+ * 79a7216aceb1d291f2857085545fdda289518bc540a09bc0a15cde105d76028d lib/unicore/mktables
  * cdecb300baad839a6f62791229f551a4fa33f3cbdca08e378dc976466354e778 lib/unicore/version
  * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl
  * 1d27ae8b75d81a082b1fc594673e08540280f8169309a7b5047015c8091a2bfb regen/regcharclass.pl