Skip to content

cmd: relocate script test framework from cmd/go to cmd/internal #68606

Closed
@thanm

Description

@thanm

The Go command has a very nice "script" testing framework that makes it easy to write regression tests that involve smallish multifile test cases and sequences of "go" command invocations. Other tools (compiler, linker, etc) would benefit from a similar facility. The convention for the compiler has been to add new test cases in $GOROOT/test, which then run by the harness in cmd/internal/testdir, howewer the harness code there has a lot of peculiarities: except for the simplest cases (e.g. compiler crash when run on a single file) it is difficult for test writers to pick out the correct flavor of test (rundir, runindir, compiledir, etc) to get the behavior they want.

To make it easier and simpler to code up more complicated test cases, I propose to relocate the cmd/go script test framework from cmd/go to cmd/internal, then make it available in some form for testing our various tools (compile, link, nm, etc). This is a tracking issue to record the progress on this effort.

Metadata

Metadata

Assignees

Labels

FrictionNuisances that make good candidates for our "friction" fix-it weeksNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions