1+ /*---------------------------------------------------------------------------------------------
2+ * Copyright (c) Microsoft Corporation. All rights reserved.
3+ * Licensed under the MIT License. See License.txt in the project root for license information.
4+ *--------------------------------------------------------------------------------------------*/
5+
6+ const cp = require ( 'child_process' ) ;
7+ const npm = process . platform === 'win32' ? 'npm.cmd' : 'npm' ;
8+ const integrationTests = process . platform === 'win32' ? '.\test-integration.bat' : './test-integration.sh' ;
9+
10+ function updateGrammar ( location ) {
11+ const result = cp . spawnSync ( npm , [ 'run' , 'update-grammar' ] , {
12+ cwd : location ,
13+ stdio : 'inherit'
14+ } ) ;
15+
16+ if ( result . error || result . status !== 0 ) {
17+ process . exit ( 1 ) ;
18+ }
19+ }
20+
21+ const extensions = [
22+ // 'bat' Grammar no longer available
23+ 'clojure' ,
24+ 'coffeescript' ,
25+ 'cpp' ,
26+ 'csharp' ,
27+ 'css' ,
28+ 'diff' ,
29+ 'docker' ,
30+ 'fsharp' ,
31+ 'gitsyntax' ,
32+ 'go' ,
33+ 'groovy' ,
34+ 'handlebars' ,
35+ 'hlsl' ,
36+ 'html' ,
37+ 'ini' ,
38+ 'java' ,
39+ // 'javascript', updated through JavaScript
40+ // 'json', customized
41+ 'less' ,
42+ 'lua' ,
43+ 'make' ,
44+ 'markdown' ,
45+ 'objective-c' ,
46+ 'perl' ,
47+ 'php' ,
48+ // 'powershell', grammar not ready yet, @daviwil will ping when ready
49+ 'pug' ,
50+ 'python' ,
51+ 'r' ,
52+ 'razor' ,
53+ 'ruby' ,
54+ 'rust' ,
55+ 'scss' ,
56+ 'shaderlab' ,
57+ 'shellscript' ,
58+ // 'sql', customized, PRs pending
59+ 'swift' ,
60+ 'typescript' ,
61+ 'vb' ,
62+ 'xml' ,
63+ 'yaml'
64+ ] ;
65+
66+ extensions . forEach ( extension => updateGrammar ( `extensions/${ extension } ` ) ) ;
67+
68+ // run integration tests
69+
70+ if ( process . platform === 'win32' ) {
71+ cp . spawn ( '.\scripts\test-integration.bat' , [ ] , { env : process . env , stdio : 'inherit' } ) ;
72+ } else {
73+ cp . spawn ( '/bin/bash' , [ './scripts/test-integration.sh' ] , { env : process . env , stdio : 'inherit' } ) ;
74+ }
0 commit comments