2020-04-05 12:40:17 +03:00
|
|
|
module main
|
|
|
|
|
|
|
|
import os
|
|
|
|
import testing
|
|
|
|
|
2021-06-14 13:10:20 +03:00
|
|
|
const github_job = os.getenv('GITHUB_JOB')
|
|
|
|
|
2022-06-09 15:25:11 +03:00
|
|
|
const just_essential = os.getenv('VTEST_JUST_ESSENTIAL') != ''
|
|
|
|
|
2020-04-05 12:40:17 +03:00
|
|
|
const (
|
2022-06-09 15:25:11 +03:00
|
|
|
essential_list = [
|
|
|
|
'cmd/tools/vvet/vet_test.v',
|
|
|
|
'vlib/arrays/arrays_test.v',
|
|
|
|
'vlib/bitfield/bitfield_test.v',
|
|
|
|
//
|
|
|
|
'vlib/builtin/int_test.v',
|
|
|
|
'vlib/builtin/array_test.v',
|
|
|
|
'vlib/builtin/float_test.v',
|
|
|
|
'vlib/builtin/byte_test.v',
|
|
|
|
'vlib/builtin/rune_test.v',
|
|
|
|
'vlib/builtin/builtin_test.v',
|
|
|
|
'vlib/builtin/map_of_floats_test.v',
|
|
|
|
'vlib/builtin/string_int_test.v',
|
|
|
|
'vlib/builtin/utf8_test.v',
|
|
|
|
'vlib/builtin/map_test.v',
|
|
|
|
'vlib/builtin/string_test.v',
|
|
|
|
'vlib/builtin/sorting_test.v',
|
|
|
|
'vlib/builtin/gated_array_string_test.v',
|
|
|
|
'vlib/builtin/array_shrinkage_test.v',
|
|
|
|
'vlib/builtin/isnil_test.v',
|
|
|
|
'vlib/builtin/string_match_glob_test.v',
|
|
|
|
'vlib/builtin/string_strip_margin_test.v',
|
|
|
|
//
|
|
|
|
'vlib/cli/command_test.v',
|
|
|
|
'vlib/crypto/md5/md5_test.v',
|
|
|
|
'vlib/dl/dl_test.v',
|
|
|
|
'vlib/encoding/base64/base64_test.v',
|
|
|
|
'vlib/encoding/utf8/encoding_utf8_test.v',
|
|
|
|
'vlib/encoding/utf8/utf8_util_test.v',
|
|
|
|
'vlib/flag/flag_test.v',
|
|
|
|
'vlib/json/json_decode_test.v',
|
|
|
|
'vlib/math/math_test.v',
|
|
|
|
'vlib/net/tcp_test.v',
|
|
|
|
'vlib/net/http/http_test.v',
|
|
|
|
'vlib/net/http/server_test.v',
|
|
|
|
'vlib/net/http/request_test.v',
|
|
|
|
'vlib/io/io_test.v',
|
|
|
|
'vlib/io/os_file_reader_test.v',
|
|
|
|
'vlib/os/process_test.v',
|
|
|
|
'vlib/os/file_test.v',
|
|
|
|
'vlib/os/notify/notify_test.v',
|
|
|
|
'vlib/os/filepath_test.v',
|
|
|
|
'vlib/os/environment_test.v',
|
|
|
|
'vlib/os/glob_test.v',
|
|
|
|
'vlib/os/os_test.v',
|
|
|
|
'vlib/rand/random_numbers_test.v',
|
|
|
|
'vlib/rand/wyrand/wyrand_test.v',
|
|
|
|
'vlib/runtime/runtime_test.v',
|
|
|
|
'vlib/semver/semver_test.v',
|
|
|
|
'vlib/sync/stdatomic/atomic_test.v',
|
|
|
|
'vlib/sync/thread_test.v',
|
|
|
|
'vlib/sync/waitgroup_test.v',
|
|
|
|
'vlib/sync/pool/pool_test.v',
|
|
|
|
'vlib/strings/builder_test.v',
|
|
|
|
'vlib/strconv/atof_test.v',
|
|
|
|
'vlib/strconv/atoi_test.v',
|
|
|
|
'vlib/strconv/f32_f64_to_string_test.v',
|
|
|
|
'vlib/strconv/format_test.v',
|
|
|
|
'vlib/strconv/number_to_base_test.v',
|
|
|
|
'vlib/time/time_test.v',
|
|
|
|
'vlib/toml/tests/toml_test.v',
|
|
|
|
'vlib/v/compiler_errors_test.v',
|
|
|
|
'vlib/v/doc/doc_test.v',
|
|
|
|
'vlib/v/eval/interpret_test.v',
|
|
|
|
'vlib/v/fmt/fmt_keep_test.v',
|
|
|
|
'vlib/v/fmt/fmt_test.v',
|
|
|
|
'vlib/v/gen/c/coutput_test.v',
|
|
|
|
'vlib/v/gen/js/program_test.v',
|
|
|
|
'vlib/v/gen/native/macho_test.v',
|
|
|
|
'vlib/v/gen/native/tests/native_test.v',
|
|
|
|
'vlib/v/pkgconfig/pkgconfig_test.v',
|
2023-01-10 00:47:03 +03:00
|
|
|
'vlib/v/slow_tests/inout/compiler_test.v',
|
2022-06-09 15:25:11 +03:00
|
|
|
'vlib/x/json2/json2_test.v',
|
|
|
|
]
|
2021-04-15 09:28:33 +03:00
|
|
|
skip_test_files = [
|
2023-01-17 21:21:10 +03:00
|
|
|
'do_not_remove',
|
2022-05-16 12:24:21 +03:00
|
|
|
'cmd/tools/vdoc/html_tag_escape_test.v', /* can't locate local module: markdown */
|
|
|
|
'cmd/tools/vdoc/tests/vdoc_file_test.v', /* fails on Windows; order of output is not as expected */
|
2021-12-02 12:15:07 +03:00
|
|
|
'vlib/context/onecontext/onecontext_test.v',
|
2021-04-15 09:28:33 +03:00
|
|
|
'vlib/context/deadline_test.v' /* sometimes blocks */,
|
2023-01-13 18:02:32 +03:00
|
|
|
'vlib/db/mysql/mysql_orm_test.v' /* mysql not installed */,
|
|
|
|
'vlib/db/pg/pg_orm_test.v' /* pg not installed */,
|
2021-04-15 09:28:33 +03:00
|
|
|
]
|
2023-01-17 21:21:10 +03:00
|
|
|
// These tests are too slow to be run in the CI on each PR/commit
|
|
|
|
// in the sanitized modes:
|
2021-05-29 12:15:10 +03:00
|
|
|
skip_fsanitize_too_slow = [
|
2023-01-17 21:21:10 +03:00
|
|
|
'do_not_remove',
|
2021-05-29 12:15:10 +03:00
|
|
|
'vlib/v/compiler_errors_test.v',
|
|
|
|
'vlib/v/doc/doc_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',
|
2023-01-10 00:47:03 +03:00
|
|
|
'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',
|
2021-05-29 12:15:10 +03:00
|
|
|
]
|
2020-12-29 21:27:57 +03:00
|
|
|
skip_with_fsanitize_memory = [
|
2023-01-17 21:21:10 +03:00
|
|
|
'do_not_remove',
|
2020-12-29 08:46:54 +03:00
|
|
|
'vlib/net/tcp_simple_client_server_test.v',
|
|
|
|
'vlib/net/http/cookie_test.v',
|
|
|
|
'vlib/net/http/http_test.v',
|
|
|
|
'vlib/net/http/status_test.v',
|
2021-02-08 01:10:01 +03:00
|
|
|
'vlib/net/http/http_httpbin_test.v',
|
2021-02-28 00:54:27 +03:00
|
|
|
'vlib/net/http/header_test.v',
|
2021-08-19 11:19:49 +03:00
|
|
|
'vlib/net/http/server_test.v',
|
2021-02-08 01:10:01 +03:00
|
|
|
'vlib/net/udp_test.v',
|
|
|
|
'vlib/net/tcp_test.v',
|
2020-12-29 08:46:54 +03:00
|
|
|
'vlib/orm/orm_test.v',
|
2022-08-31 14:43:20 +03:00
|
|
|
'vlib/orm/orm_sql_or_blocks_test.v',
|
2023-01-17 21:21:10 +03:00
|
|
|
'vlib/orm/orm_create_and_drop_test.v',
|
|
|
|
'vlib/orm/orm_insert_test.v',
|
2023-03-17 23:45:52 +03:00
|
|
|
'vlib/orm/orm_insert_reserved_name_test.v',
|
2023-01-26 23:36:30 +03:00
|
|
|
'vlib/orm/orm_fn_calls_test.v',
|
2023-01-29 17:00:23 +03:00
|
|
|
'vlib/orm/orm_last_id_test.v',
|
2023-01-29 02:27:34 +03:00
|
|
|
'vlib/orm/orm_string_interpolation_in_where_test.v',
|
2023-02-28 00:54:03 +03:00
|
|
|
'vlib/orm/orm_interface_test.v',
|
2023-03-01 01:49:30 +03:00
|
|
|
'vlib/orm/orm_mut_db_test.v',
|
2023-04-04 08:23:06 +03:00
|
|
|
'vlib/orm/orm_result_test.v',
|
2023-04-23 03:40:54 +03:00
|
|
|
'vlib/orm/orm_custom_operators_test.v',
|
2023-01-13 18:02:32 +03:00
|
|
|
'vlib/db/sqlite/sqlite_test.v',
|
|
|
|
'vlib/db/sqlite/sqlite_orm_test.v',
|
|
|
|
'vlib/db/sqlite/sqlite_vfs_lowlevel_test.v',
|
2021-02-04 22:28:33 +03:00
|
|
|
'vlib/v/tests/orm_sub_struct_test.v',
|
2021-05-04 12:35:18 +03:00
|
|
|
'vlib/v/tests/orm_sub_array_struct_test.v',
|
2022-05-17 12:53:07 +03:00
|
|
|
'vlib/v/tests/orm_joined_tables_select_test.v',
|
2022-02-02 19:05:31 +03:00
|
|
|
'vlib/v/tests/sql_statement_inside_fn_call_test.v',
|
2023-01-12 16:36:44 +03:00
|
|
|
'vlib/v/tests/orm_stmt_wrong_return_checking_test.v',
|
2023-01-17 21:21:10 +03:00
|
|
|
'vlib/v/tests/orm_handle_error_for_select_from_not_created_table_test.v',
|
2021-02-08 01:10:01 +03:00
|
|
|
'vlib/vweb/tests/vweb_test.v',
|
2022-09-06 13:18:39 +03:00
|
|
|
'vlib/vweb/csrf/csrf_test.v',
|
2021-02-28 01:18:25 +03:00
|
|
|
'vlib/vweb/request_test.v',
|
2021-06-06 00:43:14 +03:00
|
|
|
'vlib/net/http/request_test.v',
|
2021-08-20 01:13:36 +03:00
|
|
|
'vlib/net/http/response_test.v',
|
2021-03-01 13:50:52 +03:00
|
|
|
'vlib/vweb/route_test.v',
|
2021-07-03 02:56:00 +03:00
|
|
|
'vlib/net/websocket/websocket_test.v',
|
2021-03-16 18:10:03 +03:00
|
|
|
'vlib/crypto/rand/crypto_rand_read_test.v',
|
2022-02-16 10:18:51 +03:00
|
|
|
'vlib/net/smtp/smtp_test.v',
|
2022-09-22 08:00:03 +03:00
|
|
|
'vlib/v/tests/websocket_logger_interface_should_compile_test.v',
|
2022-12-09 21:34:34 +03:00
|
|
|
'vlib/v/tests/fn_literal_type_test.v',
|
2020-12-29 08:46:54 +03:00
|
|
|
]
|
2020-12-29 21:27:57 +03:00
|
|
|
skip_with_fsanitize_address = [
|
2023-01-17 21:21:10 +03:00
|
|
|
'do_not_remove',
|
2021-07-03 02:56:00 +03:00
|
|
|
'vlib/net/websocket/websocket_test.v',
|
2023-01-17 21:21:10 +03:00
|
|
|
'vlib/orm/orm_create_and_drop_test.v',
|
|
|
|
'vlib/orm/orm_insert_test.v',
|
2023-03-17 23:45:52 +03:00
|
|
|
'vlib/orm/orm_insert_reserved_name_test.v',
|
2022-09-22 08:00:03 +03:00
|
|
|
'vlib/v/tests/websocket_logger_interface_should_compile_test.v',
|
2023-01-05 16:20:15 +03:00
|
|
|
'vlib/v/tests/orm_sub_array_struct_test.v',
|
2023-01-17 21:21:10 +03:00
|
|
|
'vlib/v/tests/orm_handle_error_for_select_from_not_created_table_test.v',
|
2021-02-08 01:10:01 +03:00
|
|
|
]
|
2021-04-15 09:28:33 +03:00
|
|
|
skip_with_fsanitize_undefined = [
|
|
|
|
'do_not_remove',
|
2023-01-17 21:21:10 +03:00
|
|
|
'vlib/orm/orm_create_and_drop_test.v',
|
|
|
|
'vlib/orm/orm_insert_test.v',
|
2023-03-17 23:45:52 +03:00
|
|
|
'vlib/orm/orm_insert_reserved_name_test.v',
|
2023-01-05 20:51:44 +03:00
|
|
|
'vlib/v/tests/orm_sub_array_struct_test.v',
|
2023-01-17 21:21:10 +03:00
|
|
|
'vlib/v/tests/orm_handle_error_for_select_from_not_created_table_test.v',
|
2021-04-15 09:28:33 +03:00
|
|
|
]
|
2021-02-08 01:10:01 +03:00
|
|
|
skip_with_werror = [
|
2021-07-20 19:34:16 +03:00
|
|
|
'do_not_remove',
|
2022-06-01 12:06:02 +03:00
|
|
|
'vlib/v/embed_file/tests/embed_file_test.v',
|
2020-12-29 08:46:54 +03:00
|
|
|
]
|
2021-04-15 09:28:33 +03:00
|
|
|
skip_with_asan_compiler = [
|
|
|
|
'do_not_remove',
|
|
|
|
]
|
|
|
|
skip_with_msan_compiler = [
|
|
|
|
'do_not_remove',
|
|
|
|
]
|
2020-12-29 21:27:57 +03:00
|
|
|
skip_on_musl = [
|
2023-01-17 21:21:10 +03:00
|
|
|
'do_not_remove',
|
2023-01-10 00:47:03 +03:00
|
|
|
'vlib/v/slow_tests/profile/profile_test.v',
|
2021-12-17 22:19:18 +03:00
|
|
|
'vlib/gg/draw_fns_api_test.v',
|
2022-09-20 08:03:03 +03:00
|
|
|
'vlib/v/tests/skip_unused/gg_code.vv',
|
2023-04-21 19:41:13 +03:00
|
|
|
'vlib/v/tests/c_struct_with_reserved_field_name_test.v',
|
2020-12-25 19:44:52 +03:00
|
|
|
]
|
2020-12-29 21:27:57 +03:00
|
|
|
skip_on_ubuntu_musl = [
|
2023-01-17 21:21:10 +03:00
|
|
|
'do_not_remove',
|
2021-03-01 15:54:49 +03:00
|
|
|
//'vlib/v/gen/js/jsgen_test.v',
|
2020-05-06 23:26:44 +03:00
|
|
|
'vlib/net/http/cookie_test.v',
|
2020-07-08 21:30:57 +03:00
|
|
|
'vlib/net/http/http_test.v',
|
2020-10-09 18:33:16 +03:00
|
|
|
'vlib/net/http/status_test.v',
|
2020-07-17 20:13:22 +03:00
|
|
|
'vlib/net/websocket/ws_test.v',
|
2023-01-13 18:02:32 +03:00
|
|
|
'vlib/db/sqlite/sqlite_test.v',
|
|
|
|
'vlib/db/sqlite/sqlite_orm_test.v',
|
|
|
|
'vlib/db/sqlite/sqlite_vfs_lowlevel_test.v',
|
2020-06-07 18:51:28 +03:00
|
|
|
'vlib/orm/orm_test.v',
|
2022-08-31 14:43:20 +03:00
|
|
|
'vlib/orm/orm_sql_or_blocks_test.v',
|
2023-01-17 21:21:10 +03:00
|
|
|
'vlib/orm/orm_create_and_drop_test.v',
|
|
|
|
'vlib/orm/orm_insert_test.v',
|
2023-03-17 23:45:52 +03:00
|
|
|
'vlib/orm/orm_insert_reserved_name_test.v',
|
2023-01-26 23:36:30 +03:00
|
|
|
'vlib/orm/orm_fn_calls_test.v',
|
2023-01-29 17:00:23 +03:00
|
|
|
'vlib/orm/orm_last_id_test.v',
|
2023-01-29 02:27:34 +03:00
|
|
|
'vlib/orm/orm_string_interpolation_in_where_test.v',
|
2023-02-28 00:54:03 +03:00
|
|
|
'vlib/orm/orm_interface_test.v',
|
2023-03-01 01:49:30 +03:00
|
|
|
'vlib/orm/orm_mut_db_test.v',
|
2023-04-04 08:23:06 +03:00
|
|
|
'vlib/orm/orm_result_test.v',
|
2023-04-23 03:40:54 +03:00
|
|
|
'vlib/orm/orm_custom_operators_test.v',
|
2021-02-04 22:28:33 +03:00
|
|
|
'vlib/v/tests/orm_sub_struct_test.v',
|
2021-05-04 12:35:18 +03:00
|
|
|
'vlib/v/tests/orm_sub_array_struct_test.v',
|
2022-05-17 12:53:07 +03:00
|
|
|
'vlib/v/tests/orm_joined_tables_select_test.v',
|
2023-01-12 16:36:44 +03:00
|
|
|
'vlib/v/tests/orm_stmt_wrong_return_checking_test.v',
|
2023-01-17 21:21:10 +03:00
|
|
|
'vlib/v/tests/orm_handle_error_for_select_from_not_created_table_test.v',
|
2022-02-02 19:05:31 +03:00
|
|
|
'vlib/v/tests/sql_statement_inside_fn_call_test.v',
|
2020-05-06 23:26:44 +03:00
|
|
|
'vlib/clipboard/clipboard_test.v',
|
2020-08-14 01:11:12 +03:00
|
|
|
'vlib/vweb/tests/vweb_test.v',
|
2021-02-28 01:18:25 +03:00
|
|
|
'vlib/vweb/request_test.v',
|
2022-09-06 13:18:39 +03:00
|
|
|
'vlib/vweb/csrf/csrf_test.v',
|
2021-06-06 00:43:14 +03:00
|
|
|
'vlib/net/http/request_test.v',
|
2021-03-01 13:50:52 +03:00
|
|
|
'vlib/vweb/route_test.v',
|
2021-07-03 02:56:00 +03:00
|
|
|
'vlib/net/websocket/websocket_test.v',
|
2021-01-05 13:40:48 +03:00
|
|
|
'vlib/net/http/http_httpbin_test.v',
|
2021-02-28 00:54:27 +03:00
|
|
|
'vlib/net/http/header_test.v',
|
2021-08-19 11:19:49 +03:00
|
|
|
'vlib/net/http/server_test.v',
|
2021-08-20 01:13:36 +03:00
|
|
|
'vlib/net/http/response_test.v',
|
2021-09-29 15:33:14 +03:00
|
|
|
'vlib/builtin/js/array_test.js.v',
|
2022-02-16 10:18:51 +03:00
|
|
|
'vlib/net/smtp/smtp_test.v',
|
2022-09-22 08:00:03 +03:00
|
|
|
'vlib/v/tests/websocket_logger_interface_should_compile_test.v',
|
2022-12-09 21:34:34 +03:00
|
|
|
'vlib/v/tests/fn_literal_type_test.v',
|
2020-05-06 22:59:39 +03:00
|
|
|
]
|
2021-04-15 09:28:33 +03:00
|
|
|
skip_on_linux = [
|
|
|
|
'do_not_remove',
|
|
|
|
]
|
2020-12-29 21:27:57 +03:00
|
|
|
skip_on_non_linux = [
|
2021-04-15 09:28:33 +03:00
|
|
|
'do_not_remove',
|
2020-05-26 13:50:37 +03:00
|
|
|
]
|
2022-06-04 13:05:20 +03:00
|
|
|
skip_on_windows_msvc = [
|
|
|
|
'do_not_remove',
|
|
|
|
'vlib/v/tests/const_fixed_array_containing_references_to_itself_test.v', // error C2099: initializer is not a constant
|
2022-10-10 13:30:35 +03:00
|
|
|
'vlib/v/tests/const_and_global_with_same_name_test.v', // error C2099: initializer is not a constant
|
2023-02-02 14:57:37 +03:00
|
|
|
'vlib/v/tests/sumtype_as_cast_test.v', // error: cannot support compound statement expression ({expr; expr; expr;})
|
2022-06-04 13:05:20 +03:00
|
|
|
]
|
2020-12-29 21:27:57 +03:00
|
|
|
skip_on_windows = [
|
2023-01-17 21:21:10 +03:00
|
|
|
'do_not_remove',
|
2021-09-27 17:52:20 +03:00
|
|
|
'vlib/context/cancel_test.v',
|
|
|
|
'vlib/context/deadline_test.v',
|
|
|
|
'vlib/context/empty_test.v',
|
|
|
|
'vlib/context/value_test.v',
|
2020-06-07 18:51:28 +03:00
|
|
|
'vlib/orm/orm_test.v',
|
2021-02-04 22:28:33 +03:00
|
|
|
'vlib/v/tests/orm_sub_struct_test.v',
|
2022-05-17 12:53:07 +03:00
|
|
|
'vlib/v/tests/orm_joined_tables_select_test.v',
|
2023-01-17 21:21:10 +03:00
|
|
|
'vlib/v/tests/orm_handle_error_for_select_from_not_created_table_test.v',
|
2020-06-09 16:06:07 +03:00
|
|
|
'vlib/net/websocket/ws_test.v',
|
2021-02-11 19:51:12 +03:00
|
|
|
'vlib/net/unix/unix_test.v',
|
2022-02-18 13:45:32 +03:00
|
|
|
'vlib/net/unix/use_net_and_net_unix_together_test.v',
|
2021-07-03 02:56:00 +03:00
|
|
|
'vlib/net/websocket/websocket_test.v',
|
2022-10-16 23:15:00 +03:00
|
|
|
'vlib/net/openssl/openssl_compiles_test.v',
|
|
|
|
'vlib/net/http/request_test.v',
|
|
|
|
'vlib/net/smtp/smtp_test.v',
|
2022-10-19 11:03:29 +03:00
|
|
|
'vlib/net/ssl/ssl_compiles_test.v',
|
|
|
|
'vlib/net/mbedtls/mbedtls_compiles_test.v',
|
2020-08-14 01:11:12 +03:00
|
|
|
'vlib/vweb/tests/vweb_test.v',
|
2021-02-28 01:18:25 +03:00
|
|
|
'vlib/vweb/request_test.v',
|
2021-03-01 13:50:52 +03:00
|
|
|
'vlib/vweb/route_test.v',
|
2021-12-05 20:44:25 +03:00
|
|
|
'vlib/sync/many_times_test.v',
|
2021-12-05 19:56:03 +03:00
|
|
|
'vlib/sync/once_test.v',
|
2022-09-22 08:00:03 +03:00
|
|
|
'vlib/v/tests/websocket_logger_interface_should_compile_test.v',
|
2022-12-09 21:34:34 +03:00
|
|
|
'vlib/v/tests/fn_literal_type_test.v',
|
2020-06-07 18:51:28 +03:00
|
|
|
]
|
2021-04-15 09:28:33 +03:00
|
|
|
skip_on_non_windows = [
|
|
|
|
'do_not_remove',
|
|
|
|
]
|
|
|
|
skip_on_macos = [
|
|
|
|
'do_not_remove',
|
|
|
|
]
|
|
|
|
skip_on_non_macos = [
|
|
|
|
'do_not_remove',
|
|
|
|
]
|
2021-08-27 09:47:04 +03:00
|
|
|
skip_on_amd64 = [
|
|
|
|
'do_not_remove',
|
|
|
|
]
|
2021-12-16 19:02:05 +03:00
|
|
|
skip_on_arm64 = [
|
|
|
|
'do_not_remove',
|
|
|
|
]
|
|
|
|
skip_on_non_amd64_or_arm64 = [
|
2023-01-17 21:21:10 +03:00
|
|
|
'do_not_remove',
|
2021-12-15 10:00:38 +03:00
|
|
|
// closures aren't implemented yet:
|
|
|
|
'vlib/v/tests/closure_test.v',
|
|
|
|
'vlib/context/cancel_test.v',
|
|
|
|
'vlib/context/deadline_test.v',
|
|
|
|
'vlib/context/empty_test.v',
|
|
|
|
'vlib/context/value_test.v',
|
|
|
|
'vlib/context/onecontext/onecontext_test.v',
|
|
|
|
'vlib/sync/once_test.v',
|
|
|
|
'vlib/sync/many_times_test.v',
|
2021-08-27 09:47:04 +03:00
|
|
|
'do_not_remove',
|
|
|
|
]
|
2020-04-05 12:40:17 +03:00
|
|
|
)
|
|
|
|
|
2022-03-06 20:01:22 +03:00
|
|
|
// Note: musl misses openssl, thus the http tests can not be done there
|
|
|
|
// Note: http_httpbin_test.v: fails with 'cgen error: json: map_string_string is not struct'
|
2020-04-05 12:40:17 +03:00
|
|
|
fn main() {
|
2023-02-26 08:56:14 +03:00
|
|
|
vexe := os.real_path(os.getenv_opt('VEXE') or { @VEXE })
|
2020-04-07 20:51:23 +03:00
|
|
|
vroot := os.dir(vexe)
|
2021-08-28 09:39:18 +03:00
|
|
|
os.chdir(vroot) or { panic(err) }
|
2020-12-20 17:33:55 +03:00
|
|
|
args := os.args.clone()
|
2020-04-05 12:40:17 +03:00
|
|
|
args_string := args[1..].join(' ')
|
2021-01-19 11:41:51 +03:00
|
|
|
cmd_prefix := args_string.all_before('test-self')
|
2021-03-16 19:46:11 +03:00
|
|
|
title := 'testing vlib'
|
2021-09-29 15:33:14 +03:00
|
|
|
mut all_test_files := os.walk_ext(os.join_path(vroot, 'vlib'), '_test.v')
|
2022-05-16 12:24:21 +03:00
|
|
|
all_test_files << os.walk_ext(os.join_path(vroot, 'cmd'), '_test.v')
|
2021-12-07 22:31:29 +03:00
|
|
|
test_js_files := os.walk_ext(os.join_path(vroot, 'vlib'), '_test.js.v')
|
|
|
|
all_test_files << test_js_files
|
2022-06-09 15:25:11 +03:00
|
|
|
|
|
|
|
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))
|
|
|
|
}
|
2020-04-05 12:40:17 +03:00
|
|
|
testing.eheader(title)
|
2021-05-08 13:32:29 +03:00
|
|
|
mut tsession := testing.new_test_session(cmd_prefix, true)
|
2021-06-02 22:13:53 +03:00
|
|
|
tsession.files << all_test_files.filter(!it.contains('testdata' + os.path_separator))
|
2020-04-07 20:51:23 +03:00
|
|
|
tsession.skip_files << skip_test_files
|
2021-06-14 13:10:20 +03:00
|
|
|
|
2021-12-07 22:31:29 +03:00
|
|
|
if !testing.is_node_present {
|
|
|
|
testroot := vroot + os.path_separator
|
|
|
|
tsession.skip_files << test_js_files.map(it.replace(testroot, ''))
|
|
|
|
}
|
|
|
|
testing.find_started_process('mysqld') or {
|
|
|
|
tsession.skip_files << 'vlib/mysql/mysql_orm_test.v'
|
|
|
|
}
|
|
|
|
testing.find_started_process('postgres') or { tsession.skip_files << 'vlib/pg/pg_orm_test.v' }
|
|
|
|
|
2021-06-14 13:10:20 +03:00
|
|
|
if github_job == 'windows-tcc' {
|
|
|
|
// TODO: fix these ASAP
|
|
|
|
tsession.skip_files << 'vlib/net/tcp_test.v'
|
|
|
|
tsession.skip_files << 'vlib/net/udp_test.v'
|
|
|
|
}
|
|
|
|
|
2023-03-01 00:58:53 +03:00
|
|
|
if !os.exists('cmd/tools/builders/wasm_builder') {
|
|
|
|
tsession.skip_files << 'vlib/v/gen/wasm/tests/wasm_test.v'
|
|
|
|
}
|
|
|
|
|
2021-02-08 01:10:01 +03:00
|
|
|
mut werror := false
|
2020-12-29 08:46:54 +03:00
|
|
|
mut sanitize_memory := false
|
|
|
|
mut sanitize_address := false
|
|
|
|
mut sanitize_undefined := false
|
2021-02-21 17:09:19 +03:00
|
|
|
mut asan_compiler := false
|
2021-03-23 01:05:48 +03:00
|
|
|
mut msan_compiler := false
|
2020-12-29 08:46:54 +03:00
|
|
|
for arg in args {
|
2021-03-23 14:36:50 +03:00
|
|
|
if arg.contains('-asan-compiler') {
|
2021-02-21 17:09:19 +03:00
|
|
|
asan_compiler = true
|
|
|
|
}
|
2021-03-23 14:36:50 +03:00
|
|
|
if arg.contains('-msan-compiler') {
|
2021-03-23 01:05:48 +03:00
|
|
|
msan_compiler = true
|
|
|
|
}
|
2021-04-19 15:38:48 +03:00
|
|
|
if arg.contains('-Werror') || arg.contains('-cstrict') {
|
2021-02-08 01:10:01 +03:00
|
|
|
werror = true
|
|
|
|
}
|
2021-03-23 14:36:50 +03:00
|
|
|
if arg.contains('-fsanitize=memory') {
|
2020-12-29 08:46:54 +03:00
|
|
|
sanitize_memory = true
|
|
|
|
}
|
2021-03-23 14:36:50 +03:00
|
|
|
if arg.contains('-fsanitize=address') {
|
2020-12-29 08:46:54 +03:00
|
|
|
sanitize_address = true
|
|
|
|
}
|
2021-03-23 14:36:50 +03:00
|
|
|
if arg.contains('-fsanitize=undefined') {
|
2020-12-29 21:27:57 +03:00
|
|
|
sanitize_undefined = true
|
2020-12-29 08:46:54 +03:00
|
|
|
}
|
|
|
|
}
|
2021-05-29 12:15:10 +03:00
|
|
|
if os.getenv('VTEST_RUN_FSANITIZE_TOO_SLOW').len == 0
|
2022-11-22 20:52:36 +03:00
|
|
|
&& ((sanitize_undefined || sanitize_memory || sanitize_address)
|
|
|
|
|| (msan_compiler || asan_compiler)) {
|
2021-05-29 12:15:10 +03:00
|
|
|
tsession.skip_files << skip_fsanitize_too_slow
|
|
|
|
}
|
2021-02-08 01:10:01 +03:00
|
|
|
if werror {
|
|
|
|
tsession.skip_files << skip_with_werror
|
|
|
|
}
|
2020-12-29 08:46:54 +03:00
|
|
|
if sanitize_memory {
|
|
|
|
tsession.skip_files << skip_with_fsanitize_memory
|
|
|
|
}
|
|
|
|
if sanitize_address {
|
|
|
|
tsession.skip_files << skip_with_fsanitize_address
|
|
|
|
}
|
|
|
|
if sanitize_undefined {
|
|
|
|
tsession.skip_files << skip_with_fsanitize_undefined
|
|
|
|
}
|
2021-02-21 17:09:19 +03:00
|
|
|
if asan_compiler {
|
|
|
|
tsession.skip_files << skip_with_asan_compiler
|
|
|
|
}
|
2021-03-23 01:05:48 +03:00
|
|
|
if msan_compiler {
|
|
|
|
tsession.skip_files << skip_with_msan_compiler
|
|
|
|
}
|
2021-01-05 19:13:38 +03:00
|
|
|
// println(tsession.skip_files)
|
2020-05-06 22:59:39 +03:00
|
|
|
if os.getenv('V_CI_MUSL').len > 0 {
|
|
|
|
tsession.skip_files << skip_on_musl
|
|
|
|
}
|
2020-07-08 21:30:57 +03:00
|
|
|
if os.getenv('V_CI_UBUNTU_MUSL').len > 0 {
|
|
|
|
tsession.skip_files << skip_on_ubuntu_musl
|
|
|
|
}
|
2021-12-16 19:02:05 +03:00
|
|
|
$if !amd64 && !arm64 {
|
2021-08-27 09:47:04 +03:00
|
|
|
tsession.skip_files << skip_on_non_amd64
|
|
|
|
}
|
|
|
|
$if amd64 {
|
|
|
|
tsession.skip_files << skip_on_amd64
|
|
|
|
}
|
2021-12-16 19:02:05 +03:00
|
|
|
$if arm64 {
|
|
|
|
tsession.skip_files << skip_on_arm64
|
|
|
|
}
|
2020-04-11 12:41:48 +03:00
|
|
|
$if !linux {
|
2020-05-06 22:59:39 +03:00
|
|
|
tsession.skip_files << skip_on_non_linux
|
2020-04-11 12:41:48 +03:00
|
|
|
}
|
2020-04-11 13:41:59 +03:00
|
|
|
$if linux {
|
2020-05-06 22:59:39 +03:00
|
|
|
tsession.skip_files << skip_on_linux
|
|
|
|
}
|
|
|
|
$if windows {
|
|
|
|
tsession.skip_files << skip_on_windows
|
2022-06-04 13:05:20 +03:00
|
|
|
$if msvc {
|
|
|
|
tsession.skip_files << skip_on_windows_msvc
|
|
|
|
}
|
2020-05-06 22:59:39 +03:00
|
|
|
}
|
|
|
|
$if !windows {
|
|
|
|
tsession.skip_files << skip_on_non_windows
|
|
|
|
}
|
|
|
|
$if macos {
|
|
|
|
tsession.skip_files << skip_on_macos
|
|
|
|
}
|
|
|
|
$if !macos {
|
|
|
|
tsession.skip_files << skip_on_non_macos
|
2020-04-11 13:41:59 +03:00
|
|
|
}
|
2020-04-05 12:40:17 +03:00
|
|
|
tsession.test()
|
|
|
|
eprintln(tsession.benchmark.total_message(title))
|
|
|
|
if tsession.benchmark.nfail > 0 {
|
2022-11-15 16:53:13 +03:00
|
|
|
eprintln('\nWARNING: failed ${tsession.benchmark.nfail} times.\n')
|
2020-10-14 23:42:30 +03:00
|
|
|
exit(1)
|
2020-04-05 15:20:28 +03:00
|
|
|
}
|
2020-04-05 12:40:17 +03:00
|
|
|
}
|