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

Delta Between Two Patch Sets: src/cmd/godefs/test.sh

Issue 4528123: code review 4528123: godefs: rudimentary tests (Closed)
Left Patch Set: diff -r 8254f8746317 https://go.googlecode.com/hg/ Created 13 years, 10 months ago
Right Patch Set: diff -r a1af950dcb9c https://go.googlecode.com/hg/ Created 13 years, 9 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/godefs/Makefile ('k') | src/cmd/godefs/testdata.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
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 # Copyright 2011 The Go Authors. All rights reserved. 2 # Copyright 2011 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 eval $(gomake --no-print-directory -f ../../Make.inc go-env) 6 eval $(gomake --no-print-directory -f ../../Make.inc go-env)
7 7
8 TMP=$(mktemp -t godefs) 8 TMP="testdata_tmp.go"
9 TEST="testdata.c" 9 TEST="testdata.c"
10 GOLDEN="testdata_${GOOS}_${GOARCH}.golden" 10 GOLDEN="testdata_${GOOS}_${GOARCH}.golden"
11
12 case ${GOARCH} in
13 "amd64") CCARG="-f-m64";;
14 "386") CCARG="-f-m32";;
15 *) CCARG="";;
16 esac
11 17
12 cleanup() { 18 cleanup() {
13 rm ${TMP} 19 rm ${TMP}
14 } 20 }
15 21
16 error() { 22 error() {
17 cleanup 23 cleanup
18 echo $1 24 echo $1
19 exit 1 25 exit 1
20 } 26 }
21 27
22 if [ ! -e ${GOLDEN} ]; then 28 if [ ! -e ${GOLDEN} ]; then
23 echo "skipping - no golden defined for this platform" 29 echo "skipping - no golden defined for this platform"
24 exit 30 exit
25 fi 31 fi
26 32
27 ./godefs -g test ${TEST} > ${TMP} 33 ./godefs -g test ${CCARG} ${TEST} > ${TMP}
28 if [ $? != 0 ]; then 34 if [ $? != 0 ]; then
29 error "Error: Could not run godefs for ${TEST}" 35 error "Error: Could not run godefs for ${TEST}"
30 fi 36 fi
31 37
32 diff ${TMP} ${GOLDEN} 38 diff ${TMP} ${GOLDEN}
33 if [ $? != 0 ]; then 39 if [ $? != 0 ]; then
34 error "FAIL: godefs for ${TEST} did not match ${GOLDEN}" 40 error "FAIL: godefs for ${TEST} did not match ${GOLDEN}"
35 fi 41 fi
36 42
37 cleanup 43 cleanup
38 44
39 echo "PASS" 45 echo "PASS"
LEFTRIGHT

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