1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tools: make v test vlib and v test-self skip _test.js.v files, when node is not installed

This commit is contained in:
Delyan Angelov
2021-12-07 21:31:29 +02:00
parent c29a3cf6e8
commit 7bbc70820a
3 changed files with 45 additions and 5 deletions

View File

@ -19,6 +19,10 @@ pub const hide_oks = os.getenv('VTEST_HIDE_OK') == '1'
pub const fail_fast = os.getenv('VTEST_FAIL_FAST') == '1'
pub const is_node_present = os.execute('node --version').exit_code == 0
pub const all_processes = os.execute('ps ax').output.split_any('\r\n')
pub struct TestSession {
pub mut:
files []string
@ -551,3 +555,12 @@ pub fn get_test_details(file string) TestDetails {
}
return res
}
pub fn find_started_process(pname string) ?string {
for line in testing.all_processes {
if line.contains(pname) {
return line
}
}
return error('could not find process matching $pname')
}