0

for a given qmake project:

CONFIG += debug
CPPUTEST_HOME = /Users/vodde/workspace/cpputest

TEMPLATE = app
TARGET = design_patterns_qmake 
DEPENDPATH += .
INCLUDEPATH += (CPPUTEST_HOME)/include
CONFIG += qt
CONFIG += x11
CONFIG += cpputest
QMAKE_CXXFLAGS_DEBUG += -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorNewMacros.h
QMAKE_CXXFLAGS_DEBUG += -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorMallocMacros.h

# Input
SOURCES += factorial.cpp
SOURCES += testdriver.cpp
SOURCES += tests.cpp

how can I configure the project file to include the test driver, and test file so that only when the debug flag is raised it will include the test source files?

peter_gent
  • 175
  • 2
  • 4
  • 17

2 Answers2

1

Wrap them into debug:

debug {
    SOURCES += testdriver.cpp
    SOURCES += tests.cpp
}
svlasov
  • 9,923
  • 2
  • 38
  • 39
0

Solution:

######################################################################
# Automatically generated by qmake (2.01a) Thu Mar 12 14:32:44 2015
######################################################################
CPPUTEST_HOME =  <cpputest path here>
CONFIG += qt debug
TEMPLATE = app
TARGET =a.out 
DEPENDPATH += .
INCLUDEPATH += -I $$(CPPUTEST_HOME)/include
CONFIG += qt
CONFIG -= app_bundle 
LIBS += -L $$(CPPUTEST_HOME)/lib -lCppUTest -lCppUTestExt

# Input
SOURCES += factorial.cpp
SOURCES +=factorial_test.cpp
peter_gent
  • 175
  • 2
  • 4
  • 17