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 ¶
- func RegressAdd(output io.Writer, reg Regressor) error
- func RegressDelete(output io.Writer, confirmation io.Reader, key string) error
- func RegressList(output io.Writer) error
- func RegressRunTests(output io.Writer, verbose bool, failOnError bool, filterKeys []string) error
- type DigestMode
- type DigestRegression
- type PlaybackRegression
- type Regressor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegressAdd ¶
RegressAdd adds a new regression handler to the database
func RegressDelete ¶
RegressDelete removes a cartridge from the regression db
func RegressList ¶
RegressList displays all entries in the database
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 ¶
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