2020-04-05 12:40:17 +03:00
|
|
|
module main
|
|
|
|
|
|
|
|
import os
|
|
|
|
import testing
|
2020-04-07 20:51:23 +03:00
|
|
|
import v.pref
|
2020-04-05 12:40:17 +03:00
|
|
|
|
|
|
|
const (
|
2020-04-07 20:51:23 +03:00
|
|
|
skip_test_files = [
|
|
|
|
'vlib/arrays/arrays_test.v',
|
|
|
|
'vlib/cli/command_test.v',
|
|
|
|
'vlib/cli/flag_test.v',
|
|
|
|
'vlib/clipboard/clipboard_test.v', // Linux only
|
|
|
|
'vlib/crypto/aes/aes_test.v',
|
|
|
|
'vlib/crypto/rand/rand_test.v',
|
|
|
|
'vlib/crypto/rc4/rc4_test.v',
|
|
|
|
'vlib/encoding/utf8/utf8_util_test.v',
|
|
|
|
'vlib/eventbus/eventbus_test.v',
|
|
|
|
'vlib/flag/flag_test.v',
|
|
|
|
'vlib/json/json_test.v',
|
|
|
|
'vlib/math/complex/complex_test.v',
|
|
|
|
'vlib/net/ftp/ftp_test.v',
|
|
|
|
'vlib/net/http/http_httpbin_test.v',
|
|
|
|
'vlib/net/http/http_test.v',
|
|
|
|
'vlib/net/socket_test.v',
|
|
|
|
'vlib/regex/regex_test.v',
|
|
|
|
'vlib/sqlite/sqlite_test.v', // Linux only
|
|
|
|
'vlib/strconv/ftoa/f32_f64_to_string_test.v',
|
2020-04-08 05:57:36 +03:00
|
|
|
//'vlib/v/parser/parser_test.v', // exits early, but it should compile
|
2020-04-07 20:51:23 +03:00
|
|
|
'vlib/v/tests/array_to_string_test.v',
|
|
|
|
'vlib/v/tests/asm_test.v', // Linux only
|
|
|
|
'vlib/v/tests/backtrace_test.v', // TCC only
|
|
|
|
'vlib/v/tests/enum_bitfield_test.v',
|
|
|
|
'vlib/v/tests/fixed_array_test.v',
|
|
|
|
'vlib/v/tests/fn_test.v',
|
|
|
|
'vlib/v/tests/fn_variadic_test.v',
|
|
|
|
'vlib/v/tests/live_test.v', // Linux only
|
|
|
|
'vlib/v/tests/match_test.v',
|
|
|
|
'vlib/v/tests/msvc_test.v',
|
|
|
|
'vlib/v/tests/mut_test.v',
|
|
|
|
'vlib/v/tests/num_lit_call_method_test.v',
|
|
|
|
'vlib/v/tests/option_test.v',
|
|
|
|
'vlib/v/tests/pointers_test.v',
|
|
|
|
'vlib/v/tests/project_with_modules_having_submodules/bin/a_program_under_bin_can_find_mod1_test.v',
|
|
|
|
'vlib/v/tests/project_with_modules_having_submodules/tests/submodule_test.v',
|
|
|
|
'vlib/v/tests/repl/repl_test.v',
|
|
|
|
'vlib/v/tests/string_interpolation_array_of_structs_test.v',
|
|
|
|
'vlib/v/tests/string_interpolation_struct_test.v',
|
|
|
|
'vlib/v/tests/string_interpolation_variadic_test.v',
|
|
|
|
'vlib/v/tests/type_test.v',
|
|
|
|
'vlib/v/tests/typeof_test.v',
|
|
|
|
'vlib/v/tests/valgrind/valgrind_test.v', // ubuntu-musl only
|
2020-04-09 16:35:52 +03:00
|
|
|
'vlib/v/tests/pointers_str_test.v',
|
2020-04-07 20:51:23 +03:00
|
|
|
]
|
2020-04-05 12:40:17 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
fn main() {
|
2020-04-07 20:51:23 +03:00
|
|
|
vexe := pref.vexe_path()
|
|
|
|
vroot := os.dir(vexe)
|
2020-04-05 12:40:17 +03:00
|
|
|
args := os.args
|
|
|
|
args_string := args[1..].join(' ')
|
|
|
|
cmd_prefix := args_string.all_before('test-fixed')
|
|
|
|
title := 'testing all fixed tests'
|
2020-04-07 20:51:23 +03:00
|
|
|
|
|
|
|
all_test_files := os.walk_ext( os.join_path(vroot,'vlib'), '_test.v')
|
2020-04-05 12:40:17 +03:00
|
|
|
testing.eheader(title)
|
|
|
|
mut tsession := testing.new_test_session(cmd_prefix)
|
2020-04-07 20:51:23 +03:00
|
|
|
tsession.files << all_test_files
|
|
|
|
tsession.skip_files << skip_test_files
|
2020-04-05 12:40:17 +03:00
|
|
|
tsession.test()
|
|
|
|
eprintln(tsession.benchmark.total_message(title))
|
|
|
|
if tsession.benchmark.nfail > 0 {
|
|
|
|
panic('\nWARNING: failed ${tsession.benchmark.nfail} times.\n')
|
2020-04-05 15:20:28 +03:00
|
|
|
}
|
2020-04-05 12:40:17 +03:00
|
|
|
}
|