diff options
author | Russ Cox <rsc@golang.org> | 2009-01-22 15:41:12 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-01-22 15:41:12 -0800 |
commit | ca01b9bdc8fc325f98c57b1949942edfc00867f7 (patch) | |
tree | 2ff7d53a72e0f91fcab24c7620408c7391f6f693 /src | |
parent | 8976570dd91a5674b5dcd2e85167151ee7b1033d (diff) | |
download | golang-ca01b9bdc8fc325f98c57b1949942edfc00867f7.tar.gz |
use $GC, $GL in gotest, to match gccgo's gotest.
use $GC in all_test.go for portability.
R=r
DELTA=19 (12 added, 0 deleted, 7 changed)
OCL=23305
CL=23325
Diffstat (limited to 'src')
-rwxr-xr-x | src/cmd/gotest/gotest | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/cmd/gotest/gotest b/src/cmd/gotest/gotest index d95201ad8..f292034cb 100755 --- a/src/cmd/gotest/gotest +++ b/src/cmd/gotest/gotest @@ -8,6 +8,11 @@ # tests. # If files are named on the command line, use them instead of test*.go. +O=6 +GC=${GC:-${O}g} +GL=${GL:-${O}l} +export GC GL + gofiles="" loop=true while $loop; do @@ -27,20 +32,27 @@ done case "x$gofiles" in x) - gofiles=$(echo *test.go) + gofiles=$(ls *_test.go 2>/dev/null) +esac + +case "x$gofiles" in +x) + echo 'no test files found' 1>&2 + exit 1 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 +# // gotest: $GC foo.go # to build any test-only dependencies. sed -n 's/^\/\/ gotest: //p' $gofiles | sh for i in $gofiles do - 6g $i + $GC $i done set -e @@ -84,6 +96,6 @@ trap "rm -f _testmain.go _testmain.6" 0 1 2 3 14 15 echo '}' }>_testmain.go -6g _testmain.go -6l _testmain.6 -./6.out "$@" +$GC _testmain.go +$GL _testmain.$O +./$O.out "$@" |