Merge lp:~ballogy/notify-osd/make-tests-optional into lp:notify-osd/oneiric

Proposed by Balló György on 2011-11-27
Status: Needs review
Proposed branch: lp:~ballogy/notify-osd/make-tests-optional
Merge into: lp:notify-osd/oneiric
Diff against target: 85 lines (+28/-6)
2 files modified
Makefile.am (+5/-1)
configure.in (+23/-5)
To merge this branch: bzr merge lp:~ballogy/notify-osd/make-tests-optional
Reviewer Review Type Date Requested Status
Canonical Desktop Experience Team 2011-11-27 Pending
Review via email: mp+83500@code.launchpad.net

Description of the change

This change makes it possible to disable building tests with '--disable-tests' configure switch. Libnotify checked only if either tests or C examples are requested.

To post a comment you must log in.
Balló György (ballogy) wrote :

Any decision?

Unmerged revisions

445. By Balló György on 2011-11-24

Make building tests optional

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile.am'
2--- Makefile.am 2009-08-25 13:17:46 +0000
3+++ Makefile.am 2011-11-27 02:18:24 +0000
4@@ -1,9 +1,13 @@
5 EXTRA_DIST = icons
6
7-SUBDIRS = src tests data examples
8+SUBDIRS = src data examples
9+
10+if BUILD_TESTS
11+SUBDIRS += tests
12
13 test: check
14 tests: check
15 test-report: check
16 check-valgrind: all
17 cd tests && $(MAKE) $(AM_MAKEFLAGS) check-valgrind
18+endif
19
20=== modified file 'configure.in'
21--- configure.in 2011-11-01 12:45:48 +0000
22+++ configure.in 2011-11-27 02:18:24 +0000
23@@ -39,11 +39,6 @@
24 PKG_CHECK_MODULES([WNCK], [libwnck-3.0])
25
26 #
27-# libnotify, used unit-tests
28-#
29-PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.4.5])
30-
31-#
32 # dbus
33 #
34 PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= 0.76])
35@@ -76,6 +71,25 @@
36 AC_SUBST(LIBM)
37
38 #
39+# checks for building unit-tests
40+#
41+AC_ARG_ENABLE([tests],
42+ AS_HELP_STRING([--enable-tests], [enable building tests]),,
43+ enable_tests=auto)
44+
45+if test x"$enable_tests" != x"no" ; then
46+PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.4.5],
47+ [have_tests=yes],
48+ [have_tests=no])
49+ if test x${enable_tests} = xyes && test x${have_tests} = xno; then
50+ AC_MSG_ERROR([Tests configured but libnotify not found])
51+ fi
52+else
53+ have_tests=no
54+fi
55+AM_CONDITIONAL(BUILD_TESTS, test x${have_tests} = xyes)
56+
57+#
58 # checks for building C- or C#-examples
59 #
60 AC_DEFUN([CHECK_FOR_MONO_STUFF],
61@@ -118,6 +132,7 @@
62 c_examples=no
63 csharp_examples=no
64 if test "x$with_examples" = "xc"; then
65+ PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.4.5])
66 c_examples=yes
67 AC_MSG_NOTICE([Build with ANSI-C examples])
68 fi
69@@ -127,6 +142,7 @@
70 AC_MSG_NOTICE([Build with C-sharp examples])
71 fi
72 if test "x$with_examples" = "xall"; then
73+ PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.4.5])
74 CHECK_FOR_MONO_STUFF
75 c_examples=yes
76 csharp_examples=yes
77@@ -165,6 +181,8 @@
78 echo ""
79 echo " prefix: ${prefix}"
80 echo ""
81+echo " Build Unit Tests: ${have_tests}"
82+echo ""
83 echo " Build C Examples: ${c_examples}"
84 echo ""
85 echo " Build C# Examples: ${csharp_examples}"

Subscribers

People subscribed via source and target branches