Qt World Summit: Register Today!

Custom build modes (coverage and mock)

  • Hi,

    I need to build my application in different modes, debug release and also "custom build modes", one with code coverage instrumentation and the other with some mocked objects.

    Ideally I'd like to have coverage and mock modes so that I could just call make coverage or make mock similar to standard make debug or make release available with default .
    I tried to play with different options and configs in my .pro file but could not get the desired output.

    I tried with the following commands in my .pro file

    addExclusiveBuilds(coverage, mock)
    CONFIG += coverage_and_mock
    CONFIG += coverage_and_mock_target
    CONFIG(coverage,coverage|mock) {
      DESTDIR = ./coverage
    # other customization here ...
    CONFIG(mock,coverage|mock) {
      DESTDIR = ./mock
    # other customization here ...

    Any hint on how to configure my project file so that qmake will generate Makefile.Debug, Makefile.Release, Makefile.Coverage and Makefile.Mock and the top-level Makefile calling the right sub-Makefile ?

    Note: I'm using latest Qt 5.5.1 release on a Linux host.

Log in to reply