[gnome-shell-extensions/wip/fmuellner/ci: 5/6] build: Optionally syntax-check sources
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions/wip/fmuellner/ci: 5/6] build: Optionally syntax-check sources
- Date: Fri, 1 Dec 2017 19:21:01 +0000 (UTC)
commit b90c99b87c3682b073a9b7481f7e657395e01a9e
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Nov 29 22:00:14 2017 +0100
build: Optionally syntax-check sources
As a pure javascript project, building is really just a glorified
copy operation, so success doesn't even indicate that sources are
syntactically correct (a.k.a. "compile-tested"). We can at least
get some minimal testing by performing some basic syntax checking
when SpilderMonkey's JS shell is available.
Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/32
extensions/meson.build | 25 +++++++++++++++++++++----
meson.build | 1 +
2 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/extensions/meson.build b/extensions/meson.build
index 30bc053..eba5053 100644
--- a/extensions/meson.build
+++ b/extensions/meson.build
@@ -1,8 +1,9 @@
extension_schemas = []
+js_sources = extensionlib
metadata_name = 'metadata.json'
-foreach e : enabled_extensions
+foreach e : all_extensions
uuid = e + '@gnome-shell-extensions.gcampax.github.com'
metadata_conf = configuration_data()
@@ -18,11 +19,27 @@ foreach e : enabled_extensions
subdir(e)
- install_data (extension_sources + extension_data + extensionlib,
- install_dir: join_paths(extensiondir, uuid)
- )
+ js_sources += extension_sources
+
+ if (enabled_extensions.contains(e))
+ install_data (extension_sources + extension_data + extensionlib,
+ install_dir: join_paths(extensiondir, uuid)
+ )
+ endif
endforeach
install_data (extension_schemas,
install_dir: schemadir
)
+
+foreach js_source : js_sources
+ if (js52.found())
+ path_array = '@0@'.format(js_source).split('/')
+ name = join_paths(path_array[-2], path_array[-1])
+
+ test('Checking syntax of ' + name, js52,
+ args: ['-s', '-c', js_source],
+ workdir: meson.current_source_dir()
+ )
+ endif
+endforeach
diff --git a/meson.build b/meson.build
index 80b1b18..92cf371 100644
--- a/meson.build
+++ b/meson.build
@@ -22,6 +22,7 @@ xsessiondir = join_paths(datadir, 'xsession')
extensionlib = files('lib/convenience.js')
+js52 = find_program('js52', required: false)
sassc = find_program('sassc', required: false)
ver_arr = meson.project_version().split('.')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]