OLD | NEW |
1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
2 # Copyright 2009 The Go Authors. All rights reserved. | 2 # Copyright 2009 The Go Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style | 3 # Use of this source code is governed by a BSD-style |
4 # license that can be found in the LICENSE file. | 4 # license that can be found in the LICENSE file. |
5 | 5 |
6 # Run the interpreter against all the Go test programs | 6 # Run the interpreter against all the Go test programs |
7 # that begin with the magic | 7 # that begin with the magic |
8 # // $G $D/$F.go && $L $F.$A && ./$A.out | 8 # // $G $D/$F.go && $L $F.$A && ./$A.out |
9 # line and do not contain imports. | 9 # line and do not contain imports. |
10 | 10 |
11 set -e | 11 set -e |
12 make | 12 make |
13 6g main.go && 6l main.6 | 13 6g main.go && 6l main.6 |
14 ( | 14 ( |
15 for i in $(egrep -l '// \$G (\$D/)?\$F\.go \&\& \$L \$F\.\$A && \./\$A\.out' $GO
ROOT/test/*.go $GOROOT/test/*/*.go) | 15 for i in $(egrep -l '// \$G (\$D/)?\$F\.go \&\& \$L \$F\.\$A && \./\$A\.out' "$G
OROOT"/test/*.go "$GOROOT"/test/*/*.go) |
16 do | 16 do |
17 if grep '^import' $i >/dev/null 2>&1 | 17 if grep '^import' $i >/dev/null 2>&1 |
18 then | 18 then |
19 true | 19 true |
20 else | 20 else |
21 » » if $GOROOT/usr/austin/eval/6.out -f $i >/tmp/out 2>&1 && ! test
-s /tmp/out | 21 » » if "$GOROOT"/usr/austin/eval/6.out -f $i >/tmp/out 2>&1 && ! tes
t -s /tmp/out |
22 then | 22 then |
23 echo PASS $i | 23 echo PASS $i |
24 else | 24 else |
25 echo FAIL $i | 25 echo FAIL $i |
26 ( | 26 ( |
27 echo '>>> ' $i | 27 echo '>>> ' $i |
28 cat /tmp/out | 28 cat /tmp/out |
29 echo | 29 echo |
30 ) 1>&3 | 30 ) 1>&3 |
31 fi | 31 fi |
32 fi | 32 fi |
33 done | (tee /dev/fd/2 | awk '{print $1}' | sort | uniq -c) 2>&1 | 33 done | (tee /dev/fd/2 | awk '{print $1}' | sort | uniq -c) 2>&1 |
34 ) 3>test.log | 34 ) 3>test.log |
OLD | NEW |