Closed tcbrindle closed 1 year ago
Patch coverage has no change and project coverage change: +0.01
:tada:
Comparison is base (
471dd38
) 97.70% compared to head (fa91d33
) 97.71%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Well, that was a complete waste of time.
It looks like GCC is perfectly capable of executing test_xxx<false>()
at compile-time and using that, even though we didn't explicitly ask for it.
Ah well, never mind.
Because almost the entire library is constexpr, the majority of our tests look like this:
That is, we do a constexpr test during compilation (which has the added benefit of testing for many guises of UB), and then again at runtime using Catch.
Unfortunately, compilers are getting increasingly smart at noticing that they've already calculated the result of
test_xxx()
, so they can optimise the run-time version to justREQUIRE(true)
, which isn't exactly in the spirit of what we want as it means we never actually execute the tests at runtime! It also means that the tested functions never show up in our code coverage measurements.As a workaround, this commit adds an otherwise-useless
template <bool = true>
to everytest_xxx()
function. Then in the runtime version we explicitly calltest_xxx<false>()
to force a separate instantation which should hopefully show up in CodeCov.This probably won't do wonders for our compile times, but we'll see...