Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(833)

Delta Between Two Patch Sets: src/cmd/go/test.bash

Issue 149720043: code review 149720043: cmd/go: prohibit C sources files unless using cgo (Closed)
Left Patch Set: Created 9 years, 6 months ago
Right Patch Set: diff -r 2f66d595a9ec50db3bf4fe871c6a25a5fff21df3 https://code.google.com/p/go/ Created 9 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/go/pkg.go ('k') | src/cmd/go/testdata/src/badc/x.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 #!/bin/bash 1 #!/bin/bash
2 # Copyright 2012 The Go Authors. All rights reserved. 2 # Copyright 2012 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 go build -o testgo 7 go build -o testgo
8 go() { 8 go() {
9 echo TEST ERROR: ran go, not testgo: go "$@" >&2 9 echo TEST ERROR: ran go, not testgo: go "$@" >&2
10 exit 2 10 exit 2
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 echo 'go build did not mention syntax error:' 144 echo 'go build did not mention syntax error:'
145 cat testdata/err 145 cat testdata/err
146 ok=false 146 ok=false
147 fi 147 fi
148 TEST 'import comment - conflict' 148 TEST 'import comment - conflict'
149 if ./testgo build ./testdata/importcom/conflict.go 2>testdata/err; then 149 if ./testgo build ./testdata/importcom/conflict.go 2>testdata/err; then
150 echo 'go build ./testdata/importcom/conflict.go suceeded' 150 echo 'go build ./testdata/importcom/conflict.go suceeded'
151 ok=false 151 ok=false
152 elif ! grep 'found import comments' testdata/err >/dev/null; then 152 elif ! grep 'found import comments' testdata/err >/dev/null; then
153 echo 'go build did not mention comment conflict:' 153 echo 'go build did not mention comment conflict:'
154 cat testdata/err
155 ok=false
156 fi
157 rm -f ./testdata/err
158 unset GOPATH
159
160 export GOPATH=$(pwd)/testdata/src
161 TEST disallowed C source files
162 export GOPATH=$(pwd)/testdata
163 if ./testgo build badc 2>testdata/err; then
164 echo 'go build badc succeeded'
165 ok=false
166 elif ! grep 'C source files not allowed' testdata/err >/dev/null; then
167 echo 'go test did not say C source files not allowed:'
154 cat testdata/err 168 cat testdata/err
155 ok=false 169 ok=false
156 fi 170 fi
157 rm -f ./testdata/err 171 rm -f ./testdata/err
158 unset GOPATH 172 unset GOPATH
159 173
160 TEST error message for syntax error in test go file says FAIL 174 TEST error message for syntax error in test go file says FAIL
161 export GOPATH=$(pwd)/testdata 175 export GOPATH=$(pwd)/testdata
162 if ./testgo test syntaxerror 2>testdata/err; then 176 if ./testgo test syntaxerror 2>testdata/err; then
163 echo 'go test syntaxerror succeeded' 177 echo 'go test syntaxerror succeeded'
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 if $started; then stop; fi 923 if $started; then stop; fi
910 rm -rf testdata/bin testdata/bin1 924 rm -rf testdata/bin testdata/bin1
911 rm -f testgo 925 rm -f testgo
912 926
913 if $allok; then 927 if $allok; then
914 echo PASS 928 echo PASS
915 else 929 else
916 echo FAIL 930 echo FAIL
917 exit 1 931 exit 1
918 fi 932 fi
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b