From d9abca81c087448e305e4992d3056407a217f2cf Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 22 Jan 2009 14:23:50 -0800 Subject: [PATCH] let test sources specify commands to run before their compilation. R=r OCL=23300 CL=23300 --- src/cmd/gotest/gotest | 5 +++++ 1 file changed, 5 insertions(+) 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