This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
uniprops.t: split into 10 seperate test files t/re/uniprops01.t etc
authorYves Orton <demerphq@gmail.com>
Wed, 19 Oct 2016 07:52:01 +0000 (09:52 +0200)
committerYves Orton <demerphq@gmail.com>
Wed, 19 Oct 2016 11:27:59 +0000 (13:27 +0200)
This way we can run them at the same time under parallel test,
as there are a lot of tests (140k or so) this makes a difference.

14 files changed:
MANIFEST
charclass_invlists.h
lib/unicore/mktables
regcharclass.h
t/re/uniprops01.t [moved from t/re/uniprops.t with 98% similarity]
t/re/uniprops02.t [new file with mode: 0644]
t/re/uniprops03.t [new file with mode: 0644]
t/re/uniprops04.t [new file with mode: 0644]
t/re/uniprops05.t [new file with mode: 0644]
t/re/uniprops06.t [new file with mode: 0644]
t/re/uniprops07.t [new file with mode: 0644]
t/re/uniprops08.t [new file with mode: 0644]
t/re/uniprops09.t [new file with mode: 0644]
t/re/uniprops10.t [new file with mode: 0644]

index 0a895d7..710a81b 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -5713,7 +5713,16 @@ t/re/subst.t                     See if substitution works
 t/re/subst_amp.t               See if $&-related substitution works
 t/re/subst_wamp.t              See if substitution works with $& present
 t/re/substT.t                  See if substitution works with -T
-t/re/uniprops.t                        Test unicode \p{} regex constructs
+t/re/uniprops01.t              Test unicode \p{} regex constructs
+t/re/uniprops02.t              Test unicode \p{} regex constructs
+t/re/uniprops03.t              Test unicode \p{} regex constructs
+t/re/uniprops04.t              Test unicode \p{} regex constructs
+t/re/uniprops05.t              Test unicode \p{} regex constructs
+t/re/uniprops06.t              Test unicode \p{} regex constructs
+t/re/uniprops07.t              Test unicode \p{} regex constructs
+t/re/uniprops08.t              Test unicode \p{} regex constructs
+t/re/uniprops09.t              Test unicode \p{} regex constructs
+t/re/uniprops10.t              Test unicode \p{} regex constructs
 t/README                       Instructions for regression tests
 t/run/cloexec.t                        Test close-on-exec.
 t/run/dtrace.pl                        For dtrace.t
index 390e8a0..1613dda 100644 (file)
@@ -91558,7 +91558,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
- * 5c7eb94310e2aaa15702fd6bed24ff0e7ab5448f9a8231d8c49ca96c9e941089 lib/unicore/mktables
+ * 421444fcd83fcdfecffa743c8888c3a1a8e88bcde472a80fca57d199ec5db10a lib/unicore/mktables
  * cdecb300baad839a6f62791229f551a4fa33f3cbdca08e378dc976466354e778 lib/unicore/version
  * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl
  * 11011bc761487f5a63c8135e67248394d4cdff6f8f204a41cdfbdc8131e79406 regen/mk_invlists.pl
index d81fc63..e93cb4d 100644 (file)
@@ -18620,6 +18620,21 @@ sub make_property_test_script() {
     # or multiple lines. main::write doesn't count the lines.
     my @output;
 
+    push @output, <<'EOF_CODE';
+Error('\p{Script=InGreek}');    # Bug #69018
+Test_GCB("1100 $nobreak 1161");  # Bug #70940
+Expect(0, 0x2028, '\p{Print}', ""); # Bug # 71722
+Expect(0, 0x2029, '\p{Print}', ""); # Bug # 71722
+Expect(1, 0xFF10, '\p{XDigit}', ""); # Bug # 71726
+
+# Make sure this gets tested; it was not part of the official test suite at
+# the time this was added.  Note that this is as it would appear in the
+# official suite, and gets modified to check for the perl tailoring by
+# Test_WB()
+Test_WB("$breakable 0020 $breakable 0020 $breakable 0308 $breakable");
+Test_LB("$nobreak 200B $nobreak 0020 $nobreak 0020 $breakable 2060 $breakable");
+EOF_CODE
+
     # Sort these so get results in same order on different runs of this
     # program
     foreach my $property (sort { $a->has_dependency <=> $b->has_dependency
@@ -18808,17 +18823,38 @@ sub make_property_test_script() {
                              ? "\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;
+
+    my @output_chunked;
+    my $chunk_count=0;
+    my $chunk_size= int(@output/10)+1;
+    while (@output) {
+        $chunk_count++;
+        my @chunk= splice @output, 0, $chunk_size;
+        push @output_chunked,
+            "if (!\$::TESTCHUNK or \$::TESTCHUNK == $chunk_count){\n",
+            @chunk,
+            "}\n";
+    }
+
     &write($t_path,
            0,           # Not utf8;
            [$HEADER,
             $TODO_FAILING_BREAKS,
             <DATA>,
-            @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),
-            "Finished();\n"
+            @output_chunked,
+            "Finished();\n",
            ]);
 
     return;
@@ -20152,15 +20188,3 @@ sub Finished() {
     exit($Fails ? -1 : 0);
 }
 
-Error('\p{Script=InGreek}');    # Bug #69018
-Test_GCB("1100 $nobreak 1161");  # Bug #70940
-Expect(0, 0x2028, '\p{Print}', ""); # Bug # 71722
-Expect(0, 0x2029, '\p{Print}', ""); # Bug # 71722
-Expect(1, 0xFF10, '\p{XDigit}', ""); # Bug # 71726
-
-# Make sure this gets tested; it was not part of the official test suite at
-# the time this was added.  Note that this is as it would appear in the
-# official suite, and gets modified to check for the perl tailoring by
-# Test_WB()
-Test_WB("$breakable 0020 $breakable 0020 $breakable 0308 $breakable");
-Test_LB("$nobreak 200B $nobreak 0020 $nobreak 0020 $breakable 2060 $breakable");
index 6f5d14b..09857a7 100644 (file)
  * 37f6186253da9824bdb27f4ad867bfe8c25d4dc6bdb2f05585e40a034675a348 lib/unicore/extracted/DLineBreak.txt
  * ef24061b5a5dc93d7e90c2e34530ec757180ee75d872cba65ffc946e52624ae8 lib/unicore/extracted/DNumType.txt
  * a197371fec9a1b517058b440841f60f9378d81682084eef8db22a88cb2f96e90 lib/unicore/extracted/DNumValues.txt
- * 5c7eb94310e2aaa15702fd6bed24ff0e7ab5448f9a8231d8c49ca96c9e941089 lib/unicore/mktables
+ * 421444fcd83fcdfecffa743c8888c3a1a8e88bcde472a80fca57d199ec5db10a lib/unicore/mktables
  * cdecb300baad839a6f62791229f551a4fa33f3cbdca08e378dc976466354e778 lib/unicore/version
  * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl
  * 66e20f857451956f9fc7ad7432de972e84fb857885009838878bcf6f91ffbeef regen/regcharclass.pl
similarity index 98%
rename from t/re/uniprops.t
rename to t/re/uniprops01.t
index 5214c41..4b4231c 100644 (file)
@@ -23,6 +23,7 @@ if ($Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DEBUG_READONLY_COW\b/) {
     exit;
 }
 
+$::TESTCHUNK=1;
 do '../lib/unicore/TestProp.pl';
 
 # Since TestProp.pl explicitly exits, we will only get here if it
diff --git a/t/re/uniprops02.t b/t/re/uniprops02.t
new file mode 100644 (file)
index 0000000..8895ae9
--- /dev/null
@@ -0,0 +1,40 @@
+use strict;
+use warnings;
+no warnings 'once';
+
+if ($^O eq 'dec_osf') {
+    print "1..0 # $^O cannot handle this test\n";
+    exit(0);
+}
+
+# TODO: it would be good to have watchdog(5 * 60) in here
+# for slow machines, but unfortunately we cannot trivially
+# use test.pl because the TestProp.pl avoids using that.
+
+# This is a wrapper for a generated file.  Assumes being run from 't'
+# directory.
+
+# It is skipped by default under PERL_DEBUG_READONLY_COW, but you can run
+# it directly via:  cd t; ./perl -I../lib ../lib/unicore/TestProp.pl
+
+require Config;
+if ($Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DEBUG_READONLY_COW\b/) {
+    print "1..0 # Skip PERL_DEBUG_READONLY_COW\n";
+    exit;
+}
+
+$::TESTCHUNK=2;
+do '../lib/unicore/TestProp.pl';
+
+# Since TestProp.pl explicitly exits, we will only get here if it
+# could not load.
+if (defined &DynaLoader::boot_DynaLoader # not miniperl
+ || eval 'require "unicore/Heavy.pl"'    # or tables are built
+) {
+    die "Could not run lib/unicore/TestProp.pl: ", $@||$!;
+}
+else {
+    print "1..0 # Skip Unicode tables not built yet\n";
+}
+
+0
diff --git a/t/re/uniprops03.t b/t/re/uniprops03.t
new file mode 100644 (file)
index 0000000..c866407
--- /dev/null
@@ -0,0 +1,40 @@
+use strict;
+use warnings;
+no warnings 'once';
+
+if ($^O eq 'dec_osf') {
+    print "1..0 # $^O cannot handle this test\n";
+    exit(0);
+}
+
+# TODO: it would be good to have watchdog(5 * 60) in here
+# for slow machines, but unfortunately we cannot trivially
+# use test.pl because the TestProp.pl avoids using that.
+
+# This is a wrapper for a generated file.  Assumes being run from 't'
+# directory.
+
+# It is skipped by default under PERL_DEBUG_READONLY_COW, but you can run
+# it directly via:  cd t; ./perl -I../lib ../lib/unicore/TestProp.pl
+
+require Config;
+if ($Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DEBUG_READONLY_COW\b/) {
+    print "1..0 # Skip PERL_DEBUG_READONLY_COW\n";
+    exit;
+}
+
+$::TESTCHUNK=3;
+do '../lib/unicore/TestProp.pl';
+
+# Since TestProp.pl explicitly exits, we will only get here if it
+# could not load.
+if (defined &DynaLoader::boot_DynaLoader # not miniperl
+ || eval 'require "unicore/Heavy.pl"'    # or tables are built
+) {
+    die "Could not run lib/unicore/TestProp.pl: ", $@||$!;
+}
+else {
+    print "1..0 # Skip Unicode tables not built yet\n";
+}
+
+0
diff --git a/t/re/uniprops04.t b/t/re/uniprops04.t
new file mode 100644 (file)
index 0000000..7689df0
--- /dev/null
@@ -0,0 +1,40 @@
+use strict;
+use warnings;
+no warnings 'once';
+
+if ($^O eq 'dec_osf') {
+    print "1..0 # $^O cannot handle this test\n";
+    exit(0);
+}
+
+# TODO: it would be good to have watchdog(5 * 60) in here
+# for slow machines, but unfortunately we cannot trivially
+# use test.pl because the TestProp.pl avoids using that.
+
+# This is a wrapper for a generated file.  Assumes being run from 't'
+# directory.
+
+# It is skipped by default under PERL_DEBUG_READONLY_COW, but you can run
+# it directly via:  cd t; ./perl -I../lib ../lib/unicore/TestProp.pl
+
+require Config;
+if ($Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DEBUG_READONLY_COW\b/) {
+    print "1..0 # Skip PERL_DEBUG_READONLY_COW\n";
+    exit;
+}
+
+$::TESTCHUNK=4;
+do '../lib/unicore/TestProp.pl';
+
+# Since TestProp.pl explicitly exits, we will only get here if it
+# could not load.
+if (defined &DynaLoader::boot_DynaLoader # not miniperl
+ || eval 'require "unicore/Heavy.pl"'    # or tables are built
+) {
+    die "Could not run lib/unicore/TestProp.pl: ", $@||$!;
+}
+else {
+    print "1..0 # Skip Unicode tables not built yet\n";
+}
+
+0
diff --git a/t/re/uniprops05.t b/t/re/uniprops05.t
new file mode 100644 (file)
index 0000000..0573377
--- /dev/null
@@ -0,0 +1,40 @@
+use strict;
+use warnings;
+no warnings 'once';
+
+if ($^O eq 'dec_osf') {
+    print "1..0 # $^O cannot handle this test\n";
+    exit(0);
+}
+
+# TODO: it would be good to have watchdog(5 * 60) in here
+# for slow machines, but unfortunately we cannot trivially
+# use test.pl because the TestProp.pl avoids using that.
+
+# This is a wrapper for a generated file.  Assumes being run from 't'
+# directory.
+
+# It is skipped by default under PERL_DEBUG_READONLY_COW, but you can run
+# it directly via:  cd t; ./perl -I../lib ../lib/unicore/TestProp.pl
+
+require Config;
+if ($Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DEBUG_READONLY_COW\b/) {
+    print "1..0 # Skip PERL_DEBUG_READONLY_COW\n";
+    exit;
+}
+
+$::TESTCHUNK=5;
+do '../lib/unicore/TestProp.pl';
+
+# Since TestProp.pl explicitly exits, we will only get here if it
+# could not load.
+if (defined &DynaLoader::boot_DynaLoader # not miniperl
+ || eval 'require "unicore/Heavy.pl"'    # or tables are built
+) {
+    die "Could not run lib/unicore/TestProp.pl: ", $@||$!;
+}
+else {
+    print "1..0 # Skip Unicode tables not built yet\n";
+}
+
+0
diff --git a/t/re/uniprops06.t b/t/re/uniprops06.t
new file mode 100644 (file)
index 0000000..74e6c45
--- /dev/null
@@ -0,0 +1,40 @@
+use strict;
+use warnings;
+no warnings 'once';
+
+if ($^O eq 'dec_osf') {
+    print "1..0 # $^O cannot handle this test\n";
+    exit(0);
+}
+
+# TODO: it would be good to have watchdog(5 * 60) in here
+# for slow machines, but unfortunately we cannot trivially
+# use test.pl because the TestProp.pl avoids using that.
+
+# This is a wrapper for a generated file.  Assumes being run from 't'
+# directory.
+
+# It is skipped by default under PERL_DEBUG_READONLY_COW, but you can run
+# it directly via:  cd t; ./perl -I../lib ../lib/unicore/TestProp.pl
+
+require Config;
+if ($Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DEBUG_READONLY_COW\b/) {
+    print "1..0 # Skip PERL_DEBUG_READONLY_COW\n";
+    exit;
+}
+
+$::TESTCHUNK=6;
+do '../lib/unicore/TestProp.pl';
+
+# Since TestProp.pl explicitly exits, we will only get here if it
+# could not load.
+if (defined &DynaLoader::boot_DynaLoader # not miniperl
+ || eval 'require "unicore/Heavy.pl"'    # or tables are built
+) {
+    die "Could not run lib/unicore/TestProp.pl: ", $@||$!;
+}
+else {
+    print "1..0 # Skip Unicode tables not built yet\n";
+}
+
+0
diff --git a/t/re/uniprops07.t b/t/re/uniprops07.t
new file mode 100644 (file)
index 0000000..fe67954
--- /dev/null
@@ -0,0 +1,40 @@
+use strict;
+use warnings;
+no warnings 'once';
+
+if ($^O eq 'dec_osf') {
+    print "1..0 # $^O cannot handle this test\n";
+    exit(0);
+}
+
+# TODO: it would be good to have watchdog(5 * 60) in here
+# for slow machines, but unfortunately we cannot trivially
+# use test.pl because the TestProp.pl avoids using that.
+
+# This is a wrapper for a generated file.  Assumes being run from 't'
+# directory.
+
+# It is skipped by default under PERL_DEBUG_READONLY_COW, but you can run
+# it directly via:  cd t; ./perl -I../lib ../lib/unicore/TestProp.pl
+
+require Config;
+if ($Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DEBUG_READONLY_COW\b/) {
+    print "1..0 # Skip PERL_DEBUG_READONLY_COW\n";
+    exit;
+}
+
+$::TESTCHUNK=7;
+do '../lib/unicore/TestProp.pl';
+
+# Since TestProp.pl explicitly exits, we will only get here if it
+# could not load.
+if (defined &DynaLoader::boot_DynaLoader # not miniperl
+ || eval 'require "unicore/Heavy.pl"'    # or tables are built
+) {
+    die "Could not run lib/unicore/TestProp.pl: ", $@||$!;
+}
+else {
+    print "1..0 # Skip Unicode tables not built yet\n";
+}
+
+0
diff --git a/t/re/uniprops08.t b/t/re/uniprops08.t
new file mode 100644 (file)
index 0000000..a9b412a
--- /dev/null
@@ -0,0 +1,40 @@
+use strict;
+use warnings;
+no warnings 'once';
+
+if ($^O eq 'dec_osf') {
+    print "1..0 # $^O cannot handle this test\n";
+    exit(0);
+}
+
+# TODO: it would be good to have watchdog(5 * 60) in here
+# for slow machines, but unfortunately we cannot trivially
+# use test.pl because the TestProp.pl avoids using that.
+
+# This is a wrapper for a generated file.  Assumes being run from 't'
+# directory.
+
+# It is skipped by default under PERL_DEBUG_READONLY_COW, but you can run
+# it directly via:  cd t; ./perl -I../lib ../lib/unicore/TestProp.pl
+
+require Config;
+if ($Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DEBUG_READONLY_COW\b/) {
+    print "1..0 # Skip PERL_DEBUG_READONLY_COW\n";
+    exit;
+}
+
+$::TESTCHUNK=8;
+do '../lib/unicore/TestProp.pl';
+
+# Since TestProp.pl explicitly exits, we will only get here if it
+# could not load.
+if (defined &DynaLoader::boot_DynaLoader # not miniperl
+ || eval 'require "unicore/Heavy.pl"'    # or tables are built
+) {
+    die "Could not run lib/unicore/TestProp.pl: ", $@||$!;
+}
+else {
+    print "1..0 # Skip Unicode tables not built yet\n";
+}
+
+0
diff --git a/t/re/uniprops09.t b/t/re/uniprops09.t
new file mode 100644 (file)
index 0000000..c9b469b
--- /dev/null
@@ -0,0 +1,40 @@
+use strict;
+use warnings;
+no warnings 'once';
+
+if ($^O eq 'dec_osf') {
+    print "1..0 # $^O cannot handle this test\n";
+    exit(0);
+}
+
+# TODO: it would be good to have watchdog(5 * 60) in here
+# for slow machines, but unfortunately we cannot trivially
+# use test.pl because the TestProp.pl avoids using that.
+
+# This is a wrapper for a generated file.  Assumes being run from 't'
+# directory.
+
+# It is skipped by default under PERL_DEBUG_READONLY_COW, but you can run
+# it directly via:  cd t; ./perl -I../lib ../lib/unicore/TestProp.pl
+
+require Config;
+if ($Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DEBUG_READONLY_COW\b/) {
+    print "1..0 # Skip PERL_DEBUG_READONLY_COW\n";
+    exit;
+}
+
+$::TESTCHUNK=9;
+do '../lib/unicore/TestProp.pl';
+
+# Since TestProp.pl explicitly exits, we will only get here if it
+# could not load.
+if (defined &DynaLoader::boot_DynaLoader # not miniperl
+ || eval 'require "unicore/Heavy.pl"'    # or tables are built
+) {
+    die "Could not run lib/unicore/TestProp.pl: ", $@||$!;
+}
+else {
+    print "1..0 # Skip Unicode tables not built yet\n";
+}
+
+0
diff --git a/t/re/uniprops10.t b/t/re/uniprops10.t
new file mode 100644 (file)
index 0000000..0d0e1ed
--- /dev/null
@@ -0,0 +1,40 @@
+use strict;
+use warnings;
+no warnings 'once';
+
+if ($^O eq 'dec_osf') {
+    print "1..0 # $^O cannot handle this test\n";
+    exit(0);
+}
+
+# TODO: it would be good to have watchdog(5 * 60) in here
+# for slow machines, but unfortunately we cannot trivially
+# use test.pl because the TestProp.pl avoids using that.
+
+# This is a wrapper for a generated file.  Assumes being run from 't'
+# directory.
+
+# It is skipped by default under PERL_DEBUG_READONLY_COW, but you can run
+# it directly via:  cd t; ./perl -I../lib ../lib/unicore/TestProp.pl
+
+require Config;
+if ($Config::Config{ccflags} =~ /(?:^|\s)-DPERL_DEBUG_READONLY_COW\b/) {
+    print "1..0 # Skip PERL_DEBUG_READONLY_COW\n";
+    exit;
+}
+
+$::TESTCHUNK=10;
+do '../lib/unicore/TestProp.pl';
+
+# Since TestProp.pl explicitly exits, we will only get here if it
+# could not load.
+if (defined &DynaLoader::boot_DynaLoader # not miniperl
+ || eval 'require "unicore/Heavy.pl"'    # or tables are built
+) {
+    die "Could not run lib/unicore/TestProp.pl: ", $@||$!;
+}
+else {
+    print "1..0 # Skip Unicode tables not built yet\n";
+}
+
+0