tools: ensure that `v test-cleancode` is always run in the vroot folder

pull/7965/head^2
Delyan Angelov 2021-01-09 19:25:50 +02:00
parent 8f315d226b
commit ca83746884
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 7 additions and 8 deletions

View File

@ -105,7 +105,6 @@ pub fn (mut ts TestSession) print_messages() {
pub fn new_test_session(_vargs string) TestSession { pub fn new_test_session(_vargs string) TestSession {
mut skip_files := []string{} mut skip_files := []string{}
skip_files << '_non_existing_'
$if solaris { $if solaris {
skip_files << 'examples/gg/gg2.v' skip_files << 'examples/gg/gg2.v'
skip_files << 'examples/pico/pico.v' skip_files << 'examples/pico/pico.v'

View File

@ -5,18 +5,14 @@ import testing
import v.util import v.util
const ( const (
vet_known_failing_exceptions = [ vet_known_failing_exceptions = []string{}
'nonexistent',
]
vet_folders = [ vet_folders = [
'vlib/sqlite', 'vlib/sqlite',
'vlib/v', 'vlib/v',
'cmd/v', 'cmd/v',
'cmd/tools', 'cmd/tools',
] ]
verify_known_failing_exceptions = [ verify_known_failing_exceptions = []string{}
'nonexistant',
]
vfmt_verify_list = [ vfmt_verify_list = [
'cmd/v/v.v', 'cmd/v/v.v',
'cmd/tools/vdoc/', 'cmd/tools/vdoc/',
@ -74,6 +70,10 @@ const (
] ]
) )
const vexe = os.getenv('VEXE')
const vroot = os.dir(vexe)
fn main() { fn main() {
args_string := os.args[1..].join(' ') args_string := os.args[1..].join(' ')
pass_args := args_string.all_before('test-cleancode') 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 { 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) util.prepare_tool_when_needed(tool_source)
testing.eheader('Run `$tool_cmd` over most .v files') testing.eheader('Run `$tool_cmd` over most .v files')
mut test_session := testing.new_test_session('$vargs $tool_args') mut test_session := testing.new_test_session('$vargs $tool_args')