From 01c1892995ee89871e5625a15fc6e722306f90e1 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 4 May 2022 23:30:44 +0300 Subject: [PATCH] tools: fix building `vdoctor.v` with `v build-tools` --- cmd/tools/modules/testing/common.v | 5 +++-- cmd/tools/vbuild-examples.v | 3 ++- cmd/tools/vbuild-tools.v | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index c64afc739e..b7de224684 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -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 } } diff --git a/cmd/tools/vbuild-examples.v b/cmd/tools/vbuild-examples.v index 027ec1efe2..b11b21f777 100644 --- a/cmd/tools/vbuild-examples.v +++ b/cmd/tools/vbuild-examples.v @@ -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('/') diff --git a/cmd/tools/vbuild-tools.v b/cmd/tools/vbuild-tools.v index 6138612b9d..12793fcfc0 100644 --- a/cmd/tools/vbuild-tools.v +++ b/cmd/tools/vbuild-tools.v @@ -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)