testmain

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestMainPackage deprecated

func CreateTestMainPackage(prog *ssa.Program, pkg *ssa.Package) (*ssa.Package, error)

CreateTestMainPackage creates and returns a synthetic "testmain" package for the specified package if it defines tests, benchmarks or executable examples, or nil otherwise. The new package is named "main" and provides a function named "main" that runs the tests, similar to the one that would be created by the 'go test' tool.

Subsequent calls to prog.AllPackages include the new package. The package pkg must belong to the program prog.

Deprecated: Use golang.org/x/tools/go/packages to access synthetic testmain packages.

func FindTests deprecated

func FindTests(pkg *ssa.Package) (tests, benchmarks, examples []*ssa.Function, main *ssa.Function)

FindTests returns the Test, Benchmark, and Example functions (as defined by "go test") defined in the specified package, and its TestMain function, if any.

Deprecated: Use golang.org/x/tools/go/packages to access synthetic testmain packages.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL