Testing Infrastructure¶
FLINT includes a suite of standalone Fortran programs used for:
- Numerical verification
- Cross-validation against Cantera
- Performance benchmarking
- Regression testing during development
These programs are compiled as part of the standard build process and are located in the bin/test directory.
Testing Philosophy¶
FLINT testing follows three principles:
-
Numerical consistency
Native routines and Cantera-interface ones must reproduce reference solutions within defined tolerances. -
Backend consistency
Dedicated chemistry kernels, general routines, and optional Cantera interfaces must produce equivalent physical results. -
Regression stability
Changes to the codebase must not alter validated results unexpectedly.
Categories of Tests¶
1. Thermodynamic Verification¶
- Compares specific heat and thermodynamic properties
- Native implementation vs Cantera
- Checks relative error and execution time
Executable:
2. Chemical Source Terms¶
- Validates species production rates
- Explicit kernel vs Cantera net production rates
Executable:
3. Reactor Integration¶
- Constant-volume batch reactor
- Compares temperature evolution across:
- General chemistry routines
- Dedicated chemistry kernels
- Cantera backend (if enabled)
Executable:
4. Chemical Equilibrium¶
- Validates CEA-based equilibrium solver
- Compares equilibrium temperature and selected species
Executable:
Running the Test Suite¶
From the test directory:
Each test reports:
- Key computed quantities
- Reference values (if applicable)
- Success/failure verdict
Regression Strategy¶
Reference ("blessed") values are embedded in the test drivers. A test fails if:
- The solution is not finite
- Relative error exceeds defined tolerance
- Unexpected numerical behavior is detected
This ensures that modifications to:
- Thermodynamic routines
- Chemistry kernels
- Solver infrastructure
do not silently alter validated behavior.
Adding a New Test¶
To add a new regression test:
- Create a standalone Fortran driver.
- Load the required mechanism and data.
- Define reference values or comparison logic.
- Add success/failure criteria.
- Register the executable in the CMake configuration.
Tests should:
- Be deterministic
- Avoid unnecessary I/O
- Use clear tolerances
- Focus on a single capability
Continuous Integration (Optional)¶
When integrated into CI workflows, test executables can be run automatically after each build to ensure numerical stability across commits.