mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
go/ssa/interp: add fake runtime.callerName to fix broken tests
We are inching towards the point at which I blow away this entire package, or at least all tests that interpret the standard "testing" package. Change-Id: I06d99aac6d7baab14ee6c6a61afe0af34b814767 Reviewed-on: https://go-review.googlesource.com/80356 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
6d70fb2e85
commit
0e42b0fe40
@ -139,6 +139,7 @@ func init() {
|
|||||||
"sync/atomic.StoreInt64": ext۰atomic۰StoreInt64,
|
"sync/atomic.StoreInt64": ext۰atomic۰StoreInt64,
|
||||||
"sync/atomic.StoreUint64": ext۰atomic۰StoreUint64,
|
"sync/atomic.StoreUint64": ext۰atomic۰StoreUint64,
|
||||||
"testing.callerEntry": ext۰testing۰callerEntry,
|
"testing.callerEntry": ext۰testing۰callerEntry,
|
||||||
|
"testing.callerName": ext۰testing۰callerName,
|
||||||
"testing.runExample": ext۰testing۰runExample,
|
"testing.runExample": ext۰testing۰runExample,
|
||||||
"time.Sleep": ext۰time۰Sleep,
|
"time.Sleep": ext۰time۰Sleep,
|
||||||
"time.now": ext۰time۰now,
|
"time.now": ext۰time۰now,
|
||||||
@ -527,10 +528,19 @@ func ext۰testing۰runExample(fr *frame, args []value) value {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// These two internal functions must be faked to avoid calls to
|
||||||
|
// runtime.CallersFrames, which is hard to emulate. We are inching
|
||||||
|
// towards the point at which I blow away this entire package, or at
|
||||||
|
// least all tests that interpret the standard "testing" package.
|
||||||
|
|
||||||
func ext۰testing۰callerEntry(fr *frame, args []value) value {
|
func ext۰testing۰callerEntry(fr *frame, args []value) value {
|
||||||
return uintptr(0) // bogus implementation for now
|
return uintptr(0) // bogus implementation for now
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ext۰testing۰callerName(fr *frame, args []value) value {
|
||||||
|
return "<unknown>" // bogus implementation for now
|
||||||
|
}
|
||||||
|
|
||||||
func ext۰time۰now(fr *frame, args []value) value {
|
func ext۰time۰now(fr *frame, args []value) value {
|
||||||
nano := time.Now().UnixNano()
|
nano := time.Now().UnixNano()
|
||||||
return tuple{int64(nano / 1e9), int32(nano % 1e9), int64(0)}
|
return tuple{int64(nano / 1e9), int32(nano % 1e9), int64(0)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user