mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
test-compiler: fix sporadic fails for vpm/v install
This commit is contained in:
parent
d1e52620c7
commit
e02f25a108
@ -69,10 +69,7 @@ pub fn (mut ts TestSession) test() {
|
||||
if current_wd == os.wd_at_startup && current_wd == ts.vroot {
|
||||
ts.root_relative = true
|
||||
}
|
||||
now := time.sys_mono_now()
|
||||
new_vtmp_dir := os.join_path(os.temp_dir(), 'v', 'test_session_$now')
|
||||
os.mkdir_all(new_vtmp_dir)
|
||||
os.setenv('VTMP', new_vtmp_dir, true)
|
||||
new_vtmp_dir := setup_new_vtmp_folder()
|
||||
//
|
||||
ts.init()
|
||||
mut remaining_files := []string{}
|
||||
@ -333,3 +330,11 @@ pub fn eheader(msg string) {
|
||||
pub fn header(msg string) {
|
||||
println(term.header(msg, '-'))
|
||||
}
|
||||
|
||||
pub fn setup_new_vtmp_folder() string {
|
||||
now := time.sys_mono_now()
|
||||
new_vtmp_dir := os.join_path(os.temp_dir(), 'v', 'test_session_$now')
|
||||
os.mkdir_all(new_vtmp_dir)
|
||||
os.setenv('VTMP', new_vtmp_dir, true)
|
||||
return new_vtmp_dir
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ fn v_test_compiler(vargs string) {
|
||||
exit(1)
|
||||
}
|
||||
*/
|
||||
|
||||
// Make sure v.c can be compiled without warnings
|
||||
$if macos {
|
||||
if os.exists('/cmd/v') {
|
||||
@ -46,8 +45,11 @@ fn v_test_compiler(vargs string) {
|
||||
eprintln('')
|
||||
building_examples_failed := testing.v_build_failing(vargs, 'examples')
|
||||
eprintln('')
|
||||
building_live_failed := testing.v_build_failing(vargs + '-live', os.join_path('examples', 'hot_reload'))
|
||||
building_live_failed := testing.v_build_failing(vargs + '-live', os.join_path('examples',
|
||||
'hot_reload'))
|
||||
eprintln('')
|
||||
//
|
||||
testing.setup_new_vtmp_folder()
|
||||
v_module_install_cmd := '$vexe install nedpals.args'
|
||||
eprintln('')
|
||||
testing.eheader('Installing a v module with: $v_module_install_cmd')
|
||||
@ -56,12 +58,13 @@ fn v_test_compiler(vargs string) {
|
||||
if ret != 0 {
|
||||
eprintln('failed to run v install')
|
||||
}
|
||||
desired_path := os.join_path(pref.default_module_path, 'nedpals', 'args')
|
||||
if !(os.exists( desired_path ) && os.is_dir( desired_path )) {
|
||||
desired_path := os.join_path(pref.default_module_path, 'nedpals', 'args')
|
||||
if !(os.exists(desired_path) && os.is_dir(desired_path)) {
|
||||
eprintln('v failed to install a test module')
|
||||
}
|
||||
vmark.stop()
|
||||
eprintln('Installing a v module took: ' + vmark.total_duration().str() + 'ms')
|
||||
//
|
||||
if building_tools_failed || compiler_test_session.failed || building_examples_failed || building_live_failed {
|
||||
exit(1)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user