Merge lp:~ballogy/libappindicator/make-tests-optional into lp:libappindicator/0.5

Proposed by Ted Gould
Status: Merged
Approved by: Ted Gould
Approved revision: 223
Merged at revision: 224
Proposed branch: lp:~ballogy/libappindicator/make-tests-optional
Merge into: lp:libappindicator/0.5
Diff against target: 146 lines (+55/-6)
3 files modified
Makefile.am (+4/-1)
bindings/mono/Makefile.am (+22/-4)
configure.ac (+29/-1)
To merge this branch: bzr merge lp:~ballogy/libappindicator/make-tests-optional
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+90545@code.launchpad.net

This proposal supersedes a proposal from 2011-11-22.

Description of the change

This change makes it possible to disable building tests with '--disable-tests' and '--disable-mono-test' configure switches.

By default, mono-test is build only if nunit or mono-nunit available on build system.

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile.am'
--- Makefile.am 2011-06-15 15:44:55 +0000
+++ Makefile.am 2012-01-27 22:06:37 +0000
@@ -4,9 +4,12 @@
4 src \4 src \
5 bindings \5 bindings \
6 example \6 example \
7 tests \
8 docs7 docs
98
9if WANT_TESTS
10SUBDIRS += tests
11endif
12
10EXTRA_DIST = \13EXTRA_DIST = \
11 m4/introspection.m4 \14 m4/introspection.m4 \
12 gtk-doc.make \15 gtk-doc.make \
1316
=== modified file 'bindings/mono/Makefile.am'
--- bindings/mono/Makefile.am 2011-02-24 04:46:17 +0000
+++ bindings/mono/Makefile.am 2012-01-27 22:06:37 +0000
@@ -3,7 +3,9 @@
3pkgconfigdir = $(libdir)/pkgconfig3pkgconfigdir = $(libdir)/pkgconfig
4pkgconfig_DATA = appindicator-sharp-0.1.pc4pkgconfig_DATA = appindicator-sharp-0.1.pc
55
6if BUILD_MONO_TEST
6TEST = AppIndicator.Test.dll7TEST = AppIndicator.Test.dll
8endif
79
8API = libappindicator-api.xml10API = libappindicator-api.xml
9MIDDLE_API = libappindicator-api.middle11MIDDLE_API = libappindicator-api.middle
@@ -40,16 +42,24 @@
40 $(API) \42 $(API) \
41 $(MIDDLE_API) \43 $(MIDDLE_API) \
42 $(RAW_API) \44 $(RAW_API) \
43 $(TEST) \
44 $(DLLPOLICY) \45 $(DLLPOLICY) \
45 $(DLLPOLICY1) \46 $(DLLPOLICY1) \
46 $(WRAPPER_FREE_BINDING) \47 $(WRAPPER_FREE_BINDING) \
47 $(POLICY).config \48 $(POLICY).config \
48 $(POLICY1).config49 $(POLICY1).config
4950
51if BUILD_MONO_TEST
52CLEANFILES += $(TEST)
53endif
54
50DISTCLEANFILES = $(ASSEMBLY).config55DISTCLEANFILES = $(ASSEMBLY).config
56
57if BUILD_MONO_TEST
51TEST_SOURCES = TestIndicator.cs58TEST_SOURCES = TestIndicator.cs
59endif
60
52customs = ApplicationIndicator.custom61customs = ApplicationIndicator.custom
62
53EXTRA_DIST = \63EXTRA_DIST = \
54 AssemblyInfo.cs \64 AssemblyInfo.cs \
55 $(RAW_API) \65 $(RAW_API) \
@@ -60,13 +70,19 @@
60 $(ASSEMBLY_NAME).snk \70 $(ASSEMBLY_NAME).snk \
61 $(POLICY).config.in \71 $(POLICY).config.in \
62 $(POLICY1).config.in \72 $(POLICY1).config.in \
63 $(customs) \73 $(customs)
64 $(TEST_SOURCES)74
75if BUILD_MONO_TEST
76EXTRA_DIST += $(TEST_SOURCES)
77endif
6578
66GACUTIL_FLAGS=-package $(ASSEMBLY_NAME) -root $(DESTDIR)$(prefix)/lib79GACUTIL_FLAGS=-package $(ASSEMBLY_NAME) -root $(DESTDIR)$(prefix)/lib
6780
68references = $(GTK_SHARP_LIBS)81references = $(GTK_SHARP_LIBS)
69test_references = $(GTK_SHARP_LIBS) $(NUNIT_LIBS) -r:$(ASSEMBLY)82
83if BUILD_MONO_TEST
84test_references = $(GTK_SHARP_LIBS) $(NUNIT_LIBS) $(MONO_NUNIT_LIBS) -r:$(ASSEMBLY)
85endif
7086
71$(RAW_API): app-indicator.sources.xml $(WRAPPER_FREE_BINDING)87$(RAW_API): app-indicator.sources.xml $(WRAPPER_FREE_BINDING)
72 $(GAPI_PARSER) $(srcdir)/app-indicator.sources.xml88 $(GAPI_PARSER) $(srcdir)/app-indicator.sources.xml
@@ -130,10 +146,12 @@
130 echo "$(GACUTIL) -u $(DLLPOLICY) $(GACUTIL_FLAGS)"; \146 echo "$(GACUTIL) -u $(DLLPOLICY) $(GACUTIL_FLAGS)"; \
131 $(GACUTIL) -u $(POLICY) $(GACUTIL_FLAGS) || exit 1;147 $(GACUTIL) -u $(POLICY) $(GACUTIL_FLAGS) || exit 1;
132148
149if BUILD_MONO_TEST
133$(TEST): $(ASSEMBLY) $(TEST_SOURCES)150$(TEST): $(ASSEMBLY) $(TEST_SOURCES)
134 $(CSC) -out:$(TEST) -target:library $(test_references) $(srcdir)/$(TEST_SOURCES)151 $(CSC) -out:$(TEST) -target:library $(test_references) $(srcdir)/$(TEST_SOURCES)
135152
136all: $(TEST)153all: $(TEST)
154endif
137155
138$(POLICY).config: $(POLICY).config.in Makefile156$(POLICY).config: $(POLICY).config.in Makefile
139 sed -e "s|@ASSEMBLY_NAME@|$(ASSEMBLY_NAME)|" \157 sed -e "s|@ASSEMBLY_NAME@|$(ASSEMBLY_NAME)|" \
140158
=== modified file 'configure.ac'
--- configure.ac 2011-09-28 17:41:09 +0000
+++ configure.ac 2012-01-27 22:06:37 +0000
@@ -153,7 +153,25 @@
153AC_PATH_PROG(GAPI_FIXUP, gapi2-fixup, no)153AC_PATH_PROG(GAPI_FIXUP, gapi2-fixup, no)
154AC_SUBST(GAPI_FIXUP)154AC_SUBST(GAPI_FIXUP)
155155
156PKG_CHECK_MODULES(NUNIT, nunit >= 2.4.7)156# Check for nunit
157AC_ARG_ENABLE([mono-test],
158 AC_HELP_STRING([--disable-mono-test], [Disable mono test]),,
159 [enable_mono_test=auto])
160
161if test x"$enable_mono_test" != x"no" ; then
162 PKG_CHECK_MODULES(NUNIT, nunit >= 2.4.7,
163 [have_nunit=yes],
164 [PKG_CHECK_MODULES(MONO_NUNIT, mono-nunit,
165 [have_nunit=yes],
166 [have_nunit=no])
167 ])
168 if test x${enable_mono_test} = xyes && test x${have_nunit} = xno; then
169 AC_MSG_ERROR([Mono test configured but nunit not found])
170 fi
171else
172 have_nunit=no
173fi
174AM_CONDITIONAL(BUILD_MONO_TEST, test x${have_nunit} = xyes)
157175
158###########################176###########################
159# Check to see if we're local177# Check to see if we're local
@@ -189,6 +207,14 @@
189AC_SUBST(PYGTK_CODEGEN)207AC_SUBST(PYGTK_CODEGEN)
190AC_MSG_RESULT($PYGTK_CODEGEN)208AC_MSG_RESULT($PYGTK_CODEGEN)
191209
210#########################
211# Check if build tests
212#########################
213AC_ARG_ENABLE([tests],
214 AC_HELP_STRING([--disable-tests], [Disable tests]),,
215 [enable_tests=yes])
216AM_CONDITIONAL([WANT_TESTS], [test "x$enable_tests" != "xno"])
217
192###########################218###########################
193# Files219# Files
194###########################220###########################
@@ -226,4 +252,6 @@
226252
227 Prefix: $prefix253 Prefix: $prefix
228 GTK+ Version: $with_gtk254 GTK+ Version: $with_gtk
255 Tests: $enable_tests
256 Mono tests: $have_nunit
229])257])

Subscribers

People subscribed via source and target branches