fixture

package
v0.0.0-...-d03bbad Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fixture contains all the test fixture required to run end to end tests comparing abad against google v8. It is used internally by abad's tests but it can be useful for clients to write their own end to end tests for more specific scenarios

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, samplesdir string)

Run will run tests using the provided samplesdir as a source of JavaScript samples. It will compare the results of running the code on abad with Google's V8 engine.

This function assumes that both executables are installed and working on the system.

The samplesdir will be traversed recursively and for each dir it will create a new hierarchy of subtests and the name of the dir is used as the name of the test (the filename of the sample is also used).

func RunCases

func RunCases(
	t *testing.T,
	js JsInterpreter,
	tcases []TestCase,
)

func RunWithInterpreters

func RunWithInterpreters(
	t *testing.T,
	samplesdir string,
	reference JsInterpreter,
	undertest JsInterpreter,
)

Types

type JsInterpreter

type JsInterpreter func(codepath string) (error, Result)

func NewAbad

func NewAbad(t *testing.T) JsInterpreter

func NewV8

func NewV8(t *testing.T) JsInterpreter

type Result

type Result struct {
	Stdout string
	Stderr string
}

type TestCase

type TestCase struct {
	Name string
	Code string
	Want Result
}

Jump to

Keyboard shortcuts

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