Make zip with coverage report 67/245167/1
authorKonrad Kuchciak <k.kuchciak@samsung.com>
Mon, 5 Oct 2020 05:11:19 +0000 (07:11 +0200)
committerKonrad Kuchciak <k.kuchciak@samsung.com>
Mon, 5 Oct 2020 05:13:25 +0000 (07:13 +0200)
Change-Id: I522f8104c2802e1a475d0eef5cdb3909f50f0ba6
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
packaging/diagnostics.spec
src/test/CMakeLists.txt

index 7e621d4..dfd4865 100644 (file)
@@ -16,6 +16,7 @@ BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  glib2-devel
 %if 0%{?gcov:1}
 BuildRequires:  lcov
+BuildRequires:  zip
 %else
 %define gcov 0
 %endif
index 94dfb75..35fd835 100644 (file)
@@ -35,6 +35,7 @@ function(setup_coverage_target)
        find_program(GCOV_PATH gcov)
        find_program(LCOV_PATH  NAMES lcov)
        find_program(GENHTML_PATH NAMES genhtml)
+       find_program(ZIP_PATH NAMES zip)
 
        if(NOT GCOV_PATH)
                message(FATAL_ERROR "gcov not found! Aborting...")
@@ -63,16 +64,12 @@ function(setup_coverage_target)
 
        # Setup target
        add_custom_target(${COV_NAME}
-
                COMMAND ${LCOV_PATH} ${COV_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory . -b ${BASEDIR} --zerocounters
-
                COMMAND ${COV_EXECUTABLE} ${COV_EXECUTABLE_ARGS}
-
                COMMAND ${LCOV_PATH} ${COV_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . -b ${BASEDIR} --capture --output-file ${COV_NAME}.total
-
                COMMAND ${LCOV_PATH} ${COV_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove ${COV_NAME}.total ${LCOV_EXCLUDES} --output-file ${COV_NAME}.info
-
                COMMAND ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${COV_GENHTML_ARGS} -o ${COV_NAME} ${COV_NAME}.info
+               COMMAND ${ZIP_PATH} -r ${target}.zip ${COV_NAME}
 
                BYPRODUCTS
                        ${COV_NAME}.total