]> Cypherpunks repositories - gostls13.git/commitdiff
let test sources specify commands to run
authorRuss Cox <rsc@golang.org>
Thu, 22 Jan 2009 22:23:50 +0000 (14:23 -0800)
committerRuss Cox <rsc@golang.org>
Thu, 22 Jan 2009 22:23:50 +0000 (14:23 -0800)
before their compilation.

R=r
OCL=23300
CL=23300

src/cmd/gotest/gotest

index 82cc7381c3a3d9280a0b2afe4fccdddc75ae73df..d95201ad87b8baf888399707bb8100c3e2a8c3e5 100755 (executable)
@@ -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