1
0
mirror of https://github.com/golang/go synced 2024-10-03 16:31:27 -06:00
go/test/testlib
Russ Cox cd22afa07b test: expand run.go's errorcheck, make clear which bugs run
Today, if run.go doesn't understand a test header line it just ignores
the test, making it too easy to write or edit tests that are not actually
being run.

- expand errorcheck to accept flags, so that bounds.go and escape*.go can run.
- create a whitelist of skippable tests in run.go; skipping others is an error.
- mark all skipped tests at top of file.

Update #4139.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6549054
2012-09-23 13:16:14 -04:00

62 lines
865 B
Plaintext

# 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
}
compiledir() {
for gofile in $D/$F.dir/*.go
do
$G ${gofile} || return 1
done
}
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() {
zero=""
if [ "$1" = "-0" ]; then
zero="-0"
shift
fi
errchk $zero $G -e $* $D/$F.go
}
skip() {
true
}