From dd1ad2b6abfa62a9695e4e04d4827bff137ff94e Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 30 Apr 2026 08:13:27 +0300 Subject: [PATCH] all: fix more tests --- .github/workflows/windows-install-sqlite.bat | 3 +-- cmd/tools/changelog_helper.v | 6 ------ cmd/tools/vgit-fmt-hook.v | 4 +++- cmd/tools/vsetup-freetype.v | 6 ++---- cmd/tools/vtest-all.v | 4 ++-- cmd/tools/vtest-parser.v | 3 --- 6 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/windows-install-sqlite.bat b/.github/workflows/windows-install-sqlite.bat index ad03efc06..45dd54090 100644 --- a/.github/workflows/windows-install-sqlite.bat +++ b/.github/workflows/windows-install-sqlite.bat @@ -1,4 +1,3 @@ REM This file should be run from the top folder of the V compiler itself. -python .github\workflows\windows-install-sqlite.py -exit /b %ERRORLEVEL% +v vlib/db/sqlite/install_thirdparty_sqlite.vsh diff --git a/cmd/tools/changelog_helper.v b/cmd/tools/changelog_helper.v index 63746edff..646d437f8 100644 --- a/cmd/tools/changelog_helper.v +++ b/cmd/tools/changelog_helper.v @@ -76,17 +76,11 @@ mut: const is_interactive = false -// Instantly updates CHANGELOG.md without confirming each line -fn no_interactive(_version string) { -} - fn main() { mut version := '' if os.args.len == 2 && os.args[1].starts_with('0.') { version = os.args[1] - // no_interactive(version) - // return } else { println('Usage: v run tools/changelog_helper.v 0.4.5') return diff --git a/cmd/tools/vgit-fmt-hook.v b/cmd/tools/vgit-fmt-hook.v index ad83c0904..203f40c56 100644 --- a/cmd/tools/vgit-fmt-hook.v +++ b/cmd/tools/vgit-fmt-hook.v @@ -4,7 +4,6 @@ import crypto.sha256 const vexe = os.getenv_opt('VEXE') or { panic('missing VEXE env variable') } const vroot = os.to_slash(os.real_path(os.dir(vexe))) const horiginal = os.to_slash(os.join_path(vroot, 'cmd/tools/git_pre_commit_hook.vsh')) -const shoriginal = os.join_path(os.vtmp_dir(), 'git_pre_commit_hook.sh') fn get_hook_target(git_folder string) string { return os.to_slash(os.join_path(git_folder, 'hooks/pre-commit')) @@ -15,6 +14,7 @@ fn main() { // to run cmd/tools/git_pre_commit_hook.vsh // TODO: detect other OS (BusyBox) without support for 'env -S' $if openbsd { + shoriginal := os.join_path(os.vtmp_dir(), 'git_pre_commit_hook.sh') os.write_file(shoriginal, '#!/bin/sh\nv run ${horiginal}') or { eprintln('unable to write shell script ${shoriginal}') exit(1) @@ -55,6 +55,7 @@ fn cmd_install(htarget string) { } println('> Installing the newest version of ${horiginal} over ${htarget} ...') $if openbsd { + shoriginal := os.join_path(os.vtmp_dir(), 'git_pre_commit_hook.sh') os.cp(shoriginal, htarget) or { err_exit('failed to copy to ${htarget}') } } $else { os.cp(horiginal, htarget) or { err_exit('failed to copy to ${htarget}') } @@ -76,6 +77,7 @@ fn cmd_remove(htarget string) { fn report_status(htarget string, show_instructions bool) bool { mut original := '' $if openbsd { + shoriginal := os.join_path(os.vtmp_dir(), 'git_pre_commit_hook.sh') original = shoriginal } $else { original = horiginal diff --git a/cmd/tools/vsetup-freetype.v b/cmd/tools/vsetup-freetype.v index 52398852d..9e1503488 100644 --- a/cmd/tools/vsetup-freetype.v +++ b/cmd/tools/vsetup-freetype.v @@ -2,15 +2,13 @@ module main import os -const freetype_repo_url = 'https://github.com/ubawurinna/freetype-windows-binaries' - -const freetype_folder = os.join_path('thirdparty', 'freetype') - fn main() { $if windows { println('Setup freetype...') vexe := os.real_path(os.getenv_opt('VEXE') or { @VEXE }) vroot := os.dir(vexe) + freetype_repo_url := 'https://github.com/ubawurinna/freetype-windows-binaries' + freetype_folder := os.join_path('thirdparty', 'freetype') os.chdir(vroot)! if os.is_dir(freetype_folder) { println('Thirdparty "freetype" is already installed.') diff --git a/cmd/tools/vtest-all.v b/cmd/tools/vtest-all.v index 6ff08dc5a..28f72eafe 100644 --- a/cmd/tools/vtest-all.v +++ b/cmd/tools/vtest-all.v @@ -20,8 +20,6 @@ const vargs = args_string.all_before('test-all') const vtest_nocleanup = os.getenv('VTEST_NOCLEANUP').bool() -const l2w_crosscc = os.find_abs_path_of_executable('x86_64-w64-mingw32-gcc-win32') or { '' } - const clang_path = os.find_abs_path_of_executable('clang') or { '' } fn main() { @@ -87,6 +85,7 @@ fn get_all_commands() []Command { rmfile: 'examples/hello_world' } $if linux { + l2w_crosscc := os.find_abs_path_of_executable('x86_64-w64-mingw32-gcc-win32') or { '' } if l2w_crosscc != '' { res << Command{ line: '${vexe} -os windows examples/hello_world.v' @@ -265,6 +264,7 @@ fn get_all_commands() []Command { } // Test cross compilation to windows with -shared: $if linux { + l2w_crosscc := os.find_abs_path_of_executable('x86_64-w64-mingw32-gcc-win32') or { '' } if l2w_crosscc != '' { res << Command{ line: '${vexe} -os windows ${common_shared_flags}' diff --git a/cmd/tools/vtest-parser.v b/cmd/tools/vtest-parser.v index 1321b0f66..327d3b96c 100644 --- a/cmd/tools/vtest-parser.v +++ b/cmd/tools/vtest-parser.v @@ -6,11 +6,8 @@ import v.parser import v.ast import v.pref -const vexe = os.real_path(os.getenv_opt('VEXE') or { @VEXE }) -const vroot = os.dir(vexe) const support_color = term.can_show_color_on_stderr() && term.can_show_color_on_stdout() const ecode_timeout = 101 -const ecode_memout = 102 const ecode_details = { -1: 'worker executable not found' 101: 'too slow' -- 2.39.5