[polari/ci: 2/3] build: Syntax-check javascript sources



commit 65a2099366c0fd6abe785ca14774b2cf207a86c5
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Oct 18 21:29:17 2017 +0200

    build: Syntax-check javascript sources
    
    As most of our sources are written in Javascript, they are currently
    not even compile-tested when building. We can at least get some minimal
    testing by performing some basic syntax checking when SpiderMonkey's JS
    shell is available.
    
    Fixes https://gitlab.gnome.org/GNOME/polari/issues/11

 meson.build     | 1 +
 src/meson.build | 7 +++++++
 2 files changed, 8 insertions(+)
---
diff --git a/meson.build b/meson.build
index c0bd207..048643b 100644
--- a/meson.build
+++ b/meson.build
@@ -28,6 +28,7 @@ girdir = join_paths(pkgdatadir, 'gir-1.0')
 typelibdir = join_paths(pkglibdir, 'girepository-1.0')
 
 gjs_console = find_program('gjs')
+js52 = find_program('js52', required: false)
 
 desktop_file_validate = find_program('desktop-file-validate', required: false)
 appstream_util = find_program('appstream-util', required: false)
diff --git a/src/meson.build b/src/meson.build
index c0242d2..f59642d 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -44,6 +44,13 @@ js_sources = [
 js_xml = []
 foreach js_source : js_sources
   js_xml += '    <file>@0@</file>'.format(js_source)
+
+  if (js52.found())
+    test('Checking syntax of ' + js_source, js52,
+      args: ['-s', '-c', js_source],
+      workdir: meson.current_source_dir()
+    )
+  endif
 endforeach
 
 resource_data = configuration_data()


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