diff options
author | Russ Cox <rsc@golang.org> | 2012-03-08 14:03:40 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2012-03-08 14:03:40 -0500 |
commit | ce52a22d7fc001d930bc562b0763cbd02da85e75 (patch) | |
tree | ff7b11390b07867de0f7be76c441017dfe12b05c /test/run.go | |
parent | 78ec96b801d2575d2b05228791d672914e3e490f (diff) | |
download | go-ce52a22d7fc001d930bc562b0763cbd02da85e75.tar.gz |
test: skip . files in directory
Xcode generates ._foo.go files.
R=golang-dev, gri
CC=golang-dev
http://codereview.appspot.com/5786055
Diffstat (limited to 'test/run.go')
-rw-r--r-- | test/run.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/run.go b/test/run.go index c9c78b568..bf79079b6 100644 --- a/test/run.go +++ b/test/run.go @@ -147,7 +147,7 @@ func goFiles(dir string) []string { check(err) names := []string{} for _, name := range dirnames { - if strings.HasSuffix(name, ".go") { + if !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go") { names = append(names, name) } } @@ -239,7 +239,7 @@ func (t *test) run() { if strings.HasPrefix(action, "//") { action = action[2:] } - + var args []string f := strings.Fields(action) if len(f) > 0 { @@ -264,7 +264,7 @@ func (t *test) run() { err = ioutil.WriteFile(filepath.Join(t.tempDir, t.gofile), srcBytes, 0644) check(err) - + // A few tests (of things like the environment) require these to be set. os.Setenv("GOOS", runtime.GOOS) os.Setenv("GOARCH", runtime.GOARCH) @@ -283,7 +283,7 @@ func (t *test) run() { } long := filepath.Join(cwd, t.goFileName()) - switch action { + switch action { default: t.err = fmt.Errorf("unimplemented action %q", action) @@ -291,19 +291,19 @@ func (t *test) run() { out, _ := runcmd("go", "tool", gc, "-e", "-o", "a."+letter, long) t.err = t.errorCheck(string(out), long, t.gofile) return - + case "compile": out, err := runcmd("go", "tool", gc, "-e", "-o", "a."+letter, long) if err != nil { t.err = fmt.Errorf("%s\n%s", err, out) } - + case "build": out, err := runcmd("go", "build", "-o", "a.exe", long) if err != nil { t.err = fmt.Errorf("%s\n%s", err, out) } - + case "run": useTmp = false out, err := runcmd(append([]string{"go", "run", t.goFileName()}, args...)...) |