gotest

package
v13.2.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package gotest contains utilities used by plz_go_test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsVersion18

func IsVersion18(goTool string) bool

IsVersion18 returns true if the given Go tool is version 1.8 or greater. This is needed because the test main signature has changed - it's not subject to the Go1 compatibility guarantee :(

func WriteTestMain

func WriteTestMain(pkgDir string, version18 bool, sources []string, output string, coverVars []CoverVar) error

WriteTestMain templates a test main file from the given sources to the given output file. This mimics what 'go test' does, although we do not currently support benchmarks or examples.

Types

type CoverVar

type CoverVar struct {
	Dir, ImportPath, ImportName, Var, File string
}

A CoverVar is just a combination of package path and variable name for one of the templated-in coverage variables.

func FindCoverVars

func FindCoverVars(dir string, exclude, srcs []string) ([]CoverVar, error)

FindCoverVars searches the given directory recursively to find all Go files with coverage variables.

Directories

Path Synopsis
test_data

Jump to

Keyboard shortcuts

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