regression

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: GPL-3.0, GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package regression facilitates the regression testing of emulation code. By adding test results to a database, the tests can be rerun automatically and checked for consistancy.

Currently, two main types of test are supported. First the digest test. This test runs a ROM for a set number of frames, saving the video or audio hash to the test database.

The second test is the Playback test. This is a slightly more complex test that replays user input from a previously recorded session. Recorded sessions take video hashes on every input trigger and so will succeed or fail if something has changed. The regression test automates the process.

The two tests are useful for different ROMs. The digest type is useful if the ROM does something immediately, say an image that is stressful on the TIA. The playback type is more useful for real world ROMs (ie. games).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegressAdd

func RegressAdd(output io.Writer, reg Regressor) error

RegressAdd adds a new regression handler to the database

func RegressDelete

func RegressDelete(output io.Writer, confirmation io.Reader, key string) error

RegressDelete removes a cartridge from the regression db

func RegressList

func RegressList(output io.Writer) error

RegressList displays all entries in the database

func RegressRunTests

func RegressRunTests(output io.Writer, verbose bool, failOnError bool, filterKeys []string) error

RegressRunTests runs all the tests in the regression database. filterKeys list specified which entries to test. an empty keys list means that every entry should be tested

Types

type DigestMode

type DigestMode int

DigestMode specifies what type of digest to generate for the regression entry

const (
	DigestUndefined DigestMode = iota
	DigestVideoOnly
	DigestAudioOnly
	DigestBoth
)

Valid digest modes. Use String() and ParseDigestMode() to convert to and from string representations.

func ParseDigestMode

func ParseDigestMode(mode string) (DigestMode, error)

ParseDigestMode converts string to DigestMode represenation

func (DigestMode) String

func (mod DigestMode) String() string

type DigestRegression

type DigestRegression struct {
	Mode      DigestMode
	CartLoad  cartridgeloader.Loader
	TVtype    string
	NumFrames int
	State     bool

	Notes string
	// contains filtered or unexported fields
}

DigestRegression is the simplest regression type. it works by running the emulation for N frames and the digest recorded at that point. Regression passes if subsequenct runs produce the same digest value

func (DigestRegression) CleanUp

func (reg DigestRegression) CleanUp() error

CleanUp implements the database.Entry interface

func (DigestRegression) ID

func (reg DigestRegression) ID() string

ID implements the database.Entry interface

func (*DigestRegression) Serialise

func (reg *DigestRegression) Serialise() (database.SerialisedEntry, error)

Serialise implements the database.Entry interface

func (DigestRegression) String

func (reg DigestRegression) String() string

String implements the database.Entry interface

type PlaybackRegression

type PlaybackRegression struct {
	Script string
	Notes  string
}

PlaybackRegression represents a regression type that processes a VCS recording. playback regressions can take a while to run because by their nature they extend over many frames - many more than is typical with the FrameRegression type.

func (PlaybackRegression) CleanUp

func (reg PlaybackRegression) CleanUp() error

CleanUp implements the database.Entry interface

func (PlaybackRegression) ID

func (reg PlaybackRegression) ID() string

ID implements the database.Entry interface

func (*PlaybackRegression) Serialise

func (reg *PlaybackRegression) Serialise() (database.SerialisedEntry, error)

Serialise implements the database.Entry interface

func (PlaybackRegression) String

func (reg PlaybackRegression) String() string

String implements the database.Entry interface

type Regressor

type Regressor interface {
	database.Entry
	// contains filtered or unexported methods
}

Regressor is the generic entry type in the regressionDB

Jump to

Keyboard shortcuts

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