@@ -19,6 +19,7 @@ function showHelp() {
19
19
console . log ( " --help : show this message then quit" ) ;
20
20
console . log ( " --tests-folder [PATH] : location of the .GOML tests folder" ) ;
21
21
console . log ( " --jobs [NUMBER] : number of threads to run tests on" ) ;
22
+ console . log ( " --executable-path [PATH] : path of the browser's executable to be used" ) ;
22
23
}
23
24
24
25
function isNumeric ( s ) {
@@ -34,20 +35,25 @@ function parseOptions(args) {
34
35
"show_text" : false ,
35
36
"no_headless" : false ,
36
37
"jobs" : - 1 ,
38
+ "executable_path" : null ,
39
+ "no_sandbox" : false ,
37
40
} ;
38
41
var correspondances = {
39
42
"--doc-folder" : "doc_folder" ,
40
43
"--tests-folder" : "tests_folder" ,
41
44
"--debug" : "debug" ,
42
45
"--show-text" : "show_text" ,
43
46
"--no-headless" : "no_headless" ,
47
+ "--executable-path" : "executable_path" ,
48
+ "--no-sandbox" : "no_sandbox" ,
44
49
} ;
45
50
46
51
for ( var i = 0 ; i < args . length ; ++ i ) {
47
52
if ( args [ i ] === "--doc-folder"
48
53
|| args [ i ] === "--tests-folder"
49
54
|| args [ i ] === "--file"
50
- || args [ i ] === "--jobs" ) {
55
+ || args [ i ] === "--jobs"
56
+ || args [ i ] === "--executable-path" ) {
51
57
i += 1 ;
52
58
if ( i >= args . length ) {
53
59
console . log ( "Missing argument after `" + args [ i - 1 ] + "` option." ) ;
@@ -68,6 +74,9 @@ function parseOptions(args) {
68
74
} else if ( args [ i ] === "--help" ) {
69
75
showHelp ( ) ;
70
76
process . exit ( 0 ) ;
77
+ } else if ( args [ i ] === "--no-sandbox" ) {
78
+ console . log ( "`--no-sandbox` is being used. Be very careful!" ) ;
79
+ opts [ correspondances [ args [ i ] ] ] = true ;
71
80
} else if ( correspondances [ args [ i ] ] ) {
72
81
opts [ correspondances [ args [ i ] ] ] = true ;
73
82
} else {
@@ -147,10 +156,17 @@ async function main(argv) {
147
156
if ( opts [ "show_text" ] ) {
148
157
args . push ( "--show-text" ) ;
149
158
}
159
+ if ( opts [ "no_sandbox" ] ) {
160
+ args . push ( "--no-sandbox" ) ;
161
+ }
150
162
if ( opts [ "no_headless" ] ) {
151
163
args . push ( "--no-headless" ) ;
152
164
headless = false ;
153
165
}
166
+ if ( opts [ "executable_path" ] !== null ) {
167
+ args . push ( "--executable-path" ) ;
168
+ args . push ( opts [ "executable_path" ] ) ;
169
+ }
154
170
options . parseArguments ( args ) ;
155
171
} catch ( error ) {
156
172
console . error ( `invalid argument: ${ error } ` ) ;
0 commit comments