testparser

package
v0.0.0-...-8023e94 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: BSD-2-Clause Imports: 6 Imported by: 0

README

testparser

Reviewed on: 2020-04-22

Parses stdout from various test frameworks into a common structured format.

This library is useful for instance for providing structured test results on commit queue dashboards, or for performing more sophisticated data on test results such as when identifying flakes or root-causing test infrastructure failures.

Support for several common test frameworks and runtimes is provided:

  • C++ tests (via GoogleTest)
  • Rust tests (via rust-lang/libtest)
  • Go tests (via golang.org/pkg/testing)
  • Dart tests (via package:test)
  • Generic Test Runner Framework tests (agnostic of language & runtime)
  • Specialized Zircon unit testing framework
  • Specialized Vulkan CTS testing framework

This library is designed to be extensible and testable. Adding support for new test frameworks is easy, simple, and fun!

Building

fx set --with //tools/testing/testparser

Testing

fx set --with //tools/testing/testparser:tests
fx test testparser_tests

Documentation

Overview

Package testparser parses test stdout into structured results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestCase

type TestCase struct {
	Name              string
	Result            string
	DurationInSeconds int
}

type TestCaseResult

type TestCaseResult struct {
	DisplayName string         `json:"display_name"`
	SuiteName   string         `json:"suite_name"`
	CaseName    string         `json:"case_name"`
	Status      TestCaseStatus `json:"status"`
	Duration    time.Duration  `json:"duration_nanos"`
	Format      string         `json:"format"`
}

func Parse

func Parse(stdout []byte) []TestCaseResult

Parse takes stdout from a test program and returns structured results. Internally, a variety of test program stdout formats are supported. If no structured results were identified, an empty slice is returned.

type TestCaseStatus

type TestCaseStatus string
const (
	Pass TestCaseStatus = "Pass"
	Fail TestCaseStatus = "Fail"
	Skip TestCaseStatus = "Skip"
)

type TestGroup

type TestGroup struct {
	Name      string
	TestCases []TestCase
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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