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
      QMAKE_CXXFLAGS += -DCOVCOV
    # other customization here ...
      message("coverage")
    }
    CONFIG(mock,coverage|mock) {
      DESTDIR = ./mock
      QMAKE_CXXFLAGS += -DMOCKMOCK
    # other customization here ...
      message("mock")
    

    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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.