lazytest

package module
v0.0.0-...-8be382c Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2016 License: MIT Imports: 13 Imported by: 1

README

Lazytest

Go Report Card Badge

A continuous test runner for Go.

Once started, it will listen for file changes in a given directory. If a file change is detected, only the tests affected by that file change will be re-run.

Usage:
  -exclude string
      exclude paths (default "/vendor/")
  -extensions string
      file extensions to watch (default "go,tpl,html")
  -root string
      watch root (default ".")

Documentation

Index

Constants

View Source
const (
	RunnerIdle int32 = iota
	RunnerBusy
)

Variables

This section is empty.

Functions

func MatchTests

func MatchTests(events chan Mod) chan Batch

* MatchTests launches a go routine to match file change events to unit tests.

func Render

func Render(report chan Report)

* Render listens on a provided channel and logs incoming messages

func Runner

func Runner(batch chan Batch) chan Report

func Watch

func Watch(root string, extensions []string, exclude []string) (chan Mod,
	error)

* Watch sets up a file watcher using the provided options. It returns a channel * of modifications.

Types

type Batch

type Batch struct {
	Package  string
	TestName string
}

* Batch is a struct holding information about a batch of unit tests.

type Mod

type Mod struct {
	Package  string
	FilePath string
	Function string
	Line     int
}

* Mod is a struct holding all the information about a file modification.

type Report

type Report []TestReport

type TestReport

type TestReport struct {
	Name    string
	Package string
	Status  TestStatus
	Message string
}

type TestStatus

type TestStatus int8
const (
	StatusPending TestStatus = iota
	StatusSkipped
	StatusFailed
	StatusPanicked
	StatusPassed
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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