wide-integer
wide-integer copied to clipboard
Split tests into many individual tests each with `main()`
From #130 we find out that, the tests aren't very easy to use.
There is one single huge result in a single program.
The purpose of this issue is to attempt to find a sensible way to split wide-integer's tests into many individual tests with each having independent main() functions thereby allowing for their running in parallel
Suggestion:
- Start by breaking up the target, test_uintwide_t, in test/unit/_impl/wide-integer.cpp each one target per source file.
- Invoke the tests with
ctest --output-on-failure --parallel 8to run 8 at a time. - Use
assertto test each assumption: it prints a decent diagnostic message with very terse code. - Or consider using a testing framework like Catch2 or GTest to generate the test cases so that you don't need to write a
mainfunction for each .cpp. - When there are multiple assertions in a test, consider breaking into multiple tests within the same source file.
Start by breaking up the target,
test_uintwide_t, ...
Indeed. That is sound advice @johnmcfarlane. My priority at the moment is that you can move forward and all present client code remains un-broken. But I'll definitely look into your suggestions as the project rolls forward.
Thankis John!
At the moment, with the runners on GHA, I'm happy with the testing. I'll close this issue but if anything changes, reconsider then.
Cc: @johnmcfarlane