This is supported since debhelper 11.7. We enforce >= 12.1 as this is
the minimum version we are building against (from bionic 18.04
backports).
A few changes are required:
- The test step needs to be overriden as it requires a tests target
and we have a check target.
- The build directory has to be set because otherwise we can't override
the tests.
Also the build type is set explicitely to override debhelper defaults
(it sets to None which is invalid, and sets all the flags on
environment variables). This does not change the behavior but makes it
easier to reason about.