tests: skip vlib/v/gen/js/jsgen_test.v when there is no `node --version` working

pull/8172/head
Delyan Angelov 2021-01-17 19:21:18 +02:00
parent 2677fcdf0c
commit fafd949770
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 11 additions and 0 deletions

View File

@ -103,8 +103,19 @@ pub fn (mut ts TestSession) print_messages() {
}
}
fn is_nodejs_working() bool {
node_res := os.exec('node --version') or { return false }
if node_res.exit_code != 0 {
return false
}
return true
}
pub fn new_test_session(_vargs string) TestSession {
mut skip_files := []string{}
if !is_nodejs_working() {
skip_files << 'vlib/v/gen/js/jsgen_test.v'
}
$if solaris {
skip_files << 'examples/gg/gg2.v'
skip_files << 'examples/pico/pico.v'