2020-04-05 11:40:17 +02:00
|
|
|
module main
|
|
|
|
|
|
|
|
import os
|
|
|
|
import testing
|
2020-04-07 19:51:23 +02:00
|
|
|
import v.pref
|
2020-04-05 11:40:17 +02:00
|
|
|
|
|
|
|
const (
|
2020-05-06 21:59:39 +02:00
|
|
|
skip_test_files = [
|
2020-04-07 19:51:23 +02:00
|
|
|
'vlib/v/tests/enum_bitfield_test.v',
|
|
|
|
'vlib/v/tests/num_lit_call_method_test.v',
|
|
|
|
'vlib/v/tests/pointers_test.v',
|
|
|
|
'vlib/v/tests/type_test.v',
|
2020-04-09 15:35:52 +02:00
|
|
|
'vlib/v/tests/pointers_str_test.v',
|
2020-05-06 21:59:39 +02:00
|
|
|
'vlib/arrays/arrays_test.v',
|
2020-05-06 22:26:44 +02:00
|
|
|
'vlib/net/http/http_httpbin_test.v',
|
2020-04-07 19:51:23 +02:00
|
|
|
]
|
2020-05-06 21:59:39 +02:00
|
|
|
skip_on_musl = [
|
|
|
|
'vlib/net/http/http_test.v',
|
2020-05-06 22:26:44 +02:00
|
|
|
'vlib/net/http/cookie_test.v',
|
2020-05-06 22:50:20 +02:00
|
|
|
'vlib/sqlite/sqlite_test.v',
|
2020-05-06 22:26:44 +02:00
|
|
|
'vlib/clipboard/clipboard_test.v',
|
2020-05-06 21:59:39 +02:00
|
|
|
]
|
|
|
|
skip_on_linux = []string{}
|
|
|
|
skip_on_non_linux = []string{}
|
|
|
|
skip_on_windows = []string{}
|
|
|
|
skip_on_non_windows = []string{}
|
|
|
|
skip_on_macos = []string{}
|
|
|
|
skip_on_non_macos = []string{}
|
2020-04-05 11:40:17 +02:00
|
|
|
)
|
|
|
|
|
2020-05-06 21:59:39 +02:00
|
|
|
// NB: musl misses openssl, thus the http tests can not be done there
|
|
|
|
// NB: http_httpbin_test.v: fails with 'cgen error: json: map_string_string is not struct'
|
2020-04-05 11:40:17 +02:00
|
|
|
fn main() {
|
2020-04-07 19:51:23 +02:00
|
|
|
vexe := pref.vexe_path()
|
|
|
|
vroot := os.dir(vexe)
|
2020-04-10 21:40:56 +02:00
|
|
|
os.chdir(vroot)
|
2020-04-05 11:40:17 +02:00
|
|
|
args := os.args
|
|
|
|
args_string := args[1..].join(' ')
|
|
|
|
cmd_prefix := args_string.all_before('test-fixed')
|
|
|
|
title := 'testing all fixed tests'
|
2020-05-06 21:59:39 +02:00
|
|
|
all_test_files := os.walk_ext(os.join_path(vroot, 'vlib'), '_test.v')
|
2020-04-05 11:40:17 +02:00
|
|
|
testing.eheader(title)
|
|
|
|
mut tsession := testing.new_test_session(cmd_prefix)
|
2020-04-07 19:51:23 +02:00
|
|
|
tsession.files << all_test_files
|
|
|
|
tsession.skip_files << skip_test_files
|
2020-05-06 21:59:39 +02:00
|
|
|
//
|
|
|
|
if os.getenv('V_CI_MUSL').len > 0 {
|
|
|
|
tsession.skip_files << skip_on_musl
|
|
|
|
}
|
2020-04-11 11:41:48 +02:00
|
|
|
$if !linux {
|
2020-05-06 21:59:39 +02:00
|
|
|
tsession.skip_files << skip_on_non_linux
|
2020-04-11 11:41:48 +02:00
|
|
|
}
|
2020-04-11 12:41:59 +02:00
|
|
|
$if linux {
|
2020-05-06 21:59:39 +02:00
|
|
|
tsession.skip_files << skip_on_linux
|
|
|
|
}
|
|
|
|
$if windows {
|
|
|
|
tsession.skip_files << skip_on_windows
|
|
|
|
}
|
|
|
|
$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 12:41:59 +02:00
|
|
|
}
|
2020-04-05 11:40:17 +02: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 14:20:28 +02:00
|
|
|
}
|
2020-04-05 11:40:17 +02:00
|
|
|
}
|