From 39600564a9da7e22f5dc4573a43ed0d481d6c5fe Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Sun, 14 Apr 2024 06:52:42 +0200 Subject: [PATCH] tools: add check for unavailable files in vtest (#21272) --- cmd/tools/vtest-self.v | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmd/tools/vtest-self.v b/cmd/tools/vtest-self.v index baa1db3c66b52d..3e24ea00b94482 100644 --- a/cmd/tools/vtest-self.v +++ b/cmd/tools/vtest-self.v @@ -251,7 +251,6 @@ const skip_on_ubuntu_musl = [ 'vlib/v/tests/sql_statement_inside_fn_call_test.v', 'vlib/clipboard/clipboard_test.v', 'vlib/vweb/tests/vweb_test.v', - 'vlib/vweb/request_test.v', 'vlib/vweb/csrf/csrf_test.v', 'vlib/net/http/request_test.v', 'vlib/vweb/route_test.v', @@ -295,7 +294,6 @@ const skip_on_windows = [ 'vlib/net/ssl/ssl_compiles_test.v', 'vlib/net/mbedtls/mbedtls_compiles_test.v', 'vlib/vweb/tests/vweb_test.v', - 'vlib/vweb/request_test.v', 'vlib/vweb/route_test.v', 'vlib/sync/many_times_test.v', 'vlib/sync/once_test.v', @@ -357,8 +355,7 @@ fn main() { all_test_files << os.walk_ext(os.join_path(vroot, 'vlib'), '_test.c.v') if just_essential { - rooted_essential_list := essential_list.map(os.join_path(vroot, it)) - all_test_files = all_test_files.filter(rooted_essential_list.contains(it)) + all_test_files = essential_list.map(os.join_path(vroot, it)) } testing.eheader(title) mut tsession := testing.new_test_session(cmd_prefix, true) @@ -478,6 +475,14 @@ fn main() { $if !macos { tsession.skip_files << skip_on_non_macos } + mut unavailable_files := tsession.files.filter(!os.exists(it)) + unavailable_files << tsession.skip_files.filter(it != 'do_not_remove' && !os.exists(it)) + if unavailable_files.len > 0 { + for f in unavailable_files { + eprintln('failed to find file: ${f}') + } + exit(1) + } tsession.skip_files = tsession.skip_files.map(os.abs_path) tsession.test() eprintln(tsession.benchmark.total_message(title))