To start moving towards using a TAP (Test Anything Protocol) [0],
add a TestStatus class and enumerations for our current test return
valuese.
The TestStatus class is subclassed to provide each return status value
and is currently set as:
TestStatusFail,
TestStatusSkip,
TestStatusPass,
To prevent collision with the existing TestFail, TestSkip, TestPass.
If this series progresses and is accepted, I would prefer to use our
current names (TestPass, not TestStatusPass) and would thus rename the
TestStatus subclasses.
Anyway, the goal is that every test status should have a description
along with it's status so that a reason for any fail or skip can be
recorded.
Two helpers are shown "is()" and "isnt()" based on the naming from libtap++ [1]
I'm not tied to these names, they were just a starting point for adding
'value check' tests.
[0] https://testanything.org/
[1] https://github.com/cbab/libtappp
Kieran Bingham (2):
test: Add TestStatus classes
test: Provide TestStatus validation tests
test/libtest/meson.build | 1 +
test/libtest/test.h | 2 ++
test/libtest/test_status.cpp | 42 +++++++++++++++++++++++++++
test/libtest/test_status.h | 55 ++++++++++++++++++++++++++++++++++++
test/meson.build | 1 +
test/test_status.cpp | 52 ++++++++++++++++++++++++++++++++++
6 files changed, 153 insertions(+)
create mode 100644 test/libtest/test_status.cpp
create mode 100644 test/libtest/test_status.h
create mode 100644 test/test_status.cpp