Draft: Add new ERROR test metric to allow testing for expected error conditions - Closes #261
This MR adds a new "ERROR" metric to the tester that enables testing for expected error conditions. This will enable the straightforward development of additional tests that also check that error paths in the code are correctly followed when expected.
An example is included, based on the IncNavierStokesSolver
test KovaFlow_m8
to check that an error is correctly raised with the expected error message when TimeIntegrationMethod
is not specified in the input file.
An example of how this can be used:
- Error tests must be created with only a single metric in the
.tst
file - There metric type must be set to
ERROR
- The
value
element has atype
attribute in which the error type must be specified (e.g.fatal
) - Part or all of the expected error message must be specified as the content of the
value
element.
e.g.
<metrics>
<metric type="ERROR" id="1">
<value type="fatal">TimeIntegrationMethod must be specified in the input file for an unsteady problem</value>
</metric>
</metrics>