After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 772928 - build: Add installed-tests support
build: Add installed-tests support
Status: RESOLVED FIXED
Product: geocode-glib
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: geocode-glib maintainer(s)
geocode-glib maintainer(s)
Depends on:
Blocks: 774631
 
 
Reported: 2016-10-14 11:51 UTC by Philip Withnall
Modified: 2017-01-17 10:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Move test C sources into the tests subdirectory (6.53 KB, patch)
2016-10-14 11:52 UTC, Philip Withnall
committed Details | Review
tests: Remove duplicate return statement (721 bytes, patch)
2016-10-14 11:52 UTC, Philip Withnall
committed Details | Review
tests: Move nominatim-*.json to tests directory (4.56 KB, patch)
2016-10-14 11:52 UTC, Philip Withnall
committed Details | Review
build: Add installed-tests support (11.02 KB, patch)
2016-10-14 11:52 UTC, Philip Withnall
committed Details | Review
build: Clean m4 directory on maintainer-clean (639 bytes, patch)
2016-10-14 11:52 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2016-10-14 11:51:57 UTC
Small patch series to reorganise the tests a bit to can add installed-tests support:

https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests
Comment 1 Philip Withnall 2016-10-14 11:52:05 UTC
Created attachment 337704 [details] [review]
tests: Move test C sources into the tests subdirectory

This improves tab-completion in the source directory, and means all the
test code is in one directory. Split the build configuration for them
out into a separate makefile, in preparation for adding installed-tests
support there.
Comment 2 Philip Withnall 2016-10-14 11:52:09 UTC
Created attachment 337705 [details] [review]
tests: Remove duplicate return statement
Comment 3 Philip Withnall 2016-10-14 11:52:13 UTC
Created attachment 337706 [details] [review]
tests: Move nominatim-*.json to tests directory

So they are with the other test JSON files. This also removes the need
for TEST_SRCDIR — we can now use g_test_build_filename() instead, which
uses the G_TEST_SRCDIR/G_TEST_BUILDDIR environment variables which will
eventually be passed in by glib-tap.mk (in following commits).
Comment 4 Philip Withnall 2016-10-14 11:52:17 UTC
Created attachment 337707 [details] [review]
build: Add installed-tests support

This means the tests are installed on the system, and can be run using
   gnome-desktop-testing-runner geocode-glib-1.0

This means they will be run as integration tests on systems like
gnome-continuous, which may help to catch bugs caused by integration
changes with other modules.

The tests themselves have not actually changed.
Comment 5 Philip Withnall 2016-10-14 11:52:22 UTC
Created attachment 337708 [details] [review]
build: Clean m4 directory on maintainer-clean

It should be deleted then.
Comment 6 Bastien Nocera 2017-01-17 09:42:51 UTC
Review of attachment 337704 [details] [review]:

::: geocode-glib/test-gcglib.c
@@ +184,3 @@
 		g_autoptr (GError) error = NULL;
 
+		cache_path = g_dir_make_tmp ("tests-geocode-glib-XXXXXX", &error);

The rest of the changes in this file seem unrelated.
Comment 7 Bastien Nocera 2017-01-17 09:43:44 UTC
Review of attachment 337705 [details] [review]:

Yep
Comment 8 Bastien Nocera 2017-01-17 09:48:01 UTC
Review of attachment 337706 [details] [review]:

Sure.
Comment 9 Bastien Nocera 2017-01-17 09:50:57 UTC
Review of attachment 337707 [details] [review]:

Sure.

::: geocode-glib/tests/Makefile.am
@@ -28,3 @@
 	geocode-glib.c
 
-geo_uri_LDADD = $(top_builddir)/geocode-glib/libgeocode-glib.la $(GEOCODE_LIBS)

This optimisation should be in a separate patch.
Comment 10 Bastien Nocera 2017-01-17 09:52:13 UTC
Review of attachment 337708 [details] [review]:

Sure
Comment 11 Philip Withnall 2017-01-17 10:37:11 UTC
Review of attachment 337704 [details] [review]:

::: geocode-glib/test-gcglib.c
@@ +184,3 @@
 		g_autoptr (GError) error = NULL;
 
+		cache_path = g_dir_make_tmp ("tests-geocode-glib-XXXXXX", &error);

They’re because the test was renamed from `test-gcglib` to `tests/geocode-glib`, so they ensure all the paraphernalia still matches the test name.
Comment 12 Philip Withnall 2017-01-17 10:38:17 UTC
Review of attachment 337707 [details] [review]:

::: geocode-glib/tests/Makefile.am
@@ -28,3 @@
 	geocode-glib.c
 
-geo_uri_LDADD = $(top_builddir)/geocode-glib/libgeocode-glib.la $(GEOCODE_LIBS)

OK, will do when pushing.
Comment 13 Philip Withnall 2017-01-17 10:42:46 UTC
Attachment 337704 [details] pushed as 38e54cf - tests: Move test C sources into the tests subdirectory
Attachment 337705 [details] pushed as fc577c6 - tests: Remove duplicate return statement
Attachment 337706 [details] pushed as 9baf551 - tests: Move nominatim-*.json to tests directory
Attachment 337707 [details] pushed as f1650be - build: Add installed-tests support
Attachment 337708 [details] pushed as 0dfe4a2 - build: Clean m4 directory on maintainer-clean