It took me ages but I finally found the single magical sentence in the Cabal documentation that explains how to test executables inside a cabal test suite without having to do weird shit like cabal exec -- cabal test
: https://cabal.readthedocs.io/en/3.4/cabal-package.html#pkg-field-build-tool-depends