[f-spot] Allow disabling of tests completely



commit b6ec17519c1ef57fde0a7e55482ec319787e88d2
Author: Iain Lane <laney ubuntu com>
Date:   Sun May 23 20:18:17 2010 +0100

    Allow disabling of tests completely
    
    This adds an option --enable-tests, which will allow the
    complete disabling of tests at configure time. Previously (and this is
    still the default) tests were conditionally enabled depending on the
    presence of nunit on the system.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=619457

 configure.ac |   36 +++++++++++++++++++++++-------------
 1 files changed, 23 insertions(+), 13 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 22e2ebf..f43d0d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -199,27 +199,37 @@ dnl -- dbus-sharp
 PKG_CHECK_MODULES(NDESK_DBUS, ndesk-dbus-1.0 >= $NDESK_DBUS_REQUIRED ndesk-dbus-glib-1.0 >= $NDESK_DBUS_GLIB_REQUIRED)
 AC_SUBST(NDESK_DBUS_LIBS)
 
-dnl -- nunit
-PKG_CHECK_MODULES(NUNIT, nunit >= $NUNIT_REQUIRED, 
-	do_tests="yes", do_tests="no")
+AC_ARG_ENABLE(tests,
+	AC_HELP_STRING([--enable-tests],
+		[Enable NUnit tests]))
 
-AC_SUBST(NUNIT_LIBS)
-AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
+AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" != "xno")
 
-if test "x$do_tests" = "xno"; then
-	PKG_CHECK_MODULES(NUNIT, mono-nunit >= 2.0, 
+if test "x$enable_tests" != "xno"; then
+	dnl -- nunit
+	PKG_CHECK_MODULES(NUNIT, nunit >= $NUNIT_REQUIRED,
 		do_tests="yes", do_tests="no")
-	
+
 	AC_SUBST(NUNIT_LIBS)
 	AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
 
 	if test "x$do_tests" = "xno"; then
-		NUNIT_DEFINES=''
-		AC_MSG_WARN([Could not find nunit: tests will not be available.])
-	else
-		NUNIT_DEFINES='-d:ENABLE_NUNIT'
+		PKG_CHECK_MODULES(NUNIT, mono-nunit >= 2.0,
+			do_tests="yes", do_tests="no")
+
+		AC_SUBST(NUNIT_LIBS)
+		AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
+
+		if test "x$do_tests" = "xno"; then
+			NUNIT_DEFINES=''
+			AC_MSG_WARN([Could not find nunit: tests will not be available.])
+		else
+			NUNIT_DEFINES='-d:ENABLE_NUNIT'
+		fi
+		AC_SUBST(NUNIT_DEFINES)
 	fi
-	AC_SUBST(NUNIT_DEFINES)
+else
+	do_tests="no"
 fi
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]