[gnome-maps/wip/mlundblad/unit-tests: 1/2] 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: 1/2] WIP: Add test infrastructure for GJS-based tests
 
- Date: Sat,  9 May 2020 22:13:15 +0000 (UTC)
 
commit 255404fff6b0bf5cf14611f849f7cc26caeab384
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 | 26 ++++++++++++++++++++++++++
 tests/test.in     |  6 ++++++
 3 files changed, 33 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..80c3691b
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,26 @@
+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)],
+       env:  ['LANG=C']
+  )
+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]