datatest-stable is a very simple test harness intended to meet some of the needs provided by
datatest crate when using a stable rust compiler without using the
to use nightly features on the stable track.
In order to setup data-driven tests for a particular test target you must do the following:
- Configure the test target by setting the following in the
name = "<test target name>"
harness = false
- Call the
datatest_stable::harness!(testfn, root, pattern) macro with the following
testfn - The test function to be executed on each matching input. This function must have
fn(&Path) -> datatest_stable::Result<()>
root - The path to the root directory where the input files live. This path is relative to
the root of the crate.
pattern - the regex used to match against and select each file to be tested.
The three parameters can be repeated if you have multiple sets of data-driven tests to be run:
datatest_stable::harness!(testfn1, root1, pattern1, testfn2, root2, pattern2)
datatest-stable test harness entry point. Should be declared in the test module.