ci: fix coutput_test.v on windows

pull/11005/head
Delyan Angelov 2021-07-31 12:35:05 +03:00
parent d2e28e8fc5
commit 456a19f6d4
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 14 additions and 2 deletions

View File

@ -715,10 +715,16 @@ jobs:
- name: v doctor - name: v doctor
run: | run: |
./v doctor ./v doctor
- name: Verify `v test` works - name: Verify `v test` works
run: | run: |
.\v.exe cmd/tools/test_if_v_test_system_works.v .\v.exe cmd/tools/test_if_v_test_system_works.v
.\cmd\tools\test_if_v_test_system_works.exe .\cmd\tools\test_if_v_test_system_works.exe
- name: Verify `v vlib/v/gen/c/coutput_test.v` works
run: |
.\v.exe vlib/v/gen/c/coutput_test.v
- name: Make sure running TCC64 instead of TCC32 - name: Make sure running TCC64 instead of TCC32
run: ./v test .github\workflows\make_sure_ci_run_with_64bit_compiler_test.v run: ./v test .github\workflows\make_sure_ci_run_with_64bit_compiler_test.v
@ -753,11 +759,16 @@ jobs:
run: .\v.exe -o v.c cmd/v && .\thirdparty\tcc\tcc.exe -Werror -w -ladvapi32 -bt10 v.c run: .\v.exe -o v.c cmd/v && .\thirdparty\tcc\tcc.exe -Werror -w -ladvapi32 -bt10 v.c
- name: v doctor - name: v doctor
run: ./v doctor run: ./v doctor
- name: Verify `v test` works - name: Verify `v test` works
run: | run: |
.\v.exe cmd/tools/test_if_v_test_system_works.v .\v.exe cmd/tools/test_if_v_test_system_works.v
.\cmd\tools\test_if_v_test_system_works.exe .\cmd\tools\test_if_v_test_system_works.exe
- name: Verify `v vlib/v/gen/c/coutput_test.v` works
run: |
.\v.exe vlib/v/gen/c/coutput_test.v
- name: Make sure running TCC32 instead of TCC64 - name: Make sure running TCC32 instead of TCC64
run: ./v -stats .github\workflows\make_sure_ci_run_with_32bit_compiler_test.v run: ./v -stats .github\workflows\make_sure_ci_run_with_32bit_compiler_test.v

View File

@ -6,13 +6,14 @@ import v.util.vtest
const vexe = @VEXE const vexe = @VEXE
const vroot = @VMODROOT const vroot = os.real_path(@VMODROOT).replace('./', '')
const testdata_folder = os.join_path(vroot, 'vlib', 'v', 'gen', 'c', 'testdata') const testdata_folder = os.join_path(vroot, 'vlib', 'v', 'gen', 'c', 'testdata')
const diff_cmd = diff.find_working_diff_command() or { '' } const diff_cmd = diff.find_working_diff_command() or { '' }
fn test_out_files() ? { fn test_out_files() ? {
eprintln('> vroot: $vroot')
println(term.colorize(term.green, '> testing whether .out files match:')) println(term.colorize(term.green, '> testing whether .out files match:'))
os.chdir(vroot) os.chdir(vroot)
output_path := os.join_path(os.temp_dir(), 'coutput', 'out') output_path := os.join_path(os.temp_dir(), 'coutput', 'out')
@ -147,7 +148,7 @@ fn normalize_panic_message(message string, vroot string) string {
} }
fn vroot_relative(path string) string { fn vroot_relative(path string) string {
return path.replace(os.path_separator, '/').replace('$vroot/', '') return path.replace(os.path_separator, '/').replace('$vroot/', '').replace('./', '')
} }
fn ensure_compilation_succeeded(compilation os.Result) { fn ensure_compilation_succeeded(compilation os.Result) {