aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/syntax/parser_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/syntax/parser_test.go')
-rw-r--r--src/cmd/compile/internal/syntax/parser_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/syntax/parser_test.go b/src/cmd/compile/internal/syntax/parser_test.go
index 74583ca903..d5d4290f59 100644
--- a/src/cmd/compile/internal/syntax/parser_test.go
+++ b/src/cmd/compile/internal/syntax/parser_test.go
@@ -70,6 +70,18 @@ func TestStdLib(t *testing.T) {
filepath.Join(goroot, "src"),
filepath.Join(goroot, "misc"),
} {
+ if filepath.Base(dir) == "misc" {
+ // cmd/distpack deletes GOROOT/misc, so skip that directory if it isn't present.
+ // cmd/distpack also requires GOROOT/VERSION to exist, so use that to
+ // suppress false-positive skips.
+ if _, err := os.Stat(dir); os.IsNotExist(err) {
+ if _, err := os.Stat(filepath.Join(testenv.GOROOT(t), "VERSION")); err == nil {
+ fmt.Printf("%s not present; skipping\n", dir)
+ continue
+ }
+ }
+ }
+
walkDirs(t, dir, func(filename string) {
if skipRx != nil && skipRx.MatchString(filename) {
// Always report skipped files since regexp