Commit f4c787b6 authored by Than McIntosh's avatar Than McIntosh

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/125295Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: default avatarAustin Clements <austin@google.com>
parent e68ac451
...@@ -24,7 +24,8 @@ import ( ...@@ -24,7 +24,8 @@ import (
const ( const (
DefaultOpt = "-gcflags=" DefaultOpt = "-gcflags="
NoOpt = "-gcflags=-l -N" NoOpt = "-gcflags=-l -N"
OptInl4 = "-gcflags=all=-l=4" OptInl4 = "-gcflags=-l=4"
OptAllInl4 = "-gcflags=all=-l=4"
) )
func TestRuntimeTypesPresent(t *testing.T) { func TestRuntimeTypesPresent(t *testing.T) {
...@@ -610,7 +611,9 @@ func main() { ...@@ -610,7 +611,9 @@ func main() {
// Note: this is a build with "-l=4", as opposed to "-l -N". The // 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 // 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) f := gobuild(t, dir, prog, OptInl4)
d, err := f.DWARF() d, err := f.DWARF()
...@@ -794,6 +797,10 @@ func abstractOriginSanity(t *testing.T, gopathdir string, flags string) { ...@@ -794,6 +797,10 @@ func abstractOriginSanity(t *testing.T, gopathdir string, flags string) {
func TestAbstractOriginSanity(t *testing.T) { func TestAbstractOriginSanity(t *testing.T) {
testenv.MustHaveGoBuild(t) testenv.MustHaveGoBuild(t)
if testing.Short() {
t.Skip("skipping test in short mode.")
}
if runtime.GOOS == "plan9" { if runtime.GOOS == "plan9" {
t.Skip("skipping on plan9; no DWARF symbol table in executables") t.Skip("skipping on plan9; no DWARF symbol table in executables")
} }
...@@ -803,7 +810,7 @@ func TestAbstractOriginSanity(t *testing.T) { ...@@ -803,7 +810,7 @@ func TestAbstractOriginSanity(t *testing.T) {
if wd, err := os.Getwd(); err == nil { if wd, err := os.Getwd(); err == nil {
gopathdir := filepath.Join(wd, "testdata", "httptest") gopathdir := filepath.Join(wd, "testdata", "httptest")
abstractOriginSanity(t, gopathdir, OptInl4) abstractOriginSanity(t, gopathdir, OptAllInl4)
} else { } else {
t.Fatalf("os.Getwd() failed %v", err) t.Fatalf("os.Getwd() failed %v", err)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment