1
0
mirror of https://github.com/golang/go synced 2024-11-13 17:50:23 -07:00

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
This commit is contained in:
Russ Cox 2009-01-22 15:41:12 -08:00
parent ae299f0d69
commit 8c5bc7e93a

View File

@ -8,6 +8,11 @@
# tests. # tests.
# If files are named on the command line, use them instead of test*.go. # 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="" gofiles=""
loop=true loop=true
while $loop; do while $loop; do
@ -27,20 +32,27 @@ done
case "x$gofiles" in case "x$gofiles" in
x) 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 esac
ofiles=$(echo $gofiles | sed 's/\.go/.6/g') ofiles=$(echo $gofiles | sed 's/\.go/.6/g')
files=$(echo $gofiles | sed 's/\.go//g') files=$(echo $gofiles | sed 's/\.go//g')
# Run any commands given in sources, like # Run any commands given in sources, like
# // gotest: 6g foo.go # // gotest: $GC foo.go
# to build any test-only dependencies. # to build any test-only dependencies.
sed -n 's/^\/\/ gotest: //p' $gofiles | sh sed -n 's/^\/\/ gotest: //p' $gofiles | sh
for i in $gofiles for i in $gofiles
do do
6g $i $GC $i
done done
set -e set -e
@ -84,6 +96,6 @@ trap "rm -f _testmain.go _testmain.6" 0 1 2 3 14 15
echo '}' echo '}'
}>_testmain.go }>_testmain.go
6g _testmain.go $GC _testmain.go
6l _testmain.6 $GL _testmain.$O
./6.out "$@" ./$O.out "$@"