Measure code coverage only when gcov option is given 09/228109/1 accepted/tizen/unified/20200323.172959 submit/tizen/20200319.070253 submit/tizen/20200319.110534 submit/tizen/20200320.175301 submit/tizen/20200323.014258
authorYunmi Ha <yunmi.ha@samsung.com>
Thu, 19 Mar 2020 06:18:42 +0000 (15:18 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Thu, 19 Mar 2020 06:21:52 +0000 (15:21 +0900)
Change-Id: I9b4e2abfbacfc96e51bdf4d4cd48dd32c1c699bf
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
Makefile.am
packaging/dlog.spec

index d69295b..0fabd6e 100644 (file)
@@ -290,7 +290,7 @@ check_PROGRAMS = \
        src/tests/salvage_pipe_entry \
        src/tests/filters
 
-check_CFLAGS = $(AM_CFLAGS) -O0 -fprofile-arcs -ftest-coverage -DUNIT_TEST \
+check_CFLAGS = $(AM_CFLAGS) -O0 -fprofile-arcs -DUNIT_TEST \
        -DEXIT_SKIP=77 -DEXIT_HARD_ERROR=99 # autotools convention exit codes
 
 TESTS = $(check_PROGRAMS) \
index ff8d9b3..8031281 100644 (file)
@@ -24,8 +24,8 @@ BuildRequires: libcap-devel
 BuildRequires: libtool
 BuildRequires: pkgconfig(capi-base-common)
 BuildRequires: pkgconfig(libtzplatform-config)
-BuildRequires: lcov
 %if 0%{?gcov:1}
+BuildRequires: lcov
 BuildRequires: zip
 %endif
 
@@ -158,7 +158,11 @@ make %{?jobs:-j%jobs} CFLAGS+='-D__DLOG_VERSION=\"%{version}\" -D__DLOG_RELEASE=
 
 # autoconf adds a bunch of flags, including -O2.
 # Clear those so that test coverage can be measured properly
+%if 0%{?gcov:1}
+make check CFLAGS='-Wno-gnu-variable-sized-type-not-at-end -Wno-logical-op-parentheses -ftest-coverage -D__DLOG_VERSION=\"%{version}\" -D__DLOG_RELEASE=\"%{release}\"'
+%else
 make check CFLAGS='-Wno-gnu-variable-sized-type-not-at-end -Wno-logical-op-parentheses -D__DLOG_VERSION=\"%{version}\" -D__DLOG_RELEASE=\"%{release}\"'
+%endif
 
 make dox