aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2018-07-20 07:38:10 -0400
committerThan McIntosh <thanm@google.com>2018-07-20 18:29:38 +0000
commitf4c787b6cf3a90c32ecf9f885d8c32c6a675050b (patch)
tree0b704791cf9298e01a106c9a4a0daeb10cffebad /src
parente68ac45172e56e583280191ea7080f60aed7c9a2 (diff)
downloadgo-f4c787b6cf3a90c32ecf9f885d8c32c6a675050b.tar.xz
cmd/link: skip a couple of DWARF tests in short mode
Rejigger the DWARF tests to ensure that they run in a reasonable amount of time in short mode, particularly the "abstract origin sanity" testpoints. Updates #26470 Change-Id: Idae9763ac20ea999fa394595aacfcd1e271293ae Reviewed-on: https://go-review.googlesource.com/125295 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/link/internal/ld/dwarf_test.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cmd/link/internal/ld/dwarf_test.go b/src/cmd/link/internal/ld/dwarf_test.go
index ea89b72cad..12eb1b73f4 100644
--- a/src/cmd/link/internal/ld/dwarf_test.go
+++ b/src/cmd/link/internal/ld/dwarf_test.go
@@ -24,7 +24,8 @@ import (
const (
DefaultOpt = "-gcflags="
NoOpt = "-gcflags=-l -N"
- OptInl4 = "-gcflags=all=-l=4"
+ OptInl4 = "-gcflags=-l=4"
+ OptAllInl4 = "-gcflags=all=-l=4"
)
func TestRuntimeTypesPresent(t *testing.T) {
@@ -610,7 +611,9 @@ func main() {
// Note: this is a build with "-l=4", as opposed to "-l -N". The
// test is intended to verify DWARF that is only generated when
- // the inliner is active.
+ // the inliner is active. We're only going to look at the DWARF for
+ // main.main, however, hence we build with "-gcflags=-l=4" as opposed
+ // to "-gcflags=all=-l=4".
f := gobuild(t, dir, prog, OptInl4)
d, err := f.DWARF()
@@ -794,6 +797,10 @@ func abstractOriginSanity(t *testing.T, gopathdir string, flags string) {
func TestAbstractOriginSanity(t *testing.T) {
testenv.MustHaveGoBuild(t)
+ if testing.Short() {
+ t.Skip("skipping test in short mode.")
+ }
+
if runtime.GOOS == "plan9" {
t.Skip("skipping on plan9; no DWARF symbol table in executables")
}
@@ -803,7 +810,7 @@ func TestAbstractOriginSanity(t *testing.T) {
if wd, err := os.Getwd(); err == nil {
gopathdir := filepath.Join(wd, "testdata", "httptest")
- abstractOriginSanity(t, gopathdir, OptInl4)
+ abstractOriginSanity(t, gopathdir, OptAllInl4)
} else {
t.Fatalf("os.Getwd() failed %v", err)
}