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

Issue 130440043: code review 130440043: cmd/gofmt: make test files self-describing (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by gri
Modified:
11 years, 3 months ago
Reviewers:
gobot, dave, dvyukov, josharian
CC:
golang-codereviews, josharian
Visibility:
Public.

Description

cmd/gofmt: make test files self-describing 1) Interpret a comment of the form //gofmt <flags> in test files to drive the respective gofmt command. Eliminates the need to enumerate all test files in the test harness. 2) Added -update flag to make it easier to update test cases.

Patch Set 1 #

Patch Set 2 : diff -r 79cbd2059d28a32bd61779e27911746469f3776c https://code.google.com/p/go/ #

Patch Set 3 : diff -r 79cbd2059d28a32bd61779e27911746469f3776c https://code.google.com/p/go/ #

Patch Set 4 : diff -r 79cbd2059d28a32bd61779e27911746469f3776c https://code.google.com/p/go/ #

Patch Set 5 : diff -r 19c11dcab77023d11728217e8d5cb5a53c19e0b6 https://code.google.com/p/go/ #

Patch Set 6 : diff -r 19c11dcab77023d11728217e8d5cb5a53c19e0b6 https://code.google.com/p/go/ #

Patch Set 7 : diff -r 19c11dcab77023d11728217e8d5cb5a53c19e0b6 https://code.google.com/p/go/ #

Patch Set 8 : diff -r 0bb034265fafa98788400b2f64cb17154fef11eb https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+150 lines, -45 lines) Patch
M src/cmd/gofmt/gofmt_test.go View 1 2 3 4 5 6 3 chunks +80 lines, -43 lines 0 comments Download
M src/cmd/gofmt/testdata/composites.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/composites.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/crlf.golden View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/crlf.input View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/emptydecl.golden View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/emptydecl.input View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/ranges.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/ranges.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite1.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite1.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite2.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite2.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite3.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite3.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite4.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite4.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite5.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite5.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite6.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite6.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite7.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite7.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite8.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/rewrite8.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/slices1.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/slices1.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/slices2.golden View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/slices2.input View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/stdin1.golden View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/stdin1.input View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/stdin2.golden View 1 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/gofmt/testdata/stdin2.input View 1 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/gofmt/testdata/stdin3.golden View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/stdin3.input View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/stdin4.golden View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/gofmt/testdata/stdin4.input View 1 2 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 8
gri
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
11 years, 3 months ago (2014-08-21 23:45:44 UTC) #1
josharian
LGTM Oddly, clpatch fails here: $ hg clp 130440043 edit src/cmd/gofmt/testdata/crlf.input: patch did not apply ...
11 years, 3 months ago (2014-08-22 00:22:55 UTC) #2
gri
Thanks. crlf.input contains \r\n newlines (on purpose) - I suspect that might be issue. - ...
11 years, 3 months ago (2014-08-22 00:24:17 UTC) #3
gri
*** Submitted as https://code.google.com/p/go/source/detail?r=8e4e7940943a *** cmd/gofmt: make test files self-describing 1) Interpret a comment of ...
11 years, 3 months ago (2014-08-22 00:25:18 UTC) #4
gobot
This CL appears to have broken the linux-arm-panda builder. See http://build.golang.org/log/7fc711eb605af036d0760a00ed129cd6809df658
11 years, 3 months ago (2014-08-22 02:52:47 UTC) #5
dvyukov
I think this has broken nacl build: --- FAIL: TestRewrite (0.80s) gofmt_test.go:90: open gofmt.go: No ...
11 years, 3 months ago (2014-08-22 08:03:24 UTC) #6
dave_cheney.net
I'm testing a fix now. On Fri, Aug 22, 2014 at 6:03 PM, dvyukov via ...
11 years, 3 months ago (2014-08-22 08:04:44 UTC) #7
dave_cheney.net
11 years, 3 months ago (2014-08-22 08:20:57 UTC) #8
https://codereview.appspot.com/132820044/

I am having trouble getting a reliable nacl environment to test this,
but I believe this fix is correct.

On Fri, Aug 22, 2014 at 6:04 PM, Dave Cheney <dave@cheney.net> wrote:
> I'm testing a fix now.
>
> On Fri, Aug 22, 2014 at 6:03 PM, dvyukov via golang-codereviews
> <golang-codereviews@googlegroups.com> wrote:
>> I think this has broken nacl build:
>>
>> --- FAIL: TestRewrite (0.80s)
>>         gofmt_test.go:90: open gofmt.go: No such file or directory
>>         gofmt_test.go:90: open gofmt_test.go: No such file or directory
>> FAIL
>> FAIL    cmd/gofmt       1.030s
>>
>>
>>
>> https://codereview.appspot.com/130440043/
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-codereviews" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-codereviews+unsubscribe@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
Sign in to reply to this message.

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