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

Issue 6554071: code review 6554071: test: Add rundir and errorcheckdir commands to testlib ... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by DMorsing
Modified:
11 years, 6 months ago
Reviewers:
CC:
rsc, minux1, remyoudompheng, iant, golang-dev
Visibility:
Public.

Description

test: Add rundir, rundircmpout and errorcheckdir commands to testlib and run.go rundir will compile each file in the directory in lexicographic order, link the last file as the main package and run the resulting program. rundircmpout is an related command, that will compare the output of the program to an corresponding .out file errorcheckdir will compile each file in a directory in lexicographic order, running errorcheck on each file as it compiles. All compilations are assumed to be successful except for the last file. However, If a -0 flag is present on the command, the last compilation will also be assumed successful This CL also includes a small refactoring of run.go. It was getting unwieldy and the meaning of the run commands was hidden behind argument line formatting. Fixes issue 4058.

Patch Set 1 #

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

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

Total comments: 1

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

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

Total comments: 8

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

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

Total comments: 14

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

Patch Set 9 : diff -r bb339c8ae168 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -27 lines) Patch
M test/run.go View 1 2 3 4 5 6 7 11 chunks +116 lines, -27 lines 0 comments Download
M test/testlib View 1 2 3 4 5 6 7 1 chunk +40 lines, -0 lines 0 comments Download

Messages

Total messages: 20
DMorsing
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com, rsc@golang.org), I'd like you to review this change to https://code.google.com/p/go/
11 years, 7 months ago (2012-09-22 21:58:27 UTC) #1
rsc
Thanks for working on this. http://codereview.appspot.com/6554071/diff/1002/test/run.go File test/run.go (right): http://codereview.appspot.com/6554071/diff/1002/test/run.go#newcode339 test/run.go:339: // "go build" a ...
11 years, 7 months ago (2012-09-23 00:01:05 UTC) #2
minux1
On Sunday, September 23, 2012, wrote: > > Index: test/testlib > ==============================**==============================**======= > --- a/test/testlib ...
11 years, 7 months ago (2012-09-23 03:52:18 UTC) #3
DMorsing
PTAL Went with errorcheck on every file in errorcheckdir and last file as main package ...
11 years, 7 months ago (2012-09-23 08:33:05 UTC) #4
remyoudompheng
This will allow to enable a bunch of whitelisted tests, but the code duplication is ...
11 years, 7 months ago (2012-09-23 17:19:14 UTC) #5
rsc
I agree that there are likely some good refactoring possibilities here. Don't be shy. Regarding ...
11 years, 7 months ago (2012-09-23 18:03:05 UTC) #6
DMorsing
On Sun, Sep 23, 2012 at 8:03 PM, <rsc@golang.org> wrote: > I agree that there ...
11 years, 6 months ago (2012-09-24 11:34:38 UTC) #7
remyoudompheng
if the test system is so simple that maintenance of both is free, I don't ...
11 years, 6 months ago (2012-09-24 11:38:12 UTC) #8
rsc
> I can see what you mean with regards to testlib. The same issues that ...
11 years, 6 months ago (2012-09-24 11:46:30 UTC) #9
minux1
On Mon, Sep 24, 2012 at 7:34 PM, Daniel Morsing <daniel.morsing@gmail.com>wrote: > I can see ...
11 years, 6 months ago (2012-09-24 11:47:45 UTC) #10
DMorsing
PTAL I have added a short description of the commands in the CL description. In ...
11 years, 6 months ago (2012-09-24 19:35:59 UTC) #11
DMorsing
ping.
11 years, 6 months ago (2012-09-26 19:31:17 UTC) #12
DMorsing
pinging again.
11 years, 6 months ago (2012-10-01 17:59:12 UTC) #13
iant
https://codereview.appspot.com/6554071/diff/10001/test/run.go File test/run.go (right): https://codereview.appspot.com/6554071/diff/10001/test/run.go#newcode168 test/run.go:168: type runCmd func(args ...string) ([]byte, error) I don't quite ...
11 years, 6 months ago (2012-10-01 18:32:49 UTC) #14
rsc
https://codereview.appspot.com/6554071/diff/10001/test/run.go File test/run.go (right): https://codereview.appspot.com/6554071/diff/10001/test/run.go#newcode168 test/run.go:168: type runCmd func(args ...string) ([]byte, error) On 2012/10/01 18:32:49, ...
11 years, 6 months ago (2012-10-01 20:17:35 UTC) #15
DMorsing
PTAL On top of the issues addressed below, I re-added some code that got thrown ...
11 years, 6 months ago (2012-10-01 21:03:05 UTC) #16
iant
https://codereview.appspot.com/6554071/diff/19001/test/run.go File test/run.go (right): https://codereview.appspot.com/6554071/diff/19001/test/run.go#newcode171 test/run.go:171: out, err = runcmd("go", "tool", gc, "-e", longname) Just ...
11 years, 6 months ago (2012-10-01 22:05:04 UTC) #17
DMorsing
PTAL I have updated the CL description to match the new semantics of the commands. ...
11 years, 6 months ago (2012-10-02 17:11:24 UTC) #18
rsc
LGTM
11 years, 6 months ago (2012-10-05 20:37:45 UTC) #19
DMorsing
11 years, 6 months ago (2012-10-06 07:23:36 UTC) #20
*** Submitted as http://code.google.com/p/go/source/detail?r=2aef5548a9cf ***

test: Add rundir, rundircmpout and errorcheckdir commands to testlib and run.go

rundir will compile each file in the directory in lexicographic order, link the
last file as the main package and run the resulting program. rundircmpout is an
related command, that will compare the output of the program to an corresponding
.out file

errorcheckdir will compile each file in a directory in lexicographic order,
running errorcheck on each file as it compiles. All compilations are assumed to
be successful except for the last file. However, If a -0 flag is present on the
command, the last compilation will also be assumed successful

This CL also includes a small refactoring of run.go. It was getting unwieldy and
the meaning of the run commands was hidden behind argument line formatting.

Fixes issue 4058.

R=rsc, minux.ma, remyoudompheng, iant
CC=golang-dev
http://codereview.appspot.com/6554071
Sign in to reply to this message.

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