summaryrefslogtreecommitdiff
path: root/test/testlib
diff options
context:
space:
mode:
Diffstat (limited to 'test/testlib')
-rw-r--r--test/testlib44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/testlib b/test/testlib
new file mode 100644
index 000000000..3858431a7
--- /dev/null
+++ b/test/testlib
@@ -0,0 +1,44 @@
+# 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
+}
+
+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
+}