summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-01-16 16:39:37 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-01-16 16:39:37 +0100
commitef8f767f0cfb558b75d5b2533c57c97b050a7830 (patch)
treeea36f812e923e526c10bdbcf77f8f1e05814370d /configure.ac
parentf176c1589ccfc518858978a7f08735db7911b130 (diff)
tests: add coverage support.
And our current score is 19% functions coverage for Elementary.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac50
1 files changed, 45 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 5804d6b7a..5b075e870 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,10 +39,32 @@ AC_ARG_ENABLE([cxx-bindings],
39# Tests 39# Tests
40 40
41AC_ARG_WITH([tests], 41AC_ARG_WITH([tests],
42 [AS_HELP_STRING([--with-tests=none|regular], 42 [AS_HELP_STRING([--with-tests=none|regular|coverate],
43 [choose elementary testing method: regular or none.(coverage will be supported)@<:@default=none@:>@])], 43 [choose elementary testing method: regular, coverage or none @<:@default=none@:>@])],
44 [build_tests=${withval}], 44 [build_tests=${withval}],
45 [build_tests=none]) 45 [build_tests=auto])
46
47want_coverage="no"
48want_tests="no"
49case "${build_tests}" in
50 auto)
51 if test "${build_profile}" = "dev"; then
52 want_tests="yes"
53 fi
54 ;;
55 regular)
56 want_tests="yes"
57 ;;
58 coverage)
59 want_tests="yes"
60 want_coverage="yes"
61 ;;
62 no*)
63 ;;
64 *)
65 AC_MSG_ERROR([Unknown build tests option: --with-tests=${build_tests}])
66 ;;
67esac
46 68
47# Elementary base dir 69# Elementary base dir
48 70
@@ -336,10 +358,28 @@ ELEMENTARY_PC_LIBS="${ELEMENTARY_PC_LIBS} ${requirement_elm_libs}"
336AC_SUBST([requirement_elm_pc]) 358AC_SUBST([requirement_elm_pc])
337 359
338# check unit testing library 360# check unit testing library
339if test "${build_tests}" = "regular"; then 361if test "${want_tests}" = "yes"; then
340 PKG_CHECK_MODULES([CHECK], [check >= 0.9.5]) 362 PKG_CHECK_MODULES([CHECK], [check >= 0.9.5])
341fi 363fi
342AM_CONDITIONAL([ENABLE_ELEMENTARY_TESTS], [test "${build_tests}" = "regular"]) 364AM_CONDITIONAL([ELEMENTARY_ENABLE_TESTS], [test "${want_tests}" = "yes"])
365
366# lcov
367if test "${want_coverage}" = "yes" ; then
368 AC_CHECK_PROG([have_lcov], [lcov], [yes], [no])
369 if test "x${have_lcov}" = "xyes" ; then
370 ELEMENTARY_CFLAGS="${ELEMENTARY_CFLAGS} -fprofile-arcs -ftest-coverage"
371 ELEMENTARY_LIBS="${ELEMENTARY_LIBS} -lgcov"
372 if test "x${prefer_assert}" = "xno"; then
373 ELEMENTARY_CFLAGS="${ELEMENTARY_CFLAGS} -DNDEBUG"
374 else
375 ELEMENTARY_CFLAGS="${ELEMENTARY_CFLAGS} -g -O0 -DDEBUG"
376 fi
377 else
378 AC_MSG_ERROR([lcov is not found])
379 fi
380fi
381
382AM_CONDITIONAL([ELEMENTARY_ENABLE_COVERAGE], [test "${want_coverage}" = "yes"])
343 383
344 384
345### Checks for header files 385### Checks for header files