Commit e014cf0e authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

test: add cmpout to testlib

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5699060
parent 5cff0299
// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out // cmpout
// Copyright 2010 The Go Authors. All rights reserved. // Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out // cmpout
// Copyright 2011 The Go Authors. All rights reserved. // Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out // cmpout
// Copyright 2012 The Go Authors. All rights reserved. // Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out // cmpout
// Copyright 2011 The Go Authors. All rights reserved. // Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// $G $F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out // cmpout
// Copyright 2009 The Go Authors. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out // cmpout
// Copyright 2010 The Go Authors. All rights reserved. // Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out // cmpout
// Copyright 2009 The Go Authors. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
// $G $F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out // cmpout
// Copyright 2009 The Go Authors. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
...@@ -238,6 +238,9 @@ func (t *test) run() { ...@@ -238,6 +238,9 @@ func (t *test) run() {
action = strings.TrimSpace(action) action = strings.TrimSpace(action)
switch action { switch action {
case "cmpout":
action = "run" // the run case already looks for <dir>/<test>.out files
fallthrough
case "compile", "build", "run", "errorcheck": case "compile", "build", "run", "errorcheck":
t.action = action t.action = action
default: default:
......
...@@ -17,6 +17,10 @@ run() { ...@@ -17,6 +17,10 @@ run() {
$G $D/$F.go && $L $F.$A && ./$A.out "$@" $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() { errorcheck() {
errchk $G -e $D/$F.go errchk $G -e $D/$F.go
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment