aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/example_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-02-15 00:36:50 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-02-15 00:36:50 +0000
commitc8530c410972f09b88bb143e5e5a4910bd72b2ee (patch)
tree93d9f78cf295af4117b6d17f89039e06a631b118 /libgo/go/runtime/example_test.go
parentb90fff0cc04c63d7cf23d689dbf1bc91f799de2c (diff)
downloadgcc-c8530c410972f09b88bb143e5e5a4910bd72b2ee.zip
gcc-c8530c410972f09b88bb143e5e5a4910bd72b2ee.tar.gz
gcc-c8530c410972f09b88bb143e5e5a4910bd72b2ee.tar.bz2
re PR go/89168 (FAIL: cmd/go/internal/load)
PR go/89168 libgo: change gotest to run examples with output Change the gotest script to act like "go test" and run examples that have "output" comments. This is not done with full generality, but just enough to run the libgo tests. Other packages should be tested with "go test" as usual. While we're here clean up some old bits of gotest, and only run TestXXX functions that are actually in *_test.go files. The latter change should fix https://gcc.gnu.org/PR89168. Reviewed-on: https://go-review.googlesource.com/c/162139 From-SVN: r268922
Diffstat (limited to 'libgo/go/runtime/example_test.go')
-rw-r--r--libgo/go/runtime/example_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/libgo/go/runtime/example_test.go b/libgo/go/runtime/example_test.go
index e4912a5..8dac9297 100644
--- a/libgo/go/runtime/example_test.go
+++ b/libgo/go/runtime/example_test.go
@@ -31,7 +31,7 @@ func ExampleFrames() {
// To keep this example's output stable
// even if there are changes in the testing package,
// stop unwinding when we leave package runtime.
- if !strings.Contains(frame.File, "runtime/") {
+ if !strings.Contains(frame.File, "runtime/") && !strings.Contains(frame.File, "/test/") {
break
}
fmt.Printf("- more:%v | %s\n", more, frame.Function)
@@ -47,8 +47,8 @@ func ExampleFrames() {
a()
// Output:
// - more:true | runtime.Callers
- // - more:true | runtime_test.ExampleFrames.func1
- // - more:true | runtime_test.ExampleFrames.func2
- // - more:true | runtime_test.ExampleFrames.func3
+ // - more:true | runtime_test.ExampleFrames..func1
+ // - more:true | runtime_test.ExampleFrames..func2
+ // - more:true | runtime_test.ExampleFrames..func3
// - more:true | runtime_test.ExampleFrames
}