blob: bcb426e7f43d322203053bcaa69a9371814e1c85 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Package runtests contains specifics related to the runtests command.
package runtests
// TestResult is the exit result of a test.
type TestResult string
const (
// TestSummaryFilename is the summary file name expected by the fuchsia
// recipe module.
TestSummaryFilename = "summary.json"
// TestOutputFilename is the default output file name for a test.
TestOutputFilename = "stdout-and-stderr.txt"
// TestSuccess represents a passed test.
TestSuccess TestResult = "PASS"
// TestFailure represents a failed test.
TestFailure TestResult = "FAIL"
// TestSummary is a summary of a suite of test runs. It represents the output
// file format of a runtests invocation.
type TestSummary struct {
// Tests is a list of the details of the test runs.
Tests []TestDetails `json:"tests"`
// Outputs gives the suite-wide outputs, mapping canonical name of the
// output to its path.
Outputs map[string]string `json:"outputs,omitempty"`
// DataSink is a data sink exported by the test.
type DataSink struct {
// Name is the name of the sink.
Name string `json:"name"`
// File is the file containing the sink data.
File string `json:"file"`
// TestDetails contains the details of a test run.
type TestDetails struct {
// Name is the name of the test.
Name string `json:"name"`
// OutputFile is a file containing the test's output (stdout/stderr).
OutputFile string `json:"output_file"`
// Result is the result of the test.
Result TestResult `json:"result"`
// DataSinks gives the data sinks attached to a test.
DataSinks map[string][]DataSink `json:"data_sinks,omitempty"`
// Duration is how long the test execution took.
DurationMillis int64 `json:"duration_milliseconds"`