diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2012-02-24 13:17:26 +1100 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2012-02-24 13:17:26 +1100 |
commit | 733014fdbf3f2981c40bf66abcb17a30957b4e39 (patch) | |
tree | 6403300975f3c046a1a603f811ca7ae7eece534b | |
parent | aa673e7253933957bc63e8884295c64da3f50c23 (diff) | |
download | go-733014fdbf3f2981c40bf66abcb17a30957b4e39.tar.gz |
test: add cmpout to testlib
R=golang-dev, r
CC=golang-dev
http://codereview.appspot.com/5699060
-rw-r--r-- | test/deferprint.go | 2 | ||||
-rw-r--r-- | test/fixedbugs/bug328.go | 2 | ||||
-rw-r--r-- | test/fixedbugs/bug409.go | 2 | ||||
-rw-r--r-- | test/goprint.go | 2 | ||||
-rw-r--r-- | test/helloworld.go | 2 | ||||
-rw-r--r-- | test/ken/cplx0.go | 2 | ||||
-rw-r--r-- | test/ken/string.go | 2 | ||||
-rw-r--r-- | test/printbig.go | 2 | ||||
-rw-r--r-- | test/run.go | 3 | ||||
-rw-r--r-- | test/testlib | 4 |
10 files changed, 15 insertions, 8 deletions
diff --git a/test/deferprint.go b/test/deferprint.go index eab7ed465..72c98b19f 100644 --- a/test/deferprint.go +++ b/test/deferprint.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/fixedbugs/bug328.go b/test/fixedbugs/bug328.go index 825298371..73ab46d45 100644 --- a/test/fixedbugs/bug328.go +++ b/test/fixedbugs/bug328.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/fixedbugs/bug409.go b/test/fixedbugs/bug409.go index 884d33370..1dca43b7a 100644 --- a/test/fixedbugs/bug409.go +++ b/test/fixedbugs/bug409.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/goprint.go b/test/goprint.go index 3fe08f307..2f0d3c390 100644 --- a/test/goprint.go +++ b/test/goprint.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/helloworld.go b/test/helloworld.go index 9c33cab3b..5025ec9bb 100644 --- a/test/helloworld.go +++ b/test/helloworld.go @@ -1,4 +1,4 @@ -// $G $F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/ken/cplx0.go b/test/ken/cplx0.go index f38ce5b65..912b8c489 100644 --- a/test/ken/cplx0.go +++ b/test/ken/cplx0.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/ken/string.go b/test/ken/string.go index e05108242..9bd905d3d 100644 --- a/test/ken/string.go +++ b/test/ken/string.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/printbig.go b/test/printbig.go index 6985796f3..5693c58d4 100644 --- a/test/printbig.go +++ b/test/printbig.go @@ -1,4 +1,4 @@ -// $G $F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/test/run.go b/test/run.go index 4d4488a45..3ba35f9d4 100644 --- a/test/run.go +++ b/test/run.go @@ -238,6 +238,9 @@ func (t *test) run() { action = strings.TrimSpace(action) switch action { + case "cmpout": + action = "run" // the run case already looks for <dir>/<test>.out files + fallthrough case "compile", "build", "run", "errorcheck": t.action = action default: diff --git a/test/testlib b/test/testlib index ea8c5d74e..2e4fefc8c 100644 --- a/test/testlib +++ b/test/testlib @@ -17,6 +17,10 @@ run() { $G $D/$F.go && $L $F.$A && ./$A.out "$@" } +cmpout() { + $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +} + errorcheck() { errchk $G -e $D/$F.go } |