From ca83746884c3e28843811abedc17ea3e6a689f6f Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 9 Jan 2021 19:25:50 +0200 Subject: [PATCH] tools: ensure that `v test-cleancode` is always run in the vroot folder --- cmd/tools/modules/testing/common.v | 1 - cmd/tools/vtest-cleancode.v | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index c7a2414208..2b541b34dd 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -105,7 +105,6 @@ pub fn (mut ts TestSession) print_messages() { pub fn new_test_session(_vargs string) TestSession { mut skip_files := []string{} - skip_files << '_non_existing_' $if solaris { skip_files << 'examples/gg/gg2.v' skip_files << 'examples/pico/pico.v' diff --git a/cmd/tools/vtest-cleancode.v b/cmd/tools/vtest-cleancode.v index 630506c0d7..bba6e675d0 100644 --- a/cmd/tools/vtest-cleancode.v +++ b/cmd/tools/vtest-cleancode.v @@ -5,18 +5,14 @@ import testing import v.util const ( - vet_known_failing_exceptions = [ - 'nonexistent', - ] + vet_known_failing_exceptions = []string{} vet_folders = [ 'vlib/sqlite', 'vlib/v', 'cmd/v', 'cmd/tools', ] - verify_known_failing_exceptions = [ - 'nonexistant', - ] + verify_known_failing_exceptions = []string{} vfmt_verify_list = [ 'cmd/v/v.v', 'cmd/tools/vdoc/', @@ -74,6 +70,10 @@ const ( ] ) +const vexe = os.getenv('VEXE') + +const vroot = os.dir(vexe) + fn main() { args_string := os.args[1..].join(' ') pass_args := args_string.all_before('test-cleancode') @@ -81,7 +81,7 @@ fn main() { } fn tsession(vargs string, tool_source string, tool_cmd string, tool_args string, flist []string, slist []string) testing.TestSession { - testing.setup_new_vtmp_folder() + os.chdir(vroot) util.prepare_tool_when_needed(tool_source) testing.eheader('Run `$tool_cmd` over most .v files') mut test_session := testing.new_test_session('$vargs $tool_args')