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 82cc738..d95201a 100755
--- a/src/cmd/gotest/gotest
+++ b/src/cmd/gotest/gotest
@@ -33,6 +33,11 @@
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