From 456a19f6d421cf50126c4876cc2c3a95ae2ed4a1 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 31 Jul 2021 12:35:05 +0300 Subject: [PATCH] ci: fix coutput_test.v on windows --- .github/workflows/ci.yml | 11 +++++++++++ vlib/v/gen/c/coutput_test.v | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c35bd720e9..3339dcd40c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -715,10 +715,16 @@ jobs: - name: v doctor run: | ./v doctor + - name: Verify `v test` works run: | .\v.exe cmd/tools/test_if_v_test_system_works.v .\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 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 - name: v doctor run: ./v doctor + - name: Verify `v test` works run: | .\v.exe cmd/tools/test_if_v_test_system_works.v .\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 run: ./v -stats .github\workflows\make_sure_ci_run_with_32bit_compiler_test.v diff --git a/vlib/v/gen/c/coutput_test.v b/vlib/v/gen/c/coutput_test.v index 140e6c09e6..7ba977fcdb 100644 --- a/vlib/v/gen/c/coutput_test.v +++ b/vlib/v/gen/c/coutput_test.v @@ -6,13 +6,14 @@ import v.util.vtest 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 diff_cmd = diff.find_working_diff_command() or { '' } fn test_out_files() ? { + eprintln('> vroot: $vroot') println(term.colorize(term.green, '> testing whether .out files match:')) os.chdir(vroot) 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 { - return path.replace(os.path_separator, '/').replace('$vroot/', '') + return path.replace(os.path_separator, '/').replace('$vroot/', '').replace('./', '') } fn ensure_compilation_succeeded(compilation os.Result) {