Skip to content

Commit

Permalink
test: expand run.go's errorcheck, make clear which bugs run
Browse files Browse the repository at this point in the history
Today, if run.go doesn't understand a test header line it just ignores
the test, making it too easy to write or edit tests that are not actually
being run.

- expand errorcheck to accept flags, so that bounds.go and escape*.go can run.
- create a whitelist of skippable tests in run.go; skipping others is an error.
- mark all skipped tests at top of file.

Update golang#4139.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6549054
  • Loading branch information
rsc committed Sep 23, 2012
1 parent 36df358 commit cd22afa
Show file tree
Hide file tree
Showing 41 changed files with 212 additions and 11 deletions.
3 changes: 3 additions & 0 deletions test/args.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $F.go && $L $F.$A && ./$A.out arg1 arg2

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
2 changes: 1 addition & 1 deletion test/bounds.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// errchk -0 $G -m -l $D/$F.go
// errorcheck -0 -m -l

// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
Expand Down
3 changes: 3 additions & 0 deletions test/bugs/bug395.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// echo bug395 is broken # takes 90+ seconds to break
// # $G $D/$F.go || echo bug395

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/bugs/bug434.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go || echo BUG:bug434

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/ddd3.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/ddd2.go && $G $D/$F.go && $L $F.$A && ./$A.out

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/dwarf/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.go $D/z*.go && $L $F.$A && ./$A.out

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
2 changes: 1 addition & 1 deletion test/escape2.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// errchk -0 $G -m -l $D/$F.go
// errorcheck -0 -m -l

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
Expand Down
2 changes: 1 addition & 1 deletion test/escape4.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// errchk -0 $G -m $D/$F.go
// errorcheck -0 -m

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug083.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.dir/bug0.go && errchk $G $D/$F.dir/bug1.go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug133.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.dir/bug0.go && $G $D/$F.dir/bug1.go && errchk $G $D/$F.dir/bug2.go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug160.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/bug160.dir/x.go && $G $D/bug160.dir/y.go && $L y.$A && ./$A.out

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug191.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/bug191.dir/a.go && $G $D/bug191.dir/b.go && $G $D/$F.go && $L $F.$A

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug248.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// $L bug2.$A &&
// ./$A.out || echo BUG: failed to compile

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug302.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/bug302.dir/p.go && pack grc pp.a p.$A && $G $D/bug302.dir/main.go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug313.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// errchk $G -e $D/$F.dir/[ab].go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug322.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.dir/lib.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out || echo BUG: fails incorrectly

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug324.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.dir/p.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug345.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.dir/io.go && errchk $G -e $D/$F.dir/main.go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug367.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.dir/p.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out || echo BUG: should not fail

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug369.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// $G -o fast.$A $D/bug369.dir/pkg.go &&
// run

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug382.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.dir/pkg.go && $G $D/$F.go || echo "Bug 382"

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug385_32.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// [ $A == 6 ] || errchk $G -e $D/$F.go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug385_64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// [ $A != 6 ] || errchk $G -e $D/$F.go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug414.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.dir/p1.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug424.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.dir/lib.go && $G $D/$F.go && $L $F.$A && ./$A.out

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug429.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.go && $L $F.$A && ! ./$A.out || echo BUG: bug429

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/fixedbugs/bug437.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go && $G $D/$F.go && $L $F.$A && ./$A.out

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/import3.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/import2.go && $G $D/$F.go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/import4.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/empty.go && errchk $G $D/$F.go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// ./$A.out -pass 2 >tmp.go && errchk $G -e tmp.go
// rm -f tmp.go $A.out1

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/interface/embed1.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/embed0.go && $G $D/$F.go && $L $F.$A && ./$A.out

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/interface/private.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/${F}1.go && errchk $G $D/$F.go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/interface/recursive2.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/recursive1.go && $G $D/$F.go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/linkx.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/$F.go && $L -X main.tbd hello $F.$A && ./$A.out

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/method4.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// $G $D/method4a.go && $G $D/$F.go && $L $F.$A && ./$A.out

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/nul1.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// errchk $G -e tmp.go
// rm -f tmp.go

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
3 changes: 3 additions & 0 deletions test/rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ./$A.out >tmp.go && $G tmp.go && $L -o $A.out1 tmp.$A && ./$A.out1
// rm -f tmp.go $A.out1

// NOTE: This test is not run by 'run.go' and so not run by all.bash.
// To run this test you must use the ./run shell script.

// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Expand Down
Loading

0 comments on commit cd22afa

Please sign in to comment.