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>
This commit is contained in:
Than McIntosh 2018-07-20 07:38:10 -04:00
parent e68ac45172
commit f4c787b6cf

View file

@ -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)
}