tester

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareImage

func PrepareImage(cli *client.Client, ctx context.Context, imageName string) error

func Run added in v0.5.0

func Run(dir string, r io.Reader, w io.Writer, ew io.Writer) error

func RunTest

func RunTest(dir string, onContainer bool, timeout int, verbose bool) (bool, error)

Types

type ContainerTester

type ContainerTester struct {
	// contains filtered or unexported fields
}

func NewContainerTester

func NewContainerTester(ctx context.Context, cli *client.Client, conf *files.Conf, dir string) (*ContainerTester, error)

func (*ContainerTester) Clean

func (t *ContainerTester) Clean(ctx context.Context) error

func (*ContainerTester) Run

func (t *ContainerTester) Run(ctx context.Context, stdin io.Reader, w io.Writer, ew io.Writer) error

func (*ContainerTester) Test added in v0.5.0

func (t *ContainerTester) Test(ctx context.Context, example *atcoder.Example) (*Result, error)

type ExecResult

type ExecResult struct {
	Stdout   io.Reader
	Stderr   io.Reader
	ExitCode int
}

func Exec

func Exec(ctx context.Context, cli *client.Client, name string, cmd []string) (*ExecResult, error)

type NativeTester

type NativeTester struct {
	// contains filtered or unexported fields
}

func NewNativeTester

func NewNativeTester(dir string, conf *files.Conf) (*NativeTester, error)

func (*NativeTester) Clean

func (t *NativeTester) Clean(ctx context.Context) error

func (*NativeTester) Run

func (t *NativeTester) Run(ctx context.Context, r io.Reader, w io.Writer, ew io.Writer) error

func (*NativeTester) Test added in v0.5.0

func (t *NativeTester) Test(ctx context.Context, example *atcoder.Example) (*Result, error)

type Result

type Result struct {
	Actual   io.Reader
	Log      io.Reader
	ExitCode int
}

type Tester

type Tester interface {
	Run(ctx context.Context, r io.Reader, w io.Writer, ew io.Writer) error
	Test(ctx context.Context, example *atcoder.Example) (*Result, error)
	Clean(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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