Building a test framework in Fortran by progressively refactoring test code. Starts by extracting tests into separate procedures, then moves them to dedicated test modules. Introduces procedure pointers and derived types to create arrays of tests, enabling a generalized test runner loop. Implements a test suite pattern using abstract interfaces and factory functions to collect tests from multiple modules. Demonstrates advanced Fortran features like procedure pointers as data components, the nopass attribute, and how private procedures can be exposed through pointers.
Table of contents
Moving tests to their own proceduresMoving tests to their own modulesGeneralizing the test programCollecting unit tests from multiple test modulesCould the test framework discover all test modules and test procedures automatically?Sort: