mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
go/...: fix/disable broken tests
gp/ssa: add {Start,Stop}TestLog methods to synthesized test main package. go/ssa/interp: add (not thread-safe) intrinsics for atomic.Value, which are now used by Getenv. go/pointer: disable test of callbacks from runtime timers as the analysis's intrinsics are out of date. Also fix 3 typos. Change-Id: I25f95ba18986727275a730b465e7fd23c08b2af2 Reviewed-on: https://go-review.googlesource.com/88055 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
8ea45f9674
commit
a5d79d28aa
@ -59,7 +59,7 @@ var inputs = []string{
|
|||||||
"testdata/rtti.go",
|
"testdata/rtti.go",
|
||||||
"testdata/structreflect.go",
|
"testdata/structreflect.go",
|
||||||
"testdata/structs.go",
|
"testdata/structs.go",
|
||||||
"testdata/timer.go",
|
// "testdata/timer.go", // TODO(adonovan): fix broken assumptions about runtime timers
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expectation grammar:
|
// Expectation grammar:
|
||||||
@ -498,7 +498,7 @@ func checkCallsExpectation(prog *ssa.Program, e *expectation, cg *callgraph.Grap
|
|||||||
if edge.Caller.Func.String() == e.args[0] {
|
if edge.Caller.Func.String() == e.args[0] {
|
||||||
calleeStr := edge.Callee.Func.String()
|
calleeStr := edge.Callee.Func.String()
|
||||||
if calleeStr == e.args[1] {
|
if calleeStr == e.args[1] {
|
||||||
return errOK // expectation satisified; stop the search
|
return errOK // expectation satisfied; stop the search
|
||||||
}
|
}
|
||||||
found[calleeStr]++
|
found[calleeStr]++
|
||||||
}
|
}
|
||||||
@ -524,7 +524,7 @@ func checkWarningExpectation(prog *ssa.Program, e *expectation, warnings []point
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(warnings) == 0 {
|
if len(warnings) == 0 {
|
||||||
e.errorf("@warning %s expectation, but no warnings", strconv.Quote(e.args[0]))
|
e.errorf("@warning %q expectation, but no warnings", e.args[0])
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -534,7 +534,7 @@ func checkWarningExpectation(prog *ssa.Program, e *expectation, warnings []point
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e.errorf("@warning %s expectation not satised; found these warnings though:", strconv.Quote(e.args[0]))
|
e.errorf("@warning %q expectation not satisfied; found these warnings though:", e.args[0])
|
||||||
for _, w := range warnings {
|
for _, w := range warnings {
|
||||||
fmt.Printf("%s: warning: %s\n", prog.Fset.Position(w.Pos), w.Message)
|
fmt.Printf("%s: warning: %s\n", prog.Fset.Position(w.Pos), w.Message)
|
||||||
}
|
}
|
||||||
|
@ -139,6 +139,8 @@ func init() {
|
|||||||
"sync/atomic.LoadUint64": ext۰atomic۰LoadUint64,
|
"sync/atomic.LoadUint64": ext۰atomic۰LoadUint64,
|
||||||
"sync/atomic.StoreInt64": ext۰atomic۰StoreInt64,
|
"sync/atomic.StoreInt64": ext۰atomic۰StoreInt64,
|
||||||
"sync/atomic.StoreUint64": ext۰atomic۰StoreUint64,
|
"sync/atomic.StoreUint64": ext۰atomic۰StoreUint64,
|
||||||
|
"(*sync/atomic.Value).Load": ext۰atomic۰ValueLoad,
|
||||||
|
"(*sync/atomic.Value).Store": ext۰atomic۰ValueStore,
|
||||||
"testing.MainStart": ext۰testing۰MainStart,
|
"testing.MainStart": ext۰testing۰MainStart,
|
||||||
"time.Sleep": ext۰time۰Sleep,
|
"time.Sleep": ext۰time۰Sleep,
|
||||||
"time.now": ext۰time۰now,
|
"time.now": ext۰time۰now,
|
||||||
@ -481,6 +483,19 @@ func ext۰atomic۰AddUint64(fr *frame, args []value) value {
|
|||||||
return newv
|
return newv
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ext۰atomic۰ValueLoad(fr *frame, args []value) value {
|
||||||
|
// TODO(adonovan): fix: not atomic!
|
||||||
|
// Receiver is *struct{v interface{}}.
|
||||||
|
return (*args[0].(*value)).(structure)[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
func ext۰atomic۰ValueStore(fr *frame, args []value) value {
|
||||||
|
// TODO(adonovan): fix: not atomic!
|
||||||
|
// Receiver is *struct{v interface{}}.
|
||||||
|
(*args[0].(*value)).(structure)[0] = args[1]
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func ext۰cpu۰cpuid(fr *frame, args []value) value {
|
func ext۰cpu۰cpuid(fr *frame, args []value) value {
|
||||||
return tuple{uint32(0), uint32(0), uint32(0), uint32(0)}
|
return tuple{uint32(0), uint32(0), uint32(0), uint32(0)}
|
||||||
}
|
}
|
||||||
|
@ -214,12 +214,14 @@ import p {{printf "%q" .Pkg.Pkg.Path}}
|
|||||||
{{if .Go18}}
|
{{if .Go18}}
|
||||||
type deps struct{}
|
type deps struct{}
|
||||||
|
|
||||||
|
func (deps) ImportPath() string { return "" }
|
||||||
func (deps) MatchString(pat, str string) (bool, error) { return true, nil }
|
func (deps) MatchString(pat, str string) (bool, error) { return true, nil }
|
||||||
func (deps) StartCPUProfile(io.Writer) error { return nil }
|
func (deps) StartCPUProfile(io.Writer) error { return nil }
|
||||||
|
func (deps) StartTestLog(io.Writer) {}
|
||||||
func (deps) StopCPUProfile() {}
|
func (deps) StopCPUProfile() {}
|
||||||
|
func (deps) StopTestLog() error { return nil }
|
||||||
func (deps) WriteHeapProfile(io.Writer) error { return nil }
|
func (deps) WriteHeapProfile(io.Writer) error { return nil }
|
||||||
func (deps) WriteProfileTo(string, io.Writer, int) error { return nil }
|
func (deps) WriteProfileTo(string, io.Writer, int) error { return nil }
|
||||||
func (deps) ImportPath() string { return "" }
|
|
||||||
|
|
||||||
var match deps
|
var match deps
|
||||||
{{else}}
|
{{else}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user