Documentation ¶
Overview ¶
Package test provide a spell incantation for the "test" command of the Go toolchain.
Index ¶
- Constants
- type Option
- func WithBlockProfile(withBlockProfile bool) Option
- func WithBlockProfileOutputFileName(blockProfileOutputFileName string) Option
- func WithCPUProfile(withCPUProfile bool) Option
- func WithCPUProfileOutputFileName(cpuProfileOutputFileName string) Option
- func WithCoverageProfile(withCoverageProfile bool) Option
- func WithCoverageProfileOutputFileName(coverageProfileOutputFileName string) Option
- func WithFlags(flags ...string) Option
- func WithGoOptions(goOpts ...spellGo.Option) Option
- func WithMemProfile(withMemProfile bool) Option
- func WithMemoryProfileOutputFileName(memoryProfileOutputFileName string) Option
- func WithMutexProfile(withMutexProfile bool) Option
- func WithMutexProfileOutputFileName(mutexProfileOutputFileName string) Option
- func WithOutputDir(outputDir string) Option
- func WithPkgs(pkgs ...string) Option
- func WithTraceProfile(withTraceProfile bool) Option
- func WithTraceProfileOutputFileName(traceProfileOutputFileName string) Option
- func WithVerboseOutput(withVerboseOutput bool) Option
- func WithoutCache(withoutCache bool) Option
- type Options
- type Spell
Constants ¶
const ( // DefaultIntegrationTestTag is the default name of tag for integration tests. DefaultIntegrationTestTag = "integration" // DefaultBlockProfileOutputFileName is the default file name for the Goroutine blocking profile file. DefaultBlockProfileOutputFileName = "block_profile.out" // DefaultCoverageOutputFileName is the default file name for the test coverage profile file. DefaultCoverageOutputFileName = "cover_profile.out" // DefaultCPUProfileOutputFileName is the default file name for the CPU profile file. DefaultCPUProfileOutputFileName = "cpu_profile.out" // DefaultMemoryProfileOutputFileName is the default file name for the memory profile file. DefaultMemoryProfileOutputFileName = "mem_profile.out" // DefaultMutexProfileOutputFileName is the default file name for the mutex profile file. DefaultMutexProfileOutputFileName = "mutex_profile.out" // DefaultOutputDirName is the default output directory name for test artifacts like profiles and reports. DefaultOutputDirName = "test" // DefaultTraceProfileOutputFileName is the default file name for the execution trace profile file. DefaultTraceProfileOutputFileName = "trace_profile.out" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Options)
Option is a spell incantation option for the Go toolchain "test" command.
func WithBlockProfile ¶
WithBlockProfile indicates whether the tests should be run with a Goroutine blocking profiling.
See `go help test` and the `go` command documentations for more details:
func WithBlockProfileOutputFileName ¶
WithBlockProfileOutputFileName sets the file name for the Goroutine blocking profile file.
See `go help test` and the `go` command documentations for more details:
func WithCPUProfile ¶
WithCPUProfile indicates whether the tests should be run with CPU profiling.
See `go help test` and the `go` command documentations for more details:
func WithCPUProfileOutputFileName ¶
WithCPUProfileOutputFileName sets the file name for the CPU profile file.
See `go help test` and the `go` command documentations for more details:
func WithCoverageProfile ¶
WithCoverageProfile indicates whether the tests should be run with coverage profiling.
See `go help test` and the `go` command documentations for more details:
func WithCoverageProfileOutputFileName ¶
WithCoverageProfileOutputFileName sets the file name for the test coverage profile file.
See `go help test` and the `go` command documentations for more details:
func WithFlags ¶
WithFlags sets additional flags that are passed to the Go "test" command along with the shared Go flags.
See `go help test` and the `go` command documentations for more details:
func WithGoOptions ¶
WithGoOptions sets shared Go toolchain command options.
func WithMemProfile ¶
WithMemProfile indicates whether the tests should be run with memory profiling.
See `go help test` and the `go` command documentations for more details:
func WithMemoryProfileOutputFileName ¶
WithMemoryProfileOutputFileName sets the file name for the memory profile file.
See `go help test` and the `go` command documentations for more details:
func WithMutexProfile ¶
WithMutexProfile indicates whether the tests should be run with mutex profiling.
See `go help test` and the `go` command documentations for more details:
func WithMutexProfileOutputFileName ¶
WithMutexProfileOutputFileName sets the file name for the mutex profile file.
See `go help test` and the `go` command documentations for more details:
func WithOutputDir ¶
WithOutputDir sets the output directory, relative to the project root, for reports like coverage or benchmark profiles.
See `go help test` and the `go` command documentations for more details:
func WithPkgs ¶
WithPkgs sets the list of packages to test.
See `go help test` and the `go` command documentations for more details:
func WithTraceProfile ¶
WithTraceProfile indicates whether the tests should be run with trace profiling.
See `go help test` and the `go` command documentations for more details:
func WithTraceProfileOutputFileName ¶
WithTraceProfileOutputFileName sets the file name for the execution trace profile file.
See `go help test` and the `go` command documentations for more details:
func WithVerboseOutput ¶
WithVerboseOutput indicates whether the test output should be verbose.
See `go help test` and the `go` command documentations for more details:
func WithoutCache ¶
WithoutCache indicates whether the tests should be run without test caching that is enabled by Go by default.
See `go help test` and the `go` command documentations for more details:
type Options ¶
type Options struct { *spellGo.Options // BlockProfileOutputFileName is the file name for the Goroutine blocking profile file. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags BlockProfileOutputFileName string // CoverageProfileOutputFileName is the file name for the test coverage profile file. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags CoverageProfileOutputFileName string // CPUProfileOutputFileName is the file name for the CPU profile file. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags CPUProfileOutputFileName string // DisableCache indicates whether the tests should be run without test caching that is enabled by Go by default. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags DisableCache bool // EnableBlockProfile indicates whether the tests should be run with a Goroutine blocking profiling. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags EnableBlockProfile bool // EnableCoverageProfile indicates whether the tests should be run with coverage profiling. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags EnableCoverageProfile bool // EnableCPUProfile indicates whether the tests should be run with CPU profiling. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags EnableCPUProfile bool // EnableMemProfile indicates whether the tests should be run with memory profiling. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags EnableMemProfile bool // EnableMutexProfile indicates whether the tests should be run with mutex profiling. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags EnableMutexProfile bool // EnableTraceProfile indicates whether the tests should be run with trace profiling. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags EnableTraceProfile bool // EnableVerboseOutput indicates whether the test output should be verbose. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags EnableVerboseOutput bool // Flags are additional flags that are passed to the Go `test` command along with the base Go flags. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags // - https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies Flags []string // MemoryProfileOutputFileName is the file name for the memory profile file. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags MemoryProfileOutputFileName string // MutexProfileOutputFileName is the file name for the mutex profile file. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags MutexProfileOutputFileName string // OutputDir is the output directory, relative to the project root, for reports like // coverage or benchmark profiles. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags OutputDir string // Pkgs is a list of packages to test. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags Pkgs []string // TraceProfileOutputFileName is the file name for the execution trace profile file. // // See `go help test` and the `go` command documentations for more details: // - https://golang.org/cmd/go/#hdr-Testing_flags TraceProfileOutputFileName string // contains filtered or unexported fields }
Options are spell incantation options for the Go toolchain "test" command.
func NewOptions ¶
NewOptions creates new spell incantation options for the Go toolchain "test" command.
type Spell ¶
type Spell struct {
// contains filtered or unexported fields
}
Spell is a spell incantation for the "test" command of the Go toolchain.
func (*Spell) Formula ¶
Formula returns the spell incantation formula. Note that configured flags are applied after the "GOFLAGS" environment variable and could overwrite already defined flags. In addition, the output directory for test artifacts like profiles and reports must exist or must be be created before, otherwise the "test" Go toolchain command will fail to run.
See `go help environment`, `go help env` and the `go` command documentations for more details: