From 554f82254a79487de2eaa11f661279eaf8072746 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 7 Dec 2025 13:27:51 +0200 Subject: [PATCH] tools: use local `vtest build:` tags to eliminate the need for the skip_fsanitize_too_slow list in vtest-self.v --- cmd/tools/vdoc/document/doc_test.v | 2 +- cmd/tools/vpm/dependency_test.v | 1 - cmd/tools/vpm/install_test.v | 1 + cmd/tools/vpm/install_version_input_test.v | 1 + cmd/tools/vpm/install_version_test.v | 1 + cmd/tools/vpm/update_test.v | 1 + cmd/tools/vtest-self.v | 29 ---------------------- vlib/v/compiler_errors_test.v | 2 +- vlib/v/fmt/fmt_keep_test.v | 4 +-- vlib/v/fmt/fmt_test.v | 6 ++--- vlib/v/fmt/fmt_vlib_test.v | 4 +-- vlib/v/live/live_test.v | 1 + vlib/v/parser/v_parser_test.v | 2 +- vlib/v/scanner/scanner_test.v | 4 +-- vlib/v/slow_tests/inout/compiler_test.v | 2 +- vlib/v/slow_tests/prod_test.v | 2 ++ vlib/v/slow_tests/profile/profile_test.v | 2 +- vlib/v/slow_tests/repl/repl_test.v | 1 + vlib/v/slow_tests/valgrind/valgrind_test.v | 1 + 19 files changed, 19 insertions(+), 48 deletions(-) diff --git a/cmd/tools/vdoc/document/doc_test.v b/cmd/tools/vdoc/document/doc_test.v index 1f1d5bdbf..cd9796db7 100644 --- a/cmd/tools/vdoc/document/doc_test.v +++ b/cmd/tools/vdoc/document/doc_test.v @@ -1,4 +1,4 @@ -// import v.ast +// vtest build: tinyc && !musl? && !sanitized_job? import document as doc // fn test_generate_with_pos() {} diff --git a/cmd/tools/vpm/dependency_test.v b/cmd/tools/vpm/dependency_test.v index 3fea912e1..69d52cab4 100644 --- a/cmd/tools/vpm/dependency_test.v +++ b/cmd/tools/vpm/dependency_test.v @@ -1,4 +1,3 @@ -// vtest retry: 3 import os import time import rand diff --git a/cmd/tools/vpm/install_test.v b/cmd/tools/vpm/install_test.v index 3eeb09ab7..f83b7b01b 100644 --- a/cmd/tools/vpm/install_test.v +++ b/cmd/tools/vpm/install_test.v @@ -1,3 +1,4 @@ +// vtest build: !musl? && !sanitized_job? // vtest retry: 3 module main diff --git a/cmd/tools/vpm/install_version_input_test.v b/cmd/tools/vpm/install_version_input_test.v index da8f972f4..efd8d8be8 100644 --- a/cmd/tools/vpm/install_version_input_test.v +++ b/cmd/tools/vpm/install_version_input_test.v @@ -1,3 +1,4 @@ +// vtest build: !musl? && !sanitized_job? // vtest retry: 3 import os import rand diff --git a/cmd/tools/vpm/install_version_test.v b/cmd/tools/vpm/install_version_test.v index 99532f0d1..8437fafb7 100644 --- a/cmd/tools/vpm/install_version_test.v +++ b/cmd/tools/vpm/install_version_test.v @@ -1,3 +1,4 @@ +// vtest build: !musl? && !sanitized_job? // vtest retry: 3 module main diff --git a/cmd/tools/vpm/update_test.v b/cmd/tools/vpm/update_test.v index ae58c682e..209c82df9 100644 --- a/cmd/tools/vpm/update_test.v +++ b/cmd/tools/vpm/update_test.v @@ -1,3 +1,4 @@ +// vtest build: !musl? && !sanitized_job? // vtest retry: 3 import os import rand diff --git a/cmd/tools/vtest-self.v b/cmd/tools/vtest-self.v index c2474f55c..9b4d73fef 100644 --- a/cmd/tools/vtest-self.v +++ b/cmd/tools/vtest-self.v @@ -5,7 +5,6 @@ import testing struct Config { run_just_essential bool = '${os.getenv('VTEST_JUST_ESSENTIAL')}${os.getenv('VTEST_SANDBOXED_PACKAGING')}' != '' - run_slow_sanitize bool = os.getenv('VTEST_RUN_FSANITIZE_TOO_SLOW') != '' is_musl_ci bool = os.getenv('V_CI_MUSL') != '' is_ubuntu_musl_ci bool = os.getenv('V_CI_UBUNTU_MUSL') != '' is_sandboxed_packaging bool = os.getenv('VTEST_SANDBOXED_PACKAGING') != '' @@ -97,28 +96,6 @@ const essential_list = [ 'vlib/v/slow_tests/inout/compiler_test.v', 'vlib/x/json2/tests/json2_test.v', ] -// These tests are too slow to be run in the CI on each PR/commit in the sanitized modes: -const skip_fsanitize_too_slow = [ - 'do_not_remove', - 'vlib/v/compiler_errors_test.v', - 'vlib/v/fmt/fmt_test.v', - 'vlib/v/fmt/fmt_keep_test.v', - 'vlib/v/fmt/fmt_vlib_test.v', - 'vlib/v/live/live_test.v', - 'vlib/v/parser/v_parser_test.v', - 'vlib/v/scanner/scanner_test.v', - 'vlib/v/slow_tests/inout/compiler_test.v', - 'vlib/v/slow_tests/prod_test.v', - 'vlib/v/slow_tests/profile/profile_test.v', - 'vlib/v/slow_tests/repl/repl_test.v', - 'vlib/v/slow_tests/valgrind/valgrind_test.v', - 'cmd/tools/vpm/dependency_test.v', - 'cmd/tools/vpm/install_test.v', - 'cmd/tools/vpm/install_version_input_test.v', - 'cmd/tools/vpm/install_version_test.v', - 'cmd/tools/vpm/update_test.v', - 'cmd/tools/vdoc/document/doc_test.v', -] const skip_with_fsanitize_memory = [ 'do_not_remove', 'cmd/tools/vpm/dependency_test.v', // known flaky, for fsanitize_memory, due to using mbedtls @@ -360,12 +337,6 @@ fn main() { mut tsession := testing.new_test_session(vargs.join(' '), true) tsession.exec_mode = .compile_and_run tsession.files << all_test_files.filter(!it.contains('testdata' + os.path_separator)) - if !cfg.run_slow_sanitize - && ((cfg.sanitize_undefined || cfg.sanitize_memory || cfg.sanitize_address) - || (cfg.is_msan_compiler || cfg.is_asan_compiler || cfg.is_ubsan_compiler)) { - tsession.skip_files << skip_fsanitize_too_slow - tsession.custom_defines << 'self_sanitize_too_slow' - } if cfg.werror { tsession.custom_defines << 'self_werror' } diff --git a/vlib/v/compiler_errors_test.v b/vlib/v/compiler_errors_test.v index 59ca16499..d695333f6 100644 --- a/vlib/v/compiler_errors_test.v +++ b/vlib/v/compiler_errors_test.v @@ -1,4 +1,4 @@ -// vtest build: !self_sandboxed_packaging? +// vtest build: !self_sandboxed_packaging? && !sanitized_job? import os import term import v.util.diff diff --git a/vlib/v/fmt/fmt_keep_test.v b/vlib/v/fmt/fmt_keep_test.v index 088fbe14d..43fe866e6 100644 --- a/vlib/v/fmt/fmt_keep_test.v +++ b/vlib/v/fmt/fmt_keep_test.v @@ -1,6 +1,4 @@ -// Copyright (c) 2019-2024 Alexander Medvednikov. All rights reserved. -// Use of this source code is governed by an MIT license -// that can be found in the LICENSE file. +// vtest build: !sanitized_job? import os import term import benchmark diff --git a/vlib/v/fmt/fmt_test.v b/vlib/v/fmt/fmt_test.v index 8528fc5cc..33dae3848 100644 --- a/vlib/v/fmt/fmt_test.v +++ b/vlib/v/fmt/fmt_test.v @@ -1,6 +1,4 @@ -// Copyright (c) 2019-2024 Alexander Medvednikov. All rights reserved. -// Use of this source code is governed by an MIT license -// that can be found in the LICENSE file. +// vtest build: !sanitized_job? import os import term import benchmark @@ -12,7 +10,7 @@ import v.util.diff import v.util.vtest const vroot = @VEXEROOT -const tdir = os.join_path(vroot, 'vlib', 'v', 'fmt') +const tdir = os.join_path(vroot, 'vlib/v/fmt') const fpref = &pref.Preferences{ is_fmt: true } diff --git a/vlib/v/fmt/fmt_vlib_test.v b/vlib/v/fmt/fmt_vlib_test.v index 3e3f8cf72..a8d13fea7 100644 --- a/vlib/v/fmt/fmt_vlib_test.v +++ b/vlib/v/fmt/fmt_vlib_test.v @@ -1,6 +1,4 @@ -// Copyright (c) 2019-2024 Alexander Medvednikov. All rights reserved. -// Use of this source code is governed by an MIT license -// that can be found in the LICENSE file. +// vtest build: !sanitized_job? import os import term import benchmark diff --git a/vlib/v/live/live_test.v b/vlib/v/live/live_test.v index 36b86a4d8..c9ef300aa 100644 --- a/vlib/v/live/live_test.v +++ b/vlib/v/live/live_test.v @@ -1,3 +1,4 @@ +// vtest build: !sanitized_job? // vtest retry: 4 import os import log diff --git a/vlib/v/parser/v_parser_test.v b/vlib/v/parser/v_parser_test.v index 16ae57c9f..d42ab76a0 100644 --- a/vlib/v/parser/v_parser_test.v +++ b/vlib/v/parser/v_parser_test.v @@ -1,4 +1,4 @@ -// vtest build: tinyc +// vtest build: tinyc && !sanitized_job? module parser // import v.eval diff --git a/vlib/v/scanner/scanner_test.v b/vlib/v/scanner/scanner_test.v index 7e2eb5111..daf8497d8 100644 --- a/vlib/v/scanner/scanner_test.v +++ b/vlib/v/scanner/scanner_test.v @@ -1,6 +1,4 @@ -// Copyright (c) 2019-2024 Alexander Medvednikov. All rights reserved. -// Use of this source code is governed by an MIT license -// that can be found in the LICENSE file. +// vtest build: !sanitized_job? module scanner import v.token diff --git a/vlib/v/slow_tests/inout/compiler_test.v b/vlib/v/slow_tests/inout/compiler_test.v index 2139b5555..3d18f3cda 100644 --- a/vlib/v/slow_tests/inout/compiler_test.v +++ b/vlib/v/slow_tests/inout/compiler_test.v @@ -1,4 +1,4 @@ -// vtest build: !self_sandboxed_packaging? +// vtest build: !self_sandboxed_packaging? && !sanitized_job? // .out file: // To test a panic, remove everything after the long `===` line // You can also remove the line with 'line:' e.g. for a builtin fn diff --git a/vlib/v/slow_tests/prod_test.v b/vlib/v/slow_tests/prod_test.v index 3037d4c7f..ef81ffa03 100644 --- a/vlib/v/slow_tests/prod_test.v +++ b/vlib/v/slow_tests/prod_test.v @@ -1,3 +1,5 @@ +// vtest build: tinyc && !sanitized_job? + // Build and run files in ./prod/ folder, comparing their output to *.expected.txt files. // (Similar to REPL tests, but in -prod mode.) import v.slow_tests.repl.runner diff --git a/vlib/v/slow_tests/profile/profile_test.v b/vlib/v/slow_tests/profile/profile_test.v index 676c8df94..e4f215c63 100644 --- a/vlib/v/slow_tests/profile/profile_test.v +++ b/vlib/v/slow_tests/profile/profile_test.v @@ -1,4 +1,4 @@ -// vtest build: !musl? +// vtest build: !musl? && !sanitized_job? import os import time diff --git a/vlib/v/slow_tests/repl/repl_test.v b/vlib/v/slow_tests/repl/repl_test.v index d69300f0e..853a6f76c 100644 --- a/vlib/v/slow_tests/repl/repl_test.v +++ b/vlib/v/slow_tests/repl/repl_test.v @@ -1,3 +1,4 @@ +// vtest build: !musl? && !sanitized_job? module main import os diff --git a/vlib/v/slow_tests/valgrind/valgrind_test.v b/vlib/v/slow_tests/valgrind/valgrind_test.v index 0bd937722..da0250d01 100644 --- a/vlib/v/slow_tests/valgrind/valgrind_test.v +++ b/vlib/v/slow_tests/valgrind/valgrind_test.v @@ -1,3 +1,4 @@ +// vtest build: !musl? && !sanitized_job? import os import term import benchmark -- 2.39.5