tools: fix building `vdoctor.v` with `v build-tools`

master
Delyan Angelov 2022-05-04 23:30:44 +03:00
parent a6b3e5d6a5
commit 01c1892995
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
3 changed files with 6 additions and 4 deletions

View File

@ -471,7 +471,7 @@ pub fn prepare_test_session(zargs string, folder string, oskipped []string, main
// for example module import tests, or subtests, that are compiled/run by other parent tests
// in specific configurations, etc.
if fnormalised.contains('testdata/') || fnormalised.contains('modules/')
|| f.contains('preludes/') {
|| fnormalised.contains('preludes/') {
continue
}
$if windows {
@ -489,7 +489,8 @@ pub fn prepare_test_session(zargs string, folder string, oskipped []string, main
skipped << skipped_f
}
for skip_prefix in oskipped {
if f.starts_with(skip_prefix) {
skip_folder := skip_prefix + '/'
if fnormalised.starts_with(skip_folder) {
continue next_file
}
}

View File

@ -12,7 +12,8 @@ const efolders = [
fn main() {
args_string := os.args[1..].join(' ')
params := args_string.all_before('build-examples')
skip_prefixes := efolders.map(os.real_path(os.join_path_single(vroot, it)))
skip_prefixes := efolders.map(os.real_path(os.join_path_single(vroot, it)).replace('\\',
'/'))
res := testing.v_build_failing_skipped(params, 'examples', skip_prefixes, fn (mut session testing.TestSession) {
for x in efolders {
pathsegments := x.split_any('/')

View File

@ -31,7 +31,7 @@ fn main() {
//
mut skips := []string{}
for stool in tools_in_subfolders {
skips << os.join_path(tfolder, stool)
skips << os.join_path(tfolder, stool).replace('\\', '/')
}
buildopts := args_string.all_before('build-tools')
mut session := testing.prepare_test_session(buildopts, folder, skips, main_label)