all: bring back panic(err.msg) -> panic(err) (#9022)

This commit is contained in:
spaceface 2021-03-01 00:18:14 +01:00 committed by GitHub
parent ce115dcbe0
commit b712af56fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
110 changed files with 383 additions and 387 deletions

View file

@ -221,7 +221,7 @@ pub fn (mut ts TestSession) test() {
// cleanup generated .tmp.c files after successfull tests:
if ts.benchmark.nfail == 0 {
if ts.rm_binaries {
os.rmdir_all(ts.vtmp_dir) or { panic(err.msg) }
os.rmdir_all(ts.vtmp_dir) or { panic(err) }
}
}
}
@ -255,7 +255,7 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
generated_binary_fpath := os.join_path(tmpd, generated_binary_fname)
if os.exists(generated_binary_fpath) {
if ts.rm_binaries {
os.rm(generated_binary_fpath) or { panic(err.msg) }
os.rm(generated_binary_fpath) or { panic(err) }
}
}
mut cmd_options := [ts.vargs]
@ -308,7 +308,7 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
}
if os.exists(generated_binary_fpath) {
if ts.rm_binaries {
os.rm(generated_binary_fpath) or { panic(err.msg) }
os.rm(generated_binary_fpath) or { panic(err) }
}
}
return pool.no_result
@ -358,7 +358,7 @@ pub fn prepare_test_session(zargs string, folder string, oskipped []string, main
continue
}
}
c := os.read_file(f) or { panic(err.msg) }
c := os.read_file(f) or { panic(err) }
maxc := if c.len > 300 { 300 } else { c.len }
start := c[0..maxc]
if start.contains('module ') && !start.contains('module main') {
@ -436,7 +436,7 @@ pub fn header(msg string) {
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) or { panic(err.msg) }
os.mkdir_all(new_vtmp_dir) or { panic(err) }
os.setenv('VTMP', new_vtmp_dir, true)
return new_vtmp_dir
}