(Build) Ensure branch coverage is collected for later versions of lcov
[platform/core/uifw/dali-adaptor.git] / build / tizen / Makefile.am
1 #
2 # Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 SUBDIRS = adaptor
18
19 if ! LITE_PROFILE
20 if ! WEARABLE_PROFILE
21 if ! UBUNTU_PROFILE
22 SUBDIRS += plugins
23 endif
24 endif
25 endif
26
27 pkgconfigdir = $(libdir)/pkgconfig
28 pkgconfig_DATA = dali.pc
29
30 MAINTAINERCLEANFILES = \
31     aclocal.m4 \
32     autom4te.cache \
33     config.guess \
34     config.sub \
35     configure \
36     depcomp \
37     install-sh \
38     ltmain.sh \
39     missing \
40     `find "$(srcdir)" -type f -name Makefile.in -print` \
41     `find . \( -name "*.gcov" -o -name "*.gcno" -o -name "*.gcda" \) -print`
42
43 CLEANFILES = \
44         `find . \( -name "*.gcov" -o -name "*.gcno" -o -name "*.gcda" \) -print`
45
46 COVERAGE_DIR=.cov
47 COVERAGE_OUTPUT_DIR=doc/coverage
48
49 # From lcov version 1.10 onwards, branch coverage is off by default and earlier versions do not support the rc option
50 LCOV_OPTS=`if [ \`printf "\\\`lcov --version | cut -d' ' -f4\\\`\n1.10\n" | sort -V | head -n 1\` = 1.10 ] ; then echo "--rc lcov_branch_coverage=1" ; fi`
51
52 cov_data:
53         @test -z $(COVERAGE_DIR) || mkdir -p $(COVERAGE_DIR)
54         @rm -f $(COVERAGE_DIR)/*
55         @-cp adaptor/.libs/*.gcda adaptor/.libs/*.gcno  $(COVERAGE_DIR)
56         @for i in `find $(COVERAGE_DIR) -name "libdali_adaptor_la-*.gcda" -o -name "libdali_adaptor_la-*.gcno"` ;\
57                 do mv $$i `echo $$i | sed s/libdali_adaptor_la-//` ; echo $$i ; done
58         @cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --base-directory . --directory . -c -o dali.info
59         @cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --remove dali.info "*boost*" "dali-env/*" "/usr/include/*" -o dali.info
60         @test -z $(COVERAGE_OUTPUT_DIR) || mkdir -p $(COVERAGE_OUTPUT_DIR)
61
62 coverage: cov_data
63         @genhtml $(LCOV_OPTS) -o $(COVERAGE_OUTPUT_DIR) $(COVERAGE_DIR)/dali.info
64
65 reset_coverage:
66         @lcov -z --directory `pwd`