LEFT | RIGHT |
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 goarch=$(go env GOARCH) | 8 goos=$(go env GOOS) |
9 | 9 |
10 defer_panic_recover=" | 10 defer_panic_recover=" |
11 defer | 11 defer |
12 defer2 | 12 defer2 |
13 " | 13 " |
14 | 14 |
15 effective_go=" | 15 effective_go=" |
16 eff_bytesize | 16 eff_bytesize |
17 eff_qr | 17 eff_qr |
18 eff_sequence | 18 eff_sequence |
(...skipping 11 matching lines...) Expand all Loading... |
30 interface2 | 30 interface2 |
31 " | 31 " |
32 | 32 |
33 c_go_cgo=" | 33 c_go_cgo=" |
34 cgo1 | 34 cgo1 |
35 cgo2 | 35 cgo2 |
36 cgo3 | 36 cgo3 |
37 cgo4 | 37 cgo4 |
38 " | 38 " |
39 # cgo1 and cgo2 don't run on freebsd, srandom has a different signature | 39 # cgo1 and cgo2 don't run on freebsd, srandom has a different signature |
40 if [[ $goarch != "freebsd" ]]; then | 40 if [ "$goos" == "freebsd" ]; then |
41 c_go_cgo="cgo3 cgo4" | 41 c_go_cgo="cgo3 cgo4" |
42 fi | 42 fi |
43 | 43 |
44 all=$(echo $defer_panic_recover $effective_go $error_handling $law_of_reflection
$c_go_cgo slices go1) | 44 all=$(echo $defer_panic_recover $effective_go $error_handling $law_of_reflection
$c_go_cgo slices go1) |
45 | 45 |
46 for i in $all; do | 46 for i in $all; do |
47 go build $i.go | 47 go build $i.go |
48 done | 48 done |
49 | 49 |
50 # Write to temporary file to avoid mingw bash bug. | 50 # Write to temporary file to avoid mingw bash bug. |
(...skipping 13 matching lines...) Expand all Loading... |
64 testit defer2 '^Calling g. Printing in g 0 Printing in g 1 Printing in g 2 Print
ing in g 3 Panicking! Defer in g 3 Defer in g 2 Defer in g 1 Defer in g 0 Recove
red in f 4 Returned normally from f.$' | 64 testit defer2 '^Calling g. Printing in g 0 Printing in g 1 Printing in g 2 Print
ing in g 3 Panicking! Defer in g 3 Defer in g 2 Defer in g 1 Defer in g 0 Recove
red in f 4 Returned normally from f.$' |
65 | 65 |
66 testit eff_bytesize '^1.00YB 9.09TB$' | 66 testit eff_bytesize '^1.00YB 9.09TB$' |
67 testit eff_sequence '^\[-1 2 6 16 44\]$' | 67 testit eff_sequence '^\[-1 2 6 16 44\]$' |
68 | 68 |
69 testit go1 '^Christmas is a holiday: true Sleeping for 0.123s.*go1.go already ex
ists$' | 69 testit go1 '^Christmas is a holiday: true Sleeping for 0.123s.*go1.go already ex
ists$' |
70 | 70 |
71 testit interface2 "^type: float64$" | 71 testit interface2 "^type: float64$" |
72 | 72 |
73 rm -f $all "$TMPFILE" | 73 rm -f $all "$TMPFILE" |
LEFT | RIGHT |