aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-04-26 15:01:53 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-04-26 15:01:53 -0500
commit6187dfbd140c6f3af8dce96c3cac1e86c6ff0442 (patch)
treed15d69d21741b04cbaeecaecee63f1378e818998
parent705eb1b42bd83149592a284a035b54c3346936da (diff)
downloadayatana-indicator-session-6187dfbd140c6f3af8dce96c3cac1e86c6ff0442.tar.gz
ayatana-indicator-session-6187dfbd140c6f3af8dce96c3cac1e86c6ff0442.tar.bz2
ayatana-indicator-session-6187dfbd140c6f3af8dce96c3cac1e86c6ff0442.zip
only require GTest and libdbustest if we're building the unit tests
-rw-r--r--Makefile.am7
-rw-r--r--configure.ac22
2 files changed, 24 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am
index b76302c..c05a4f0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,9 +2,14 @@
SUBDIRS = \
src \
data \
- tests \
po
+if BUILD_TESTS
+SUBDIRS += tests
+# build src first
+test: src
+endif
+
EXTRA_DIST = autogen.sh
DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall
diff --git a/configure.ac b/configure.ac
index 4a1317e..476fc2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,8 +89,6 @@ AS_IF([test "x$with_gtk" = x3], [
AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available])
])
-PKG_CHECK_MODULES(LIBDBUSTEST, dbustest-1 >= DBUSTEST_REQUIRED_VERSION)
-
###########################
# GTK Logout Helper
###########################
@@ -178,8 +176,23 @@ AC_SUBST(DBUSSERVICEDIR)
# 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
+ if test "x$enable_tests" = "xyes"; then
+ PKG_CHECK_MODULES(LIBDBUSTEST, dbustest-1 >= DBUSTEST_REQUIRED_VERSION)
+ fi
+fi
+AM_CONDITIONAL([BUILD_TESTS],[test "x$enable_tests" = "xyes"])
##############################
# Custom Junk
@@ -266,5 +279,6 @@ SUS Indicator Configuration:
Indicator GTK: $with_gtk
Logout Helper: $have_gtklogouthelper
APT support: $enable_apt
+ Enable tests: $enable_tests
Coverage reporting: $use_gcov
])