Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: testing: Support external packages to call testing.MainStart #51912

emcfarlane opened this issue Mar 24, 2022 · 3 comments


Copy link

emcfarlane commented Mar 24, 2022

Systems simulating go test have two methods to invoke tests:

From the doc comments for Main, MainStart is preferred:

Systems simulating "go test" should be updated to use MainStart.

Previously, before go1.18, the internal interface testDeps could be satisfied by an external package. Upgrading to go1.18 the new internal interface contains methods with references to a private struct corpusEntry for the added fuzzing support. MainStart isn't part of the go compatibility promise. I propose providing an implementation of testDeps like

type matchStringOnly func(pat, str string) (bool, error)

that could be used by external packages to call MainStart.

@seankhliao seankhliao changed the title testing: Support external packages to call testing.MainStart proposal: testing: Support external packages to call testing.MainStart Mar 24, 2022
@gopherbot gopherbot added this to the Proposal milestone Mar 24, 2022
Copy link

seankhliao commented Mar 24, 2022

cc @bcmills

Copy link

emcfarlane commented Mar 25, 2022

My mistake, struct isn't private but an alias:

type CorpusEntry = struct {

Would be nice to have a defined public testdeps implementation but not a blocker, happy to close.

Copy link

ianlancetaylor commented Mar 30, 2022

Doesn't seem like there is anything we need to do here, so closing. Please comment if you disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

4 participants