From: Russ Cox Date: Thu, 22 Jan 2009 22:23:50 +0000 (-0800) Subject: let test sources specify commands to run X-Git-Tag: weekly.2009-11-06~2313 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d9abca81c087448e305e4992d3056407a217f2cf;p=gostls13.git let test sources specify commands to run before their compilation. R=r OCL=23300 CL=23300 --- diff --git a/src/cmd/gotest/gotest b/src/cmd/gotest/gotest index 82cc7381c3..d95201ad87 100755 --- a/src/cmd/gotest/gotest +++ b/src/cmd/gotest/gotest @@ -33,6 +33,11 @@ esac ofiles=$(echo $gofiles | sed 's/\.go/.6/g') files=$(echo $gofiles | sed 's/\.go//g') +# Run any commands given in sources, like +# // gotest: 6g foo.go +# to build any test-only dependencies. +sed -n 's/^\/\/ gotest: //p' $gofiles | sh + for i in $gofiles do 6g $i