diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2018-04-23 10:54:01 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2018-04-23 09:32:43 +0000 |
commit | 6ec2725aeb7351007473e1c9d4425c0ec0c3df85 (patch) | |
tree | 40261ba9385d547f18ce3ce277d6d76e03bb3b24 | |
parent | ca3c06d2b54b22ff4372a32ac5fcb1998cf09c38 (diff) |
Fix problems when building for test coverage
The coverage target needs to be available in all
Makefiles not just in debug configurations
Use qtLibraryTarget for all plugins in the
servicemanager autotest. This will automatically
add the needed postfixes for debug and release
plugins
Change-Id: I887e27ce1cc514d74cbaef97b02eeb935939a7cf
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
6 files changed, 13 insertions, 30 deletions
diff --git a/mkspecs/features/ivi-coverage.prf b/mkspecs/features/ivi-coverage.prf index b642b4a..27448b4 100644 --- a/mkspecs/features/ivi-coverage.prf +++ b/mkspecs/features/ivi-coverage.prf @@ -1,18 +1,16 @@ # generate code coverage information using gcov/lcov/genhtml -CONFIG(debug,debug|release) { - equals(TEMPLATE, "subdirs") { - sub-coverage.target = coverage - sub-coverage.CONFIG = recursive - QMAKE_EXTRA_TARGETS += sub-coverage - } else { - coverage_pre.commands += @echo && echo "Building with coverage support..." && echo $(eval CXXFLAGS += -O0 -fprofile-arcs -ftest-coverage)$(eval LFLAGS += -O0 -fprofile-arcs -ftest-coverage) +equals(TEMPLATE, "subdirs") { + sub-coverage.target = coverage + sub-coverage.CONFIG = recursive + QMAKE_EXTRA_TARGETS += sub-coverage +} else { + coverage_pre.commands += @echo && echo "Building with coverage support..." && echo $(eval CXXFLAGS += -O0 -fprofile-arcs -ftest-coverage)$(eval LFLAGS += -O0 -fprofile-arcs -ftest-coverage) - coverage.CONFIG += recursive - coverage.commands = @echo && echo "Finished building with coverage support." && echo - build_pass|!debug_and_release:coverage.depends = coverage_pre all + coverage.CONFIG += recursive + coverage.commands = @echo && echo "Finished building with coverage support." && echo + build_pass|!debug_and_release:coverage.depends = coverage_pre all - QMAKE_EXTRA_TARGETS *= coverage_pre coverage - } + QMAKE_EXTRA_TARGETS *= coverage_pre coverage } QMAKE_CLEAN += $(OBJECTS_DIR)/*.gcda $(OBJECTS_DIR)/*.gcno $(TARGET).gcov-info diff --git a/tests/auto/core/servicemanagertest/simple_plugin/simple_plugin.pro b/tests/auto/core/servicemanagertest/simple_plugin/simple_plugin.pro index 4a90447..fc7ce06 100644 --- a/tests/auto/core/servicemanagertest/simple_plugin/simple_plugin.pro +++ b/tests/auto/core/servicemanagertest/simple_plugin/simple_plugin.pro @@ -1,4 +1,4 @@ -TARGET = simple_plugin +TARGET = $$qtLibraryTarget(simple_plugin) DESTDIR = $$OUT_PWD/../qtivi/ TEMPLATE = lib CONFIG += plugin @@ -8,9 +8,6 @@ QT += core ivicore # because debug/release is decided at runtime. macos:qtConfig(framework) { CONFIG += debug_and_release build_all - build_pass:CONFIG(debug, debug|release) { - TARGET = $$join(TARGET,,,_debug) - } } SOURCES += simpleplugin.cpp \ diff --git a/tests/auto/core/servicemanagertest/simple_plugin_static/simple_plugin_static.pro b/tests/auto/core/servicemanagertest/simple_plugin_static/simple_plugin_static.pro index 21301c9..04c3853 100644 --- a/tests/auto/core/servicemanagertest/simple_plugin_static/simple_plugin_static.pro +++ b/tests/auto/core/servicemanagertest/simple_plugin_static/simple_plugin_static.pro @@ -8,9 +8,6 @@ QT += core ivicore # because debug/release is decided at runtime. macos:qtConfig(framework) { CONFIG += debug_and_release build_all - build_pass:CONFIG(debug, debug|release) { - TARGET = $$join(TARGET,,,_debug) - } } SOURCES += simplestaticplugin.cpp \ diff --git a/tests/auto/core/servicemanagertest/wrong_plugin/wrong_plugin.pro b/tests/auto/core/servicemanagertest/wrong_plugin/wrong_plugin.pro index 325f39d..262e17c 100644 --- a/tests/auto/core/servicemanagertest/wrong_plugin/wrong_plugin.pro +++ b/tests/auto/core/servicemanagertest/wrong_plugin/wrong_plugin.pro @@ -1,4 +1,4 @@ -TARGET = wrong_plugin +TARGET = $$qtLibraryTarget(wrong_plugin) DESTDIR = $$OUT_PWD/../qtivi/ TEMPLATE = lib CONFIG += plugin @@ -8,9 +8,6 @@ QT += core ivicore # because debug/release is decided at runtime. macos:qtConfig(framework) { CONFIG += debug_and_release build_all - build_pass:CONFIG(debug, debug|release) { - TARGET = $$join(TARGET,,,_debug) - } } SOURCES += wrongplugin.cpp \ diff --git a/tests/auto/core/servicemanagertest/wrongmetadata_plugin/wrongmetadata_plugin.pro b/tests/auto/core/servicemanagertest/wrongmetadata_plugin/wrongmetadata_plugin.pro index e57cf25..d14db95 100644 --- a/tests/auto/core/servicemanagertest/wrongmetadata_plugin/wrongmetadata_plugin.pro +++ b/tests/auto/core/servicemanagertest/wrongmetadata_plugin/wrongmetadata_plugin.pro @@ -1,4 +1,4 @@ -TARGET = wrongmetadata_plugin +TARGET = $$qtLibraryTarget(wrongmetadata_plugin) DESTDIR = $$OUT_PWD/../qtivi/ TEMPLATE = lib CONFIG += plugin @@ -8,9 +8,6 @@ QT += core ivicore # because debug/release is decided at runtime. macos:qtConfig(framework) { CONFIG += debug_and_release build_all - build_pass:CONFIG(debug, debug|release) { - TARGET = $$join(TARGET,,,_debug) - } } SOURCES += wrongmetadataplugin.cpp \ diff --git a/tests/auto/core/servicemanagertest/wrongmetadata_plugin_static/wrongmetadata_plugin_static.pro b/tests/auto/core/servicemanagertest/wrongmetadata_plugin_static/wrongmetadata_plugin_static.pro index a6b1ba9..238a67d 100644 --- a/tests/auto/core/servicemanagertest/wrongmetadata_plugin_static/wrongmetadata_plugin_static.pro +++ b/tests/auto/core/servicemanagertest/wrongmetadata_plugin_static/wrongmetadata_plugin_static.pro @@ -8,9 +8,6 @@ QT += core ivicore # because debug/release is decided at runtime. macos:qtConfig(framework) { CONFIG += debug_and_release build_all - build_pass:CONFIG(debug, debug|release) { - TARGET = $$join(TARGET,,,_debug) - } } SOURCES += wrongmetadatastaticplugin.cpp \ |