Commit 44022f4
authored
This PR renames `ExitTestArtifacts` to `ExitTest.Result` and splits
`ExitCondition` into two types: `ExitTest.Condition` which can be passed
to `#expect(exitsWith:)` and `StatusAtExit` which represents the raw,
possibly platform-specific status reported by the kernel when a child
process terminates.
The latter type is not nested in `ExitTest` because it can be used
independently of exit tests and we may want to use it in the future for
things like multi-process parallelization, but if a platform supports
spawning processes but not exit tests, nesting it in `ExitTest` would
make it unavailable.
I considered several names for `StatusAtExit`:
- `ExitStatus`: too easily confusable with exit _codes_ such as
`EXIT_SUCCESS`;
- `ProcessStatus`: we don't say "process" in our API surface elsewhere;
- `Status`: too generic
- `ExitReason`: "status" is a more widely-used term of art for this
concept.
Foundation uses `terminationStatus` to represent the raw integer value
and `Process.TerminationReason` to represent whether it's an exit code
or signal. We don't use "termination" in Swift Testing's API anywhere.
I settled on `StatusAtExit` because it was distinct and makes it clear
that it represents the status of a process _at exit time_ (as opposed to
while running, e.g. `enum ProcessStatus { case running; case suspended;
case terminated }`.
Updates to the exit tests proposal document will follow in a separate
PR.
### Checklist:
- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
1 parent 66708a7 commit 44022f4
File tree
13 files changed
+392
-445
lines changed- Sources
- TestingMacros
- Testing
- ExitTests
- Expectations
- Tests/TestingTests
13 files changed
+392
-445
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
This file was deleted.
0 commit comments