[gnome-games] Only check for check if tests are enabled



commit 3a49815287e5f3cd9a4179b90b8ca1e0274b54a4
Author: Christian Persch <chpe gnome org>
Date:   Mon Jun 1 23:10:56 2009 +0200

    Only check for check if tests are enabled
    
    Rewrite the --enable-tests configure logic to only check for check if
    tests are enabled.
    Disable tests by default on the hildon platform.
    Make check dependency mandatory if tests are enabled, and simplify the
    Makefile.am logic in tests/.
---
 Makefile.am       |    5 ++++-
 configure.in      |   41 +++++++++++++++++++----------------------
 tests/Makefile.am |   22 ++--------------------
 3 files changed, 25 insertions(+), 43 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index d355d40..6c72050 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,13 +5,16 @@ SUBDIRS= \
 	dependencies \
 	icons \
 	libgames-support \
-	tests \
 	$(gamelist)
 
 if ENABLE_SOUND
 SUBDIRS += sounds
 endif
 
+if ENABLE_TESTS
+SUBDIRS += tests
+endif
+
 DIST_SUBDIRS = po dependencies icons sounds libgames-support tests $(allgames) $(staginggames)
 
 EXTRA_DIST = \
diff --git a/configure.in b/configure.in
index c71cdb0..08c632c 100644
--- a/configure.in
+++ b/configure.in
@@ -928,28 +928,24 @@ AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
 # Unit tests
 # **********
 
-# check for "check", unit testing library/header
-PKG_CHECK_MODULES([CHECK], [check >= 0.9.4],
-    [
-        HAVE_CHECK=yes
-        #AC_MSG_NOTICE(CHECK_CFLAGS: $CHECK_CFLAGS)
-        #AC_MSG_NOTICE(CHECK_LIBS: $CHECK_LIBS)
-    ],
-    HAVE_CHECK=no)
-AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
-
-dnl building of tests
-AC_ARG_ENABLE(tests,
-  AC_HELP_STRING([--disable-tests], [disable building test apps]),
-  [
-    case "${enableval}" in
-      yes) BUILD_TESTS=yes ;;
-      no)  BUILD_TESTS=no ;;
-      *)   AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
-    esac
-  ],
-[BUILD_TESTS=yes]) dnl Default value
-AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
+AC_ARG_ENABLE([tests],
+  [AS_HELP_STRING([--disable-tests], [disable building test apps (default: platform dependent)])],
+  [],
+  [case "$with_platform" in
+    hildon) enable_tests=no ;;
+    *) enable_tests=yes ;;
+   esac])
+
+if test "$enable_tests" = "yes"; then
+  PKG_CHECK_MODULES([CHECK],[check >= 0.9.4],
+    [],[AC_MSG_ERROR([check not found; install it or use --disable-tests])])
+fi
+
+AM_CONDITIONAL([ENABLE_TESTS],[test "$enable_tests" = "yes"])
+
+# *************
+# setgid checks
+# *************
 
 AC_ARG_ENABLE([setgid],
   [AS_HELP_STRING([--disable-setgid],
@@ -1117,6 +1113,7 @@ echo "
     Use setgid binaries:   ${setgid}
     Scores user:           ${scores_user}
     Scores & setgid group: ${scores_group}
+    Tests enabled:         ${enable_tests}
 "
 
 if grep "$scores_group:" /etc/group > /dev/null; then
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b0cdf1b..e4ceb1f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,21 +1,3 @@
-EXTRA_DIST = README
-
-if BUILD_TESTS
-SUBDIRS_TESTS =
-if HAVE_CHECK
-SUBDIRS_CHECK = libgames-support
-else
-SUBDIRS_CHECK =
-endif
-else
-SUBDIRS_TESTS =
-SUBDIRS_CHECK =
-endif
-
-SUBDIRS = \
-	$(SUBDIRS_CHECK) \
-	$(SUBDIRS_TESTS) 
-
-DIST_SUBDIRS = \
-	libgames-support 
+SUBDIRS = libgames-support
 
+EXTRA_DIST = README



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