Merge lp:~amigadave/account-plugins/add-some-tests into lp:account-plugins

Proposed by David King
Status: Merged
Approved by: Alberto Mardegan
Approved revision: 88
Merged at revision: 85
Proposed branch: lp:~amigadave/account-plugins/add-some-tests
Merge into: lp:account-plugins
Diff against target: 93 lines (+45/-3)
3 files modified
.bzrignore (+2/-0)
Makefile.am (+26/-2)
configure.ac (+17/-1)
To merge this branch: bzr merge lp:~amigadave/account-plugins/add-some-tests
Reviewer Review Type Date Requested Status
Alberto Mardegan (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Ken VanDine Pending
Review via email: mp+138393@code.launchpad.net

Commit message

Add a couple of simple tests

* Add tests for well-formed XML files
* Enable automake silent rules

Description of the change

Add a couple of simple tests

* Add tests for well-formed XML files
* Enable automake silent rules

To post a comment you must log in.
Revision history for this message
David King (amigadave) wrote :

This checks the .provider and .service files with xmllint. It does not check against the DTDs provided by libaccounts-glib, as those will not be available until a future 1.4 release. Some tests for the binary plugins could be provided, but I am not sure how to approach that problem at the moment.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
87. By David King

Enable the XML tests only if xmllint is present

88. By David King

Force tests to be enabled during distcheck

Add an --enable-tests configure argument, and add it to
DISTCHECK_CONFIGURE_FLAGS.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alberto Mardegan (mardy) wrote :

I don't think there is much sense in making tests for the binary plugins, are they mostly consist of data only -- which BTW will soon be migrated to the provider files, once the new libaccounts-glib is released.

Anyway, this MR makes lots of sense, thanks! :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2012-11-23 10:02:15 +0000
+++ .bzrignore 2012-12-06 08:13:21 +0000
@@ -57,3 +57,5 @@
57/src/sohu.c57/src/sohu.c
58/src/twitter.c58/src/twitter.c
59/src/windows-live.c59/src/windows-live.c
60/test-provider
61/test-service
6062
=== modified file 'Makefile.am'
--- Makefile.am 2012-11-23 10:02:52 +0000
+++ Makefile.am 2012-12-06 08:13:21 +0000
@@ -2,7 +2,8 @@
2 po2 po
33
4DISTCHECK_CONFIGURE_FLAGS = \4DISTCHECK_CONFIGURE_FLAGS = \
5 --enable-libaccount-plugin5 --enable-libaccount-plugin \
6 --enable-tests
67
7if ENABLE_LIBACCOUNT_PLUGIN8if ENABLE_LIBACCOUNT_PLUGIN
8# Binary account plugins.9# Binary account plugins.
@@ -185,9 +186,32 @@
185 $(services_in_files) \186 $(services_in_files) \
186 src/config.vapi187 src/config.vapi
187188
189if HAVE_XMLLINT
190TESTS = \
191 test-provider \
192 test-service
193
194test-provider: Makefile $(providers_DATA)
195 $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \
196 echo "for provider in $(providers_DATA)" >> $@; \
197 echo "do" >> $@; \
198 echo " $(XMLLINT) --noout $(top_builddir)/\$$provider || exit 1" >> $@; \
199 echo "done" >> $@; \
200 chmod +x $@
201
202test-service: Makefile $(services_DATA)
203 $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \
204 echo "for service in $(services_DATA)" >> $@; \
205 echo "do" >> $@; \
206 echo " $(XMLLINT) --noout $(top_builddir)/\$$service || exit 1" >> $@; \
207 echo "done" >> $@; \
208 chmod +x $@
209endif # HAVE_XMLLINT
210
188CLEANFILES = \211CLEANFILES = \
189 $(services_DATA) \212 $(services_DATA) \
190 $(providers_DATA)213 $(providers_DATA) \
214 $(TESTS)
191215
192DISTCLEANFILES = \216DISTCLEANFILES = \
193 intltool-extract \217 intltool-extract \
194218
=== modified file 'configure.ac'
--- configure.ac 2012-11-13 09:00:39 +0000
+++ configure.ac 2012-12-06 08:13:21 +0000
@@ -6,7 +6,7 @@
6 [account-plugins],6 [account-plugins],
7 [https://launchpad.net/online-accounts-account-plugins])7 [https://launchpad.net/online-accounts-account-plugins])
88
9AM_INIT_AUTOMAKE([1.10 -Wall -Wno-portability subdir-objects])9AM_INIT_AUTOMAKE([1.10 -Wall -Wno-portability silent-rules subdir-objects])
10AM_CONFIG_HEADER(config.h)10AM_CONFIG_HEADER(config.h)
1111
12# Gobject Introspection12# Gobject Introspection
@@ -56,6 +56,22 @@
56AC_SUBST([servicesdir],56AC_SUBST([servicesdir],
57 [`$PKG_CONFIG --variable servicefilesdir libaccounts-glib`])57 [`$PKG_CONFIG --variable servicefilesdir libaccounts-glib`])
5858
59AC_ARG_ENABLE([TESTS],
60 [AS_HELP_STRING([--disable-tests], [Disable tests])])
61
62AS_IF([test "x$enable_tests" != "xno"],
63 [AC_PATH_PROG([XMLLINT], [xmllint], [notfound])
64 AS_IF([test "x$XMLLINT" = "xnotfound"],
65 [have_xmllint=no],
66 [have_xmllint=yes])])
67
68AS_IF([test "x$have_xmllint" = "xyes"],
69 [AC_SUBST([XMLLINT])],
70 [AS_IF([test "x$enable_tests" = "xyes"],
71 [AC_MSG_ERROR([testing support enabled but required dependencies were not found])])])
72
73AM_CONDITIONAL([HAVE_XMLLINT], [test "x$have_xmllint" = "xyes"])
74
59# Set Twitter consumer key/secret75# Set Twitter consumer key/secret
60AC_ARG_WITH(twitter-consumer-key,76AC_ARG_WITH(twitter-consumer-key,
61 [AS_HELP_STRING([--with-twitter-consumer-key],77 [AS_HELP_STRING([--with-twitter-consumer-key],

Subscribers

People subscribed via source and target branches