[gnome-maps/wip/mlundblad/unit-tests: 2/3] WIP: Add test infrastructure for GJS-based tests
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/unit-tests: 2/3] WIP: Add test infrastructure for GJS-based tests
- Date: Wed, 29 Apr 2020 21:50:53 +0000 (UTC)
commit 7db05a43f31a7415394e0f0b73fdfb2a6992ebdd
Author: Marcus Lundblad <ml update uu se>
Date: Tue Apr 28 23:38:52 2020 +0200
WIP: Add test infrastructure for GJS-based tests
meson.build | 1 +
tests/meson.build | 25 +++++++++++++++++++++++++
tests/test.in | 6 ++++++
3 files changed, 32 insertions(+)
---
diff --git a/meson.build b/meson.build
index ebce469f..f0b78772 100644
--- a/meson.build
+++ b/meson.build
@@ -51,6 +51,7 @@ subdir('po')
subdir('src')
subdir('lib')
subdir('data')
+subdir('tests')
meson.add_install_script(
'meson_post_install.py',
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 00000000..d3cf74e9
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,25 @@
+script_conf = configuration_data()
+script_conf.set('GJS', find_program('gjs').path())
+script_conf.set('PACKAGE_VERSION', version)
+script_conf.set('libdir', libdir)
+script_conf.set('prefix', prefix)
+
+tests = []
+
+foreach test : tests
+ script_conf.set('name', test)
+ configure_file(
+ input: 'test.in',
+ output: test,
+ configuration: script_conf,
+ install: false,
+ install_dir: pkgdatadir
+ )
+endforeach
+
+foreach test : tests
+ test(test, find_program('gjs'),
+ args: ['-I', '../src/', '-I', '../tests/', 'tests/@0@'.format(test)]
+ )
+endforeach
+
diff --git a/tests/test.in b/tests/test.in
new file mode 100644
index 00000000..1f3aeabe
--- /dev/null
+++ b/tests/test.in
@@ -0,0 +1,6 @@
+#!@GJS@
+imports.package.init({ name: "@name@",
+ version: "@PACKAGE_VERSION@",
+ prefix: "@prefix@",
+ libdir: "@libdir@" });
+imports.package.run(imports.@name@);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]