-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathTestRunState.ts
80 lines (65 loc) · 2.41 KB
/
TestRunState.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//===----------------------------------------------------------------------===//
//
// This source file is part of the VS Code Swift open source project
//
// Copyright (c) 2024 Apple Inc. and the VS Code Swift project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of VS Code Swift project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import * as vscode from "vscode";
/**
* Interface for setting this test runs state
*/
export interface ITestRunState {
// excess data from previous parse that was not processed
excess?: string;
// the currently running suite, with the test target included, i.e: TestTarget.Suite
// note that TestTarget is only present on Darwin.
activeSuite?: string;
// output captured before a test has run in a suite
pendingSuiteOutput?: string[];
// failed test state
failedTest?: {
testIndex: number;
message: string;
file: string;
lineNumber: number;
complete: boolean;
};
// get test item index from test name on non Darwin platforms
getTestItemIndex(id: string, filename: string | undefined): number;
// set test index to be started
started(index: number, startTime?: number): void;
// set test index to have passed.
// If a start time was provided to `started` then the duration is computed as endTime - startTime,
// otherwise the time passed is assumed to be the duration.
completed(index: number, timing: { duration: number } | { timestamp: number }): void;
// record an issue against a test.
// If a `testCase` is provided a new TestItem will be created under the TestItem at the supplied index.
recordIssue(
index: number,
message: string | vscode.MarkdownString,
isKnown: boolean,
location?: vscode.Location,
diff?: TestIssueDiff
): void;
// set test index to have been skipped
skipped(index: number): void;
// started suite
startedSuite(name: string): void;
// passed suite
passedSuite(name: string): void;
// failed suite
failedSuite(name: string): void;
// record output to associate with a test
recordOutput(index: number | undefined, output: string): void;
}
export interface TestIssueDiff {
expected: string;
actual: string;
}