testresult

package
v0.0.0-...-928146c Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: GPL-2.0, BSD-3-Clause, ISC, + 2 more Imports: 3 Imported by: 0

Documentation

Overview

testresult is an implementation of Chromium's JSON test result format. See https://chromium.googlesource.com/chromium/src/+/master/docs/testing/json_test_results_format.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Actual       string `json:"actual"`
	Expected     string `json:"expected"`
	IsUnexpected bool   `json:"is_unexpected"`
}

type Results

type Results struct {
	Version           int               `json:"version"`
	Interrupted       bool              `json:"interrupted"`
	PathDelimiter     string            `json:"path_delimiter"`
	SecondsSinceEpoch float64           `json:"seconds_since_epoch"`
	NumFailuresByType map[string]int    `json:"num_failures_by_type"`
	Tests             map[string]Result `json:"tests"`
}

Results stores the top-level test results.

func NewResults

func NewResults() *Results

func (*Results) AddResult

func (t *Results) AddResult(name, result string)

AddResult records a test result with the given result string. The test is a failure if the result is not "PASS".

func (*Results) AddSkip

func (t *Results) AddSkip(name string)

AddSkip marks a test as being skipped. It is not considered a failure.

func (*Results) HasUnexpectedResults

func (t *Results) HasUnexpectedResults() bool

func (*Results) WriteToFile

func (t *Results) WriteToFile(name string) error

Jump to

Keyboard shortcuts

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