forked from microsoft/vstest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestOutcome.cs
107 lines (89 loc) · 3.15 KB
/
TestOutcome.cs
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel;
/// <summary>
/// Outcome of a test or a run.
/// If a new successful state needs to be added you will need to modify
/// RunResultAndStatistics in TestRun.cs and TestOutcomeHelper below.
/// ----------------------------------------------------------------
/// NOTE: the order is important and is used for computing outcome for aggregations.
/// More important outcomes come first. See TestOutcomeHelper.GetAggregationOutcome.
/// </summary>
internal enum TestOutcome
{
/// <summary>
/// There was a system error while we were trying to execute a test.
/// </summary>
Error,
/// <summary>
/// Test was executed, but there were issues.
/// Issues may involve exceptions or failed assertions.
/// </summary>
Failed,
/// <summary>
/// The test timed out
/// </summary>
Timeout,
/// <summary>
/// Test was aborted.
/// This was not caused by a user gesture, but rather by a framework decision.
/// </summary>
Aborted,
/// <summary>
/// Test has completed, but we can't say if it passed or failed.
/// May be used for aborted tests...
/// </summary>
Inconclusive,
/// <summary>
/// Test was executed w/o any issues, but run was aborted.
/// </summary>
PassedButRunAborted,
/// <summary>
/// Test had it chance for been executed but was not, as ITestElement.IsRunnable == false.
/// </summary>
NotRunnable,
/// <summary>
/// Test was not executed.
/// This was caused by a user gesture - e.g. user hit stop button.
/// </summary>
NotExecuted,
/// <summary>
/// Test run was disconnected before it finished running.
/// </summary>
Disconnected,
/// <summary>
/// To be used by Run level results.
/// This is not a failure.
/// </summary>
Warning,
/// <summary>
/// Test was executed w/o any issues.
/// </summary>
Passed,
/// <summary>
/// Test has completed, but there is no qualitative measure of completeness.
/// </summary>
Completed,
/// <summary>
/// Test is currently executing.
/// </summary>
InProgress,
/// <summary>
/// Test is in the execution queue, was not started yet.
/// </summary>
Pending,
// NOTE: OLD CODE WAS Min = Error and Max = Pending
// This doesn't work well with the coversion to string for the reason explained here:
// https://learn.microsoft.com/en-us/dotnet/api/system.enum.tostring?view=net-7.0
// Notes to Callers: If multiple enumeration members have the same underlying value and you attempt to retrieve the
// string representation of an enumeration member's name based on its underlying value
// We fixed removing the equality above to break less as possible. But the returned value won't be the expected Min/Max
/// <summary>
/// The min value of this enum
/// </summary>
Min,
/// <summary>
/// The max value of this enum
/// </summary>
Max
}