summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2014-09-11 12:47:17 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2014-09-11 12:47:17 -0700
commitbc655bc6a455958accbfe1003e0cf7f8238b130c (patch)
treeb8f8e0894abaaaa01d28e482a4b411c12645d897 /test
parent982283e152cec292f06137d41f61dfb99abe3da2 (diff)
downloadgo-bc655bc6a455958accbfe1003e0cf7f8238b130c.tar.gz
test: return errors earlier in run.go
Fixes issue 8184. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://codereview.appspot.com/137510043
Diffstat (limited to 'test')
-rw-r--r--test/run.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/run.go b/test/run.go
index 483775d84..28882cf54 100644
--- a/test/run.go
+++ b/test/run.go
@@ -626,6 +626,7 @@ func (t *test) run() {
out, err := runcmd(append([]string{"go", "run", t.goFileName()}, args...)...)
if err != nil {
t.err = err
+ return
}
if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() {
t.err = fmt.Errorf("incorrect output\n%s", out)
@@ -640,6 +641,7 @@ func (t *test) run() {
out, err := runcmd(append([]string{"go", "run", t.goFileName()}, args...)...)
if err != nil {
t.err = err
+ return
}
tfile := filepath.Join(t.tempDir, "tmp__.go")
if err := ioutil.WriteFile(tfile, out, 0666); err != nil {
@@ -649,6 +651,7 @@ func (t *test) run() {
out, err = runcmd("go", "run", tfile)
if err != nil {
t.err = err
+ return
}
if string(out) != t.expectedOutput() {
t.err = fmt.Errorf("incorrect output\n%s", out)
@@ -659,6 +662,7 @@ func (t *test) run() {
out, err := runcmd(append([]string{"go", "run", t.goFileName()}, args...)...)
if err != nil {
t.err = err
+ return
}
tfile := filepath.Join(t.tempDir, "tmp__.go")
err = ioutil.WriteFile(tfile, out, 0666)