Add Actions (#1)

This commit is contained in:
Patrick Stevens
2024-06-04 20:01:31 +01:00
committed by GitHub
parent a20ba20d2e
commit a3739f5516
6 changed files with 173 additions and 2 deletions

View File

@@ -129,6 +129,11 @@ type TestFailure =
| TestReturnedNonUnit of obj
| TestThrew of exn
override this.ToString () =
match this with
| TestFailure.TestReturnedNonUnit ret -> $"Test returned a non-unit: %O{ret}"
| TestFailure.TestThrew exc -> $"Test threw: %s{exc.Message}\n %s{exc.StackTrace}"
[<RequireQualifiedAccess>]
module TestFixture =
let private runOne (test : MethodInfo) (args : obj[]) : Result<unit, TestFailure> =
@@ -229,7 +234,7 @@ module TestFixture =
for result in results do
match result with
| Error exc ->
eprintfn $"Test failed: {exc}"
eprintfn $"Test failed: %O{exc}"
Interlocked.Increment testFailures |> ignore<int>
| Ok () -> Interlocked.Increment testSuccess |> ignore<int>