Left: | ||
Right: |
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 set -e | 6 set -e |
7 | 7 |
8 eval $(gomake --no-print-directory -f ../../src/Make.inc go-env) | 8 eval $(gomake --no-print-directory -f ../../src/Make.inc go-env) |
9 | 9 |
10 if [ -z "$O" ]; then | 10 if [ -z "$O" ]; then |
(...skipping 24 matching lines...) Expand all Loading... | |
35 sieve1.go \ | 35 sieve1.go \ |
36 server1.go \ | 36 server1.go \ |
37 strings.go \ | 37 strings.go \ |
38 eff_bytesize.go\ | 38 eff_bytesize.go\ |
39 eff_qr.go \ | 39 eff_qr.go \ |
40 eff_sequence.go\ | 40 eff_sequence.go\ |
41 ; do | 41 ; do |
42 $GC $i | 42 $GC $i |
43 done | 43 done |
44 | 44 |
45 TMPFILE="/tmp/gotest3-$$-$USER" | |
rsc
2011/09/12 17:00:24
# Write to temporary file to avoid mingw bash bug.
jp
2011/09/12 18:10:05
ok.
I added this comment into test/run as well.
It
| |
46 | |
45 function testit { | 47 function testit { |
46 $LD $1.$O | 48 $LD $1.$O |
47 » x=$(echo $(./$O.out $2 2>&1)) # extra echo canonicalizes | 49 » ./$O.out $2 2>&1 >"$TMPFILE" |
50 » x=$(echo $(cat "$TMPFILE")) # extra echo canonicalizes | |
48 if [ "$x" != "$3" ] | 51 if [ "$x" != "$3" ] |
49 then | 52 then |
50 echo $1 failed: '"'$x'"' is not '"'$3'"' | 53 echo $1 failed: '"'$x'"' is not '"'$3'"' |
51 fi | 54 fi |
52 } | 55 } |
53 | 56 |
54 function testitpipe { | 57 function testitpipe { |
55 $LD $1.$O | 58 $LD $1.$O |
56 » x=$(echo $(./$O.out | $2 2>&1)) # extra echo canonicalizes | 59 » ./$O.out | $2 2>&1 >"$TMPFILE" |
60 » x=$(echo $(cat "$TMPFILE")) # extra echo canonicalizes | |
57 if [ "$x" != "$3" ] | 61 if [ "$x" != "$3" ] |
58 then | 62 then |
59 echo $1 failed: '"'$x'"' is not '"'$3'"' | 63 echo $1 failed: '"'$x'"' is not '"'$3'"' |
60 fi | 64 fi |
61 } | 65 } |
62 | 66 |
63 | 67 |
64 testit helloworld "" "Hello, world; or Καλημέρα κόσμε; or こんにちは 世界" | 68 testit helloworld "" "Hello, world; or Καλημέρα κόσμε; or こんにちは 世界" |
65 testit helloworld3 "" "hello, world can't open file; err=no such file or directo ry" | 69 testit helloworld3 "" "hello, world can't open file; err=no such file or directo ry" |
66 testit echo "hello, world" "hello, world" | 70 testit echo "hello, world" "hello, world" |
(...skipping 14 matching lines...) Expand all Loading... | |
81 testitpipe sieve "sed 10q" "2 3 5 7 11 13 17 19 23 29" | 85 testitpipe sieve "sed 10q" "2 3 5 7 11 13 17 19 23 29" |
82 testitpipe sieve "sed 10q" "2 3 5 7 11 13 17 19 23 29" | 86 testitpipe sieve "sed 10q" "2 3 5 7 11 13 17 19 23 29" |
83 | 87 |
84 # server hangs; don't run it, just compile it | 88 # server hangs; don't run it, just compile it |
85 $GC server.go | 89 $GC server.go |
86 testit server1 "" "" | 90 testit server1 "" "" |
87 | 91 |
88 testit eff_bytesize "" "1.00YB 9.09TB" | 92 testit eff_bytesize "" "1.00YB 9.09TB" |
89 testit eff_sequence "" "[-1 2 6 16 44]" | 93 testit eff_sequence "" "[-1 2 6 16 44]" |
90 | 94 |
91 rm -f $O.out *.$O | 95 rm -f $O.out $O.out.exe *.$O "$TMPFILE" |
OLD | NEW |