[geocode-glib/wip/hadess/installed-tests: 4/4] tests: Install .test file as required for installed-tests
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geocode-glib/wip/hadess/installed-tests: 4/4] tests: Install .test file as required for installed-tests
- Date: Thu, 30 Jun 2022 12:34:28 +0000 (UTC)
commit 66d688799256a6b9c895c7955e33a3746ad1774d
Author: Bastien Nocera <hadess hadess net>
Date: Thu Jun 30 14:33:10 2022 +0200
tests: Install .test file as required for installed-tests
See https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests
Closes: #21
geocode-glib/tests/meson.build | 16 ++++++++++++++++
geocode-glib/tests/test-template.test.in | 5 +++++
2 files changed, 21 insertions(+)
---
diff --git a/geocode-glib/tests/meson.build b/geocode-glib/tests/meson.build
index e1311ca..51571b6 100644
--- a/geocode-glib/tests/meson.build
+++ b/geocode-glib/tests/meson.build
@@ -6,6 +6,7 @@ e = executable('geo-uri',
install: get_option('enable-installed-tests'),
install_dir: install_dir)
test('Geo URI', e)
+tests = ['geo-uri']
e = executable('geocode-glib',
'geocode-nominatim-test.h',
@@ -16,6 +17,7 @@ e = executable('geocode-glib',
install_dir: install_dir)
env = ['G_TEST_SRCDIR=' + meson.current_source_dir()]
test('API test', e, env: env)
+tests += ['geocode-glib']
e = executable('mock-backend',
'mock-backend.c',
@@ -23,8 +25,22 @@ e = executable('mock-backend',
install: get_option('enable-installed-tests'),
install_dir: install_dir)
test('Test mock backend', e)
+tests += ['mock-backend']
if get_option('enable-installed-tests')
+ foreach test_name: tests
+ conf_data = configuration_data()
+ conf_data.set('PATH', install_dir)
+ conf_data.set('NAME', test_name)
+ test_file = configure_file(
+ configuration: conf_data,
+ input: 'test-template.test.in',
+ output: test_name + '.test',
+ )
+
+ install_data(test_file,
+ install_dir: install_dir)
+ endforeach
install_data('locale_format.json',
'locale_name.json',
'nominatim-area.json',
diff --git a/geocode-glib/tests/test-template.test.in b/geocode-glib/tests/test-template.test.in
new file mode 100644
index 0000000..ce4bf60
--- /dev/null
+++ b/geocode-glib/tests/test-template.test.in
@@ -0,0 +1,5 @@
+[Test]
+Description=@NAME@
+Exec=@PATH@/@NAME@
+Type=session
+Output=TAP
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]