Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DynamicCastRework, Part 2: Test Suite
This validation test exercises a large matrix of types and invariants for dynamic casting. It's formulated as a Python script that emits a number of Swift test programs, compiles, and executes them. The programs are compiled in Swift 4 and 5 mode, with -O and -Onone. The invariants used by these tests follow the specification presented in PR swiftlang#33010. It should be easy to add more as desired. I've tried to design this in such a way that CI logs can provide enough information to narrowly identify the problem area: Separate test cases are generated for each invariant and each type (in particular, this helps with compiler crashes that report the full body of the function in question). The files and test suites are named to identify the optimization mode. The goal of this test suite is to cover a broad cross-section of casting capabilities and combinations, and to make it easy to expand the matrix of combinations. New invariants can easily be added and applied to many types; as new types are added to this test, they can exploit the existing invariants and be exercised across all optimization modes.
- Loading branch information