builtin: make panics more IDE friendly
parent
e554415123
commit
1753445a64
|
@ -207,7 +207,7 @@ fn main() {
|
||||||
args := os.args.clone()
|
args := os.args.clone()
|
||||||
args_string := args[1..].join(' ')
|
args_string := args[1..].join(' ')
|
||||||
cmd_prefix := args_string.all_before('test-self')
|
cmd_prefix := args_string.all_before('test-self')
|
||||||
title := 'testing all tests'
|
title := 'testing vlib'
|
||||||
all_test_files := os.walk_ext(os.join_path(vroot, 'vlib'), '_test.v')
|
all_test_files := os.walk_ext(os.join_path(vroot, 'vlib'), '_test.v')
|
||||||
testing.eheader(title)
|
testing.eheader(title)
|
||||||
mut tsession := testing.new_test_session(cmd_prefix)
|
mut tsession := testing.new_test_session(cmd_prefix)
|
||||||
|
|
|
@ -22,8 +22,7 @@ fn panic_debug(line_no int, file string, mod string, fn_name string, s string) {
|
||||||
eprintln(' module: $mod')
|
eprintln(' module: $mod')
|
||||||
eprintln(' function: ${fn_name}()')
|
eprintln(' function: ${fn_name}()')
|
||||||
eprintln(' message: $s')
|
eprintln(' message: $s')
|
||||||
eprintln(' file: $file')
|
eprintln(' file: $file:$line_no')
|
||||||
eprintln(' line: ' + line_no.str())
|
|
||||||
eprintln('=========================================')
|
eprintln('=========================================')
|
||||||
$if exit_after_panic_message ? {
|
$if exit_after_panic_message ? {
|
||||||
C.exit(1)
|
C.exit(1)
|
||||||
|
|
|
@ -138,7 +138,7 @@ fn (mut v Builder) rebuild_cached_module(vexe string, imp_path string) string {
|
||||||
vcache.dlog('| Builder.' + @FN, 'vexe: $vexe | imp_path: $imp_path | rebuild_cmd: $rebuild_cmd')
|
vcache.dlog('| Builder.' + @FN, 'vexe: $vexe | imp_path: $imp_path | rebuild_cmd: $rebuild_cmd')
|
||||||
os.system(rebuild_cmd)
|
os.system(rebuild_cmd)
|
||||||
rebuilded_o := v.pref.cache_manager.exists('.o', imp_path) or {
|
rebuilded_o := v.pref.cache_manager.exists('.o', imp_path) or {
|
||||||
panic('could not rebuild cache module for $imp_path, error: $err')
|
panic('could not rebuild cache module for $imp_path, error: $err.msg')
|
||||||
}
|
}
|
||||||
os.chdir(pwd)
|
os.chdir(pwd)
|
||||||
return rebuilded_o
|
return rebuilded_o
|
||||||
|
|
|
@ -2,5 +2,4 @@
|
||||||
module: main
|
module: main
|
||||||
function: buggy_function()
|
function: buggy_function()
|
||||||
message: panicing...
|
message: panicing...
|
||||||
file: vlib/v/tests/inout/panic_with_cg.vv
|
file: vlib/v/tests/inout/panic_with_cg.vv:3
|
||||||
line: 3
|
|
||||||
|
|
Loading…
Reference in New Issue