[Interest] make check not working (macOS)

Thiago Macieira thiago.macieira at intel.com
Wed Jun 23 18:17:07 CEST 2021

On Wednesday, 23 June 2021 09:03:14 PDT Jason H wrote:
> So I have to manually maintain the modules being tested as a separate
> project? If so, that's pretty undesirable because of the manual effort to
> make sure that the test project is using the same source that the actual
> application uses. I hope I can automate that somehow? (Preferably requiring
> 0 maintenance)  I would not be opposed to a "tests" subdir to hold this
> project, but then, that needs it's own .pro, and it needs to automatically
> reference the parent project's files. Immediately I am thinking I can just
> use HEADERS/SOURCES files with ../ prefixes but that violates my
> 0-maintenance requirement.
> I want a brain-dead, simple, 0-maintenance test kit.  The only thing the
> developers should have to worry about is adding test implementations once
> it is started.
> Can this be achieved in Qt?

With Qt and QtTest, sure. But your question was "in qmake".

The answer is also yes. You need to move the common parts to a qmake project 
include file (.pri) and simply include() it in each and every target, then add 
to SOURCES the main executable for each program.

If build times are an issue, you may want to refactor so the common sources 
are built into a uninstalled static library, which you link into each test. 
However, using static libraries often bring headaches of their own, especially 
when C++ global statics with side-effects are involved.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering

More information about the Interest mailing list