[geocode-glib/wip/hadess/installed-tests: 1/4] build: Fix tests not being enabled if not installed




commit 7581ff7a8d006d482a85ae1e3ad340c8aa9a237e
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jun 30 14:20:40 2022 +0200

    build: Fix tests not being enabled if not installed
    
    We should always have been building the tests, and allow them to be run
    uninstalled with "meson test" even if the builder didn't want to have
    them available as installed-tests.

 geocode-glib/meson.build       |  4 +---
 geocode-glib/tests/meson.build | 42 ++++++++++++++++++++++--------------------
 2 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/geocode-glib/meson.build b/geocode-glib/meson.build
index 2a880d1..8df0569 100644
--- a/geocode-glib/meson.build
+++ b/geocode-glib/meson.build
@@ -132,6 +132,4 @@ geocode_glib_dep = declare_dependency(link_with: libgcglib,
                                       dependencies: deps,
                                       sources: generated_sources)
 
-if get_option('enable-installed-tests')
-    subdir('tests')
-endif
+subdir('tests')
diff --git a/geocode-glib/tests/meson.build b/geocode-glib/tests/meson.build
index c5a9547..6a90206 100644
--- a/geocode-glib/tests/meson.build
+++ b/geocode-glib/tests/meson.build
@@ -3,7 +3,7 @@ install_dir = get_option('libexecdir') + '/installed-tests/' + library_name
 e = executable('geo-uri',
                'geo-uri.c',
                dependencies: geocode_glib_dep,
-               install: true,
+               install: get_option('enable-installed-tests'),
                install_dir: install_dir)
 test('Geo URI', e)
 
@@ -12,7 +12,7 @@ e = executable('geocode-glib',
                'geocode-nominatim-test.c',
                'geocode-glib.c',
                dependencies: geocode_glib_dep,
-               install: true,
+               install: get_option('enable-installed-tests'),
                install_dir: install_dir)
 env = ['G_TEST_SRCDIR=' + meson.current_source_dir()]
 test('API test', e, env: env)
@@ -20,24 +20,26 @@ test('API test', e, env: env)
 e = executable('mock-backend',
                'mock-backend.c',
                dependencies: geocode_glib_dep,
-               install: true,
+               install: get_option('enable-installed-tests'),
                install_dir: install_dir)
 test('Test mock backend', e)
 
-install_data('locale_format.json',
-             'locale_name.json',
-             'nominatim-area.json',
-             'nominatim-data-type-change.json',
-             'nominatim-no-results.json',
-             'nominatim-place_rank.json',
-             'nominatim-rio.json',
-             'osm_type0.json',
-             'osm_type1.json',
-             'osm_type2.json',
-             'pub.json',
-             'rev.json',
-             'rev_fail.json',
-             'search.json',
-             'search_lat_long.json',
-             'xep.json',
-             install_dir: install_dir)
+if get_option('enable-installed-tests')
+  install_data('locale_format.json',
+               'locale_name.json',
+               'nominatim-area.json',
+               'nominatim-data-type-change.json',
+               'nominatim-no-results.json',
+               'nominatim-place_rank.json',
+               'nominatim-rio.json',
+               'osm_type0.json',
+               'osm_type1.json',
+               'osm_type2.json',
+               'pub.json',
+               'rev.json',
+               'rev_fail.json',
+               'search.json',
+               'search_lat_long.json',
+               'xep.json',
+               install_dir: install_dir)
+endif


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