Documentation
¶
Overview ¶
Package build supports building and testing Encore applications with codegen and rewrite overlays.
Package build supports building and testing Encore applications with codegen and rewrite overlays.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTestFailed = errRange.New("Test Failure", "One or more more tests failed.")
)
Functions ¶
func Test ¶
func Test(ctx context.Context, cfg *TestConfig)
Types ¶
type Config ¶
type Config struct {
// Ctx controls the build.
Ctx *parsectx.Context
// Overlays describes the code generation overlays to apply,
// in the form of rewritten files or generated files.
Overlays []overlay.File
// KeepOutput keeps the temporary build directory from being deleted in the case of failure.
KeepOutput bool
// Env are additional environment variables to set.
Env []string
// MainPkg is the main package to build.
MainPkg paths.Pkg
// NoBinary specifies that no binary should be built.
// It's used if MainPkg specifies multiple packages,
// which for example is the case when checking for compilation errors
// without building a binary (such as during tests).
NoBinary bool
// StaticConfig is the static config to embed into the binary.
StaticConfig *config.Static
}
type TestConfig ¶
type TestConfig struct {
Config
// Args are additional arguments to "go test".
Args []string
// Stdout specifies the stdout to use.
Stdout io.Writer
// Stderr specifies the stderr to use.
Stderr io.Writer
// WorkingDir is the working directory to invoke
// the "go test" command from.
WorkingDir paths.FS
}
Click to show internal directories.
Click to hide internal directories.