cmdtest

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdTimeout = time.Minute

CmdTimeout defines timeout for a command

View Source
var GrepTimeout = time.Minute

GrepTimeout defines timeout grep is waiting for substring

Functions

func Grep

func Grep(r io.Reader, substr string) (bool, *bytes.Buffer)

Grep reads from reader until finds substring with timeout return result and content that was read

func GrepAndNot

func GrepAndNot(r io.Reader, substr, noSubstr string)

GrepAndNot reads from reader until finds substring with timeout and checks noSubstr was read or fails printing read lines

func GrepTrue

func GrepTrue(r io.Reader, substr string)

GrepTrue reads from reader until finds substring with timeout or fails printing read lines

func ResetDB

func ResetDB()

ResetDB recreates database for the test

func RunCli

func RunCli(ctx context.Context, cmd string, args ...string) io.Reader

RunCli runs lookout subcommand (not a server)

func StartDummy

func StartDummy(ctx context.Context, args ...string) io.Reader

StartDummy starts dummy analyzer with context and optional arguments

func StartServe

func StartServe(ctx context.Context, args ...string) (io.Reader, io.WriteCloser)

StartServe starts lookout server with context and optional arguments

func StoppableCtx

func StoppableCtx() (context.Context, func())

StoppableCtx return ctx and stop function

Types

This section is empty.

Jump to

Keyboard shortcuts

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