1# Copyright 2012 The Go Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style 3# license that can be found in the LICENSE file. 4 5# These function names are also known to 6# (and are the plan for transitioning to) run.go. 7 8compile() { 9 $G $D/$F.go 10} 11 12compiledir() { 13 for gofile in $D/$F.dir/*.go 14 do 15 $G -I. "$gofile" || return 1 16 done 17} 18 19build() { 20 $G $D/$F.go && $L $F.$A 21} 22 23runoutput() { 24 go run "$D/$F.go" > tmp.go 25 go run tmp.go 26} 27 28run() { 29 gofiles="" 30 ingo=true 31 while $ingo; do 32 case "$1" in 33 *.go) 34 gofiles="$gofiles $1" 35 shift 36 ;; 37 *) 38 ingo=false 39 ;; 40 esac 41 done 42 43 $G $D/$F.go $gofiles && $L $F.$A && ./$A.out "$@" 44} 45 46cmpout() { 47 $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out 48} 49 50errorcheck() { 51 zero="" 52 if [ "$1" = "-0" ]; then 53 zero="-0" 54 shift 55 fi 56 errchk $zero $G -e $* $D/$F.go 57} 58 59skip() { 60 true 61} 62