Run regression tests at build time
In Ubuntu we recently[1] went through the exercise of bringing libfido2 into main. One requirement from the security team was that we somehow changed the package to run tests, either at build time, and/or as dep8.
The existing regress/ tests only run when the build type is set to Debug[2], so I used a somewhat weird approach to override dh_auto_test and do a test-only rebuild there.
But there's more. These regress/ tests are very much invisible. Looking at the build output, there is no indication that any test was run. They are only very verbose when they fail (you get a core dump due to an assertion failure). To be on the safe side, and be sure the tests did run, I added another run with an injected failure, and verify that the failure indeed happens.
This was a bit controversial[3], but got accepted for Ubuntu in the end, and is what I'm submitting here for your appreciation.
Cheers!