Closed jonas-schulze closed 1 year ago
Doctest has nothing to do with the table output. Use title
to start a new table header: https://nanobench.ankerl.com/reference.html#_CPPv4N6ankerl9nanobench5Bench5titleEPKc
Got it. I thought that two separate Bench
objects would always render separate tables, but you only print a new table header if it would be different from the previous one. Smart.
https://github.com/martinus/nanobench/blob/a5a50c2/src/include/nanobench.h#L2335-L2349
I do like the current behavior, I was just afraid that this may be a bug showing through, but it's not. So I can continue using SUBCASE
s with nanobench
to share the test assertions. (I updated the original example.)
Consider the following example:
When running the benchmarks without any doctest filters, I would expect to separate tables (two table headers) to be printed. However, there is only one table:
This is particularly confusing for multiple
TEST_CASE
s that use the sameBench::name()
. Am I having a misconception about howdoctest
handles test setup and teardown, or about how or whennanobench
renders that table?