scoop:scoop.test:0.1.0
src/execution/data.scoop
Selected production source · src/execution/data.scoop
1
package scoop.test.execution3
/**4
* The stage of test execution in which a failure occurred.5
*/6
public enum TestPhase {7
/**8
* Creating the test instance or its actions failed.9
*/10
Initialization,11
/**12
* The setup action failed before the body could run.13
*/14
BeforeTest,15
/**16
* The test body failed.17
*/18
Body,19
/**20
* The cleanup action failed.21
*/22
AfterTest }24
/**25
* One test action paired with the source location used when an ordinary exception has no assertion26
* location.27
*/28
public struct TestAction(29
val call: () -> Unit,30
val location: SourceLocation = currentSourceLocation()31
)33
/**34
* A test body with optional setup and cleanup actions. Cleanup runs after an initialized case even35
* when setup or the body fails.36
*/37
public struct TestActions(38
val body: TestAction,39
val before: TestAction? = None,40
val after: TestAction? = None41
)43
/**44
* A captured exception with its test phase and attributed source location.45
*/46
public struct TestFailure(47
val phase: TestPhase,48
val cause: Throwable,49
val location: SourceLocation50
)52
/**53
* The completed result of executing one initialized test case.54
*/55
public enum TestResult {56
/**57
* Initialization and all configured test actions completed successfully.58
*/59
Passed,60
/**61
* The primary failure and, when present, an additional cleanup failure.62
*/63
Failed(TestFailure, TestFailure?)64
}