diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-04-26 14:40:41 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-04-26 14:40:41 -0500 |
commit | f938ab5bbbb669c2c65d5f83d4a21e91f69ba5d4 (patch) | |
tree | 8d7ef584f1ca335292c8e322cbbcefb3941a7871 | |
parent | b4f82a39f26fae8c72f02d717141df87bc866058 (diff) | |
parent | 56a4d5f27d805247eb44f29e2d644353cd4f5f15 (diff) | |
download | ayatana-indicator-messages-f938ab5bbbb669c2c65d5f83d4a21e91f69ba5d4.tar.gz ayatana-indicator-messages-f938ab5bbbb669c2c65d5f83d4a21e91f69ba5d4.tar.bz2 ayatana-indicator-messages-f938ab5bbbb669c2c65d5f83d4a21e91f69ba5d4.zip |
merge lp:~allanlesage/indicator-messages/TDD to add Google Test autoconf rules
-rw-r--r-- | Makefile.am.coverage | 12 | ||||
-rw-r--r-- | configure.ac | 26 |
2 files changed, 23 insertions, 15 deletions
diff --git a/Makefile.am.coverage b/Makefile.am.coverage index 9c59b95..fb97747 100644 --- a/Makefile.am.coverage +++ b/Makefile.am.coverage @@ -1,14 +1,18 @@ # Coverage targets -.PHONY: clean-gcda \ +.PHONY: clean-gcno clean-gcda \ coverage-html generate-coverage-html clean-coverage-html \ coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr -clean-local: clean-coverage-html clean-coverage-gcovr +clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr if HAVE_GCOV +clean-gcno: + @echo Removing old coverage instrumentation + -find -name '*.gcno' -print | xargs -r rm + clean-gcda: @echo Removing old coverage results -find -name '*.gcda' -print | xargs -r rm @@ -34,10 +38,10 @@ coverage-gcovr: clean-gcda generate-coverage-gcovr: @echo Generating coverage GCOVR report - $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.gcovr + $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml clean-coverage-gcovr: clean-gcda - -rm -rf $(top_builddir)/coverage.gcovr + -rm -rf $(top_builddir)/coverage.xml endif # HAVE_GCOVR diff --git a/configure.ac b/configure.ac index 6d286bb..77ad41b 100644 --- a/configure.ac +++ b/configure.ac @@ -77,15 +77,6 @@ AC_SUBST(APPLET_CFLAGS) AC_SUBST(APPLET_LIBS) ########################### -# Test Dependencies -########################### - -AC_ARG_ENABLE([tests], - AC_HELP_STRING([--disable-tests], [Disable test scripts and tools]),, - [enable_tests=auto]) -AM_CONDITIONAL(BUILD_TESTS, test xyes = xyes) - -########################### # Status Provider Deps ########################### @@ -124,8 +115,20 @@ AC_SUBST(COVERAGE_LDFLAGS) # Google Test framework ########################### -m4_include([m4/gtest.m4]) -CHECK_GTEST +AC_ARG_ENABLE([tests], + [AS_HELP_STRING([--disable-tests], [Disable test scripts and tools (default=auto)])], + [enable_tests=${enableval}], + [enable_tests=auto]) +if test "x$enable_tests" != "xno"; then + m4_include([m4/gtest.m4]) + CHECK_GTEST + if test "x$enable_tests" = "xauto"; then + enable_tests=${have_gtest} + elif test "x$enable_tests" = "xyes" && test "x$have_gtest" != "xyes"; then + AC_MSG_ERROR([tests were requested but gtest is not installed.]) + fi +fi +AM_CONDITIONAL([BUILD_TESTS],[test "x$enable_tests" = "xyes"]) ########################### # Check to see if we're local @@ -229,5 +232,6 @@ Messaging Indicator Configuration: Prefix: $prefix Indicator Dir: $INDICATORDIR + gtest: $enable_tests gcov: $use_gcov ]) |