gtest

package
v0.0.0-...-ba09d25 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package gtest contains helpers for running google-test tests from Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestCase

type TestCase struct {
	// Suite is the suite for this test.
	Suite string

	// Name is the name of this individual test.
	Name string
	// contains filtered or unexported fields
}

TestCase is a single gtest test case.

func ParseBenchmarks

func ParseBenchmarks(binary string, extraArgs ...string) ([]TestCase, error)

ParseBenchmarks returns each benchmark in a third_party/benchmark binary's list as a single test case.

func ParseTestCases

func ParseTestCases(testBin string, benchmarks bool, extraArgs ...string) ([]TestCase, error)

ParseTestCases calls a gtest test binary to list its test and returns a slice with the name and suite of each test.

If benchmarks is true, then benchmarks will be included in the list of test cases provided. Note that this requires the binary to support the benchmarks_list_tests flag.

func (TestCase) Args

func (tc TestCase) Args() []string

Args returns arguments to be passed when invoking the test.

func (TestCase) FullName

func (tc TestCase) FullName() string

FullName returns the name of the test including the suite. It is suitable to pass to "-gtest_filter".

Jump to

Keyboard shortcuts

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