Documentation ¶
Index ¶
- Constants
- func CleanupMachine(m *gno.Machine)
- func DefaultPkgName(gopkgPath string) gno.Name
- func RunFileTest(rootDir string, path string, opts ...RunFileTestOption) error
- func TestContext(pkgPath string, send std.Coins) *teststd.TestExecContext
- func TestMachine(store gno.Store, stdout io.Writer, pkgPath string) *gno.Machine
- func TestStore(rootDir, filesPath string, stdin io.Reader, stdout, stderr io.Writer, ...) (resStore gno.Store)
- type RunFileTestOption
- type TestReport
Constants ¶
const ( // use stdlibs/* only (except a few exceptions). for stdlibs/* and examples/* testing. ImportModeStdlibsOnly importMode = iota // use stdlibs/* if present, otherwise use native. used in files/tests, excluded for *_native.go ImportModeStdlibsPreferred // do not use stdlibs/* if native registered. used in files/tests, excluded for *_stdlibs.go ImportModeNativePreferred )
Import modes to control the import behaviour of TestStore.
Variables ¶
This section is empty.
Functions ¶
func CleanupMachine ¶
CleanupMachine can be called during two tests while reusing the same Machine instance.
func DefaultPkgName ¶
func RunFileTest ¶
func RunFileTest(rootDir string, path string, opts ...RunFileTestOption) error
RunFileTest executes the filetest at the given path, using rootDir as the directory where to find the "stdlibs" directory.
func TestContext ¶
func TestContext(pkgPath string, send std.Coins) *teststd.TestExecContext
TestContext returns a TestExecContext. Usable for test purpose only.
Types ¶
type RunFileTestOption ¶
type RunFileTestOption func(*runFileTestOptions)
RunFileTestOptions specify changing options in RunFileTest, deviating from the zero value.
func WithLoggerFunc ¶
func WithLoggerFunc(f func(args ...interface{})) RunFileTestOption
WithLoggerFunc sets a logging function for RunFileTest.
func WithNativeLibs ¶
func WithNativeLibs() RunFileTestOption
WithNativeLibs enables using go native libraries (ie, ImportModeNativePreferred) instead of using stdlibs/*.
func WithSyncWanted ¶
func WithSyncWanted(v bool) RunFileTestOption
WithSyncWanted sets the syncWanted flag to true. It rewrites tests files so that the values of Output: and of Realm: comments match the actual output or realm state after the test.