Skip to content

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!

  1. https://bugs.launchpad.net/ubuntu/+source/libfido2/+bug/1864439
  2. https://github.com/Yubico/libfido2/commit/99a9be59b77fc9e6513a2953c222b44b0dbbe91e
  3. https://code.launchpad.net/~ahasenack/ubuntu/+source/libfido2/+git/libfido2/+merge/381126/comments/1000329

Merge request reports

Loading