Skip to content

Commit 359b674

Browse files
committed
ci: fix more failing tests
1 parent 9057e9f commit 359b674

File tree

13 files changed

+19
-18
lines changed

13 files changed

+19
-18
lines changed

cmd/tools/vtest-all.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ fn get_all_commands() []Command {
210210
rmfile: 'examples/tetris/tetris'
211211
}
212212
$if macos || linux {
213+
ipath := '$vroot/thirdparty/stdatomic/nix'
213214
res << Command{
214-
line: '$vexe -o v.c cmd/v && cc -Werror -I "$vroot/thirdparty/stdatomic/nix" v.c -lpthread -lm && rm -rf a.out'
215+
line: '$vexe -o v.c cmd/v && cc -Werror -I ${os.quoted_path(ipath)} v.c -lpthread -lm && rm -rf a.out'
215216
label: 'v.c should be buildable with no warnings...'
216217
okmsg: 'v.c can be compiled without warnings. This is good :)'
217218
rmfile: 'v.c'

vlib/gg/draw_fns_api_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn test_all_samples_can_be_compiled() {
66
samples := os.walk_ext('$vroot/vlib/gg/testdata', '.vv')
77
mut fails := []string{}
88
for program_source in samples {
9-
compile_cmd := '"$vexe" "$program_source"'
9+
compile_cmd := '${os.quoted_path(vexe)} ${os.quoted_path(program_source)}'
1010
res := os.execute(compile_cmd)
1111
if res.exit_code != 0 {
1212
eprintln('>>> FAIL $compile_cmd')

vlib/v/compiler_errors_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ fn (mut task TaskDescription) execute() {
295295
return
296296
}
297297
program := task.path
298-
cli_cmd := '$task.vexe $task.voptions $program'
298+
cli_cmd := '${os.quoted_path(task.vexe)} $task.voptions ${os.quoted_path(program)}'
299299
res := os.execute(cli_cmd)
300300
expected_out_path := program.replace('.vv', '') + task.result_extension
301301
task.expected_out_path = expected_out_path

vlib/v/eval/interpret_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn test_interpret() ? {
2424
full_test_path := os.real_path(os.join_path(dir, test))
2525
test_file_name := os.file_name(test)
2626
relative_test_path := full_test_path.replace(vroot + '/', '')
27-
cmd := '"$vexe" interpret "$full_test_path"'
27+
cmd := '${os.quoted_path(vexe)} interpret ${os.quoted_path(full_test_path)}'
2828
if is_verbose {
2929
println(cmd)
3030
}

vlib/v/gen/native/tests/native_test.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn test_native() {
3636
relative_test_path := full_test_path.replace(vroot + '/', '')
3737
work_test_path := '$wrkdir/$test_file_name'
3838
exe_test_path := '$wrkdir/${test_file_name}.exe'
39-
cmd := '"$vexe" -o "$exe_test_path" -b native "$full_test_path"'
39+
cmd := '${os.quoted_path(vexe)} -o ${os.quoted_path(exe_test_path)} -b native ${os.quoted_path(full_test_path)}'
4040
if is_verbose {
4141
println(cmd)
4242
}
@@ -47,7 +47,7 @@ fn test_native() {
4747
continue
4848
}
4949
tmperrfile := '$dir/${test}.tmperr'
50-
res := os.execute('$exe_test_path 2> $tmperrfile')
50+
res := os.execute('${os.quoted_path(exe_test_path)} 2> ${os.quoted_path(tmperrfile)}')
5151
if res.exit_code != 0 {
5252
bench.fail()
5353
eprintln(bench.step_message_fail('$full_test_path failed to run'))

vlib/v/live/executable/reloader.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn compile_and_reload_shared_lib(mut r live.LiveReloadInfo) ?bool {
6666

6767
fn compile_lib(mut r live.LiveReloadInfo) ?string {
6868
new_lib_path, new_lib_path_with_extension := current_shared_library_path(mut r)
69-
cmd := '$r.vexe $r.vopts -o $new_lib_path $r.original'
69+
cmd := '${os.quoted_path(r.vexe)} $r.vopts -o ${os.quoted_path(new_lib_path)} ${os.quoted_path(r.original)}'
7070
elog(r, '> compilation cmd: $cmd')
7171
cwatch := time.new_stopwatch()
7272
recompilation_result := os.execute(cmd)

vlib/v/pref/pref.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
688688
mut output_option := ''
689689
if tmp_exe_file_path == '' {
690690
tmp_exe_file_path = '${tmp_file_path}.exe'
691-
output_option = '-o "$tmp_exe_file_path"'
691+
output_option = '-o ${os.quoted_path(tmp_exe_file_path)} '
692692
}
693693
tmp_v_file_path := '${tmp_file_path}.v'
694694
contents := os.get_raw_lines_joined()
@@ -698,7 +698,7 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
698698
run_options := cmdline.options_before(args, ['run']).join(' ')
699699
command_options := cmdline.options_after(args, ['run'])[1..].join(' ')
700700
vexe := vexe_path()
701-
tmp_cmd := '"$vexe" $output_option $run_options run "$tmp_v_file_path" $command_options'
701+
tmp_cmd := '${os.quoted_path(vexe)} $output_option $run_options run ${os.quoted_path(tmp_v_file_path)} $command_options'
702702
//
703703
res.vrun_elog('tmp_cmd: $tmp_cmd')
704704
tmp_result := os.system(tmp_cmd)

vlib/v/tests/projects_that_should_compile_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn vroot_path(relpath string) string {
99
}
1010

1111
fn vrun_ok(options string, path string) string {
12-
cmd := '${@VEXE} $options $path'
12+
cmd := '${os.quoted_path(@VEXE)} $options ${os.quoted_path(path)}'
1313
res := os.execute(cmd)
1414
if res.exit_code != 0 {
1515
eprintln('> failing vrun cmd: $cmd')

vlib/v/tests/repl/repl_test.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ fn test_the_v_compiler_can_be_invoked() {
1111
vexec := runner.full_path_to_v(5)
1212
println('vexecutable: $vexec')
1313
assert vexec != ''
14-
vcmd := '"$vexec" -version'
14+
vcmd := '${os.quoted_path(vexec)} -version'
1515
r := os.execute_or_exit(vcmd)
1616
assert r.exit_code == 0
1717
// println('"$vcmd" exit_code: $r.exit_code | output: $r.output')
18-
vcmd_error := '"$vexec" nonexisting.v'
18+
vcmd_error := '${os.quoted_path(vexec)} nonexisting.v'
1919
r_error := os.execute(vcmd_error)
2020
if r_error.exit_code < 0 {
2121
panic(r_error.output)

vlib/v/tests/repl/runner/runner.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub fn run_repl_file(wd string, vexec string, file string) ?string {
4949
input_temporary_filename := os.real_path(os.join_path(wd, 'input_temporary_filename.txt'))
5050
os.write_file(input_temporary_filename, input) or { panic(err) }
5151
os.write_file(os.real_path(os.join_path(wd, 'original.txt')), fcontent) or { panic(err) }
52-
rcmd := '"$vexec" repl -replfolder "$wd" -replprefix "${fname}." < $input_temporary_filename'
52+
rcmd := '${os.quoted_path(vexec)} repl -replfolder ${os.quoted_path(wd)} -replprefix "${fname}." < ${os.quoted_path(input_temporary_filename)}'
5353
r := os.execute(rcmd)
5454
if r.exit_code < 0 {
5555
os.rm(input_temporary_filename) ?
@@ -84,7 +84,7 @@ pub fn run_prod_file(wd string, vexec string, file string) ?string {
8484
return error('Could not read expected prod file $file_expected')
8585
}
8686
expected_content := f_expected_content.replace('\r', '')
87-
cmd := '"$vexec" -prod run "$file"'
87+
cmd := '${os.quoted_path(vexec)} -prod run ${os.quoted_path(file)}'
8888
r := os.execute(cmd)
8989
if r.exit_code < 0 {
9090
return error('Could not execute: $cmd')

0 commit comments

Comments
 (0)