From f4c787b6cf3a90c32ecf9f885d8c32c6a675050b Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Fri, 20 Jul 2018 07:38:10 -0400 Subject: [PATCH] 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 Reviewed-by: Austin Clements --- src/cmd/link/internal/ld/dwarf_test.go | 13 ++++++++++--- 1 file 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) }