mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
gtest updates; TODO++
This commit is contained in:
2
TODO.MD
2
TODO.MD
@ -51,7 +51,7 @@
|
||||
1. 权限管理模块;
|
||||
1. 从ghttp中剥离SESSION功能构成单独的模块gsession;
|
||||
1. 改进gproc进程间通信处理逻辑,提高稳定性,以应对进程间大批量的数据发送/接收;
|
||||
|
||||
1. gdb的Data方法支持struct参数传入;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -215,12 +215,12 @@ func AssertNI(value, expect interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
// 提示错误不退出
|
||||
// 提示错误不退出进程执行
|
||||
func Error(message...interface{}) {
|
||||
fmt.Fprintf(os.Stderr, "[ERROR] %s\n%s", fmt.Sprint(message...), getBacktrace())
|
||||
}
|
||||
|
||||
// 提示错误并退出
|
||||
// 提示错误并退出进程执行
|
||||
func Fatal(message...interface{}) {
|
||||
fmt.Fprintf(os.Stderr, "[FATAL] %s\n%s", fmt.Sprint(message...), getBacktrace())
|
||||
os.Exit(1)
|
||||
@ -270,7 +270,7 @@ func getBacktrace(skip...int) string {
|
||||
// 首先定位业务文件开始位置
|
||||
for i := 0; i < 10; i++ {
|
||||
if _, file, _, ok := runtime.Caller(i); ok {
|
||||
if reg, _ := regexp.Compile("/g/util/gtest/.+$"); !reg.MatchString(file) {
|
||||
if reg, _ := regexp.Compile(`gtest\.go$`); !reg.MatchString(file) {
|
||||
from = i
|
||||
break
|
||||
}
|
||||
@ -283,7 +283,7 @@ func getBacktrace(skip...int) string {
|
||||
if reg, _ := regexp.Compile(`<autogenerated>`); reg.MatchString(file) {
|
||||
continue
|
||||
}
|
||||
if reg, _ := regexp.Compile("/g/test/gtest/.+$"); reg.MatchString(file) {
|
||||
if reg, _ := regexp.Compile(`gtest\.go$`); reg.MatchString(file) {
|
||||
continue
|
||||
}
|
||||
if goRoot != "" {
|
||||
|
||||
Reference in New Issue
Block a user