go/test/testlib
Shenghou Ma dda6d6aa70 test: use testlib in a few more cases (part 2)
Introduced "runoutput" cmd for running generated program

R=golang-dev, iant, bradfitz, remyoudompheng
CC=golang-dev
https://golang.org/cl/5869049
2012-04-20 23:45:43 +08:00

49 lines
712 B
Text

# Copyright 2012 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# These function names are also known to
# (and are the plan for transitioning to) run.go.
compile() {
$G $D/$F.go
}
build() {
$G $D/$F.go && $L $F.$A
}
runoutput() {
go run "$D/$F.go" > tmp.go
go run tmp.go
}
run() {
gofiles=""
ingo=true
while $ingo; do
case "$1" in
*.go)
gofiles="$gofiles $1"
shift
;;
*)
ingo=false
;;
esac
done
$G $D/$F.go $gofiles && $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
}
skip() {
true
}