Upstream Test Mapping
Perl5 Test Suite
The perl5 source tree (perl5-upstream/t/) contains thousands of tests organized by category:
perl5-upstream/t/
base/ - Fundamental tests
cmd/ - Control flow
comp/ - Compilation
io/ - I/O operations
op/ - Operators
re/ - Regular expressions
run/ - Running perl
uni/ - Unicode
lib/ - Library/module tests
...
Mapping to PetaPerl Tests
PetaPerl’s test directories correspond to perl5-upstream categories, though the mapping is not 1:1:
| perl5-upstream | PetaPerl | Notes |
|---|---|---|
t/base/ | 00-base/ | Fundamental tests |
t/comp/ | 01-parsing/ | Compilation/parsing |
t/op/ | 05-op/ | Operators |
t/cmd/ | 10-cmd/ | Control flow |
t/io/ | 55-io/ | I/O operations |
t/re/ | 25-regex/ | Regular expressions |
t/uni/ | 22-unicode/ | Unicode handling |
t/lib/ | 70-core-tier*/ | Module tests |
Porting Process
When porting a test from perl5-upstream:
-
Convert to raw TAP: Remove
use Test::More,use test.pl, and other test framework dependencies. Replace with inlineoksub andprint "1..N\n"plan. -
Suffix with
-perl5.t: Indicates the test originated from perl5-upstream. -
Add source comment: Document where the test came from:
# Ported from perl5-upstream/t/op/arith.t -
Verify under both runtimes: Run with
t/TESTand confirm both perl5 and pperl produce identical output. -
Handle unsupported features: If the test uses features pperl doesn’t support, either:
- Skip those specific subtests with comments explaining why
- Split the test to separate supported from unsupported portions
re_tests
The regex engine has a specialized test suite based on perl5’s re_tests format. PetaPerl passes 1959/1972 tests (99.3% of perl5-passing tests). The 13 remaining failures are in:
- Self-referential captures (3 tests)
localin code blocks (2 tests)- Multi-character case folding (2 tests)
- Branch reset references (5 tests)
- String interpolation edge case (1 test)
Coverage Philosophy
PetaPerl does not aim to run the entire perl5 test suite verbatim. Instead:
- Port selectively: Focus on tests that cover features pperl implements
- Write new tests: For pperl-specific features (JIT, parallelization, daemon mode)
- Conformance over coverage: A smaller set of passing tests is better than a large set with many expected failures