gtest updates; TODO++

This commit is contained in:
John
2019-02-15 08:55:29 +08:00
parent 2e87d5322f
commit 74eef34ec2
2 changed files with 5 additions and 5 deletions

View File

@ -51,7 +51,7 @@
1. 权限管理模块;
1. 从ghttp中剥离SESSION功能构成单独的模块gsession
1. 改进gproc进程间通信处理逻辑提高稳定性以应对进程间大批量的数据发送/接收;
1. gdb的Data方法支持struct参数传入

View File

@ -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 != "" {