mirror of
https://github.com/Smaug123/unofficial-nunit-runner
synced 2025-10-05 17:38:40 +00:00
Compare commits
4 Commits
WoofWare.N
...
WoofWare.N
Author | SHA1 | Date | |
---|---|---|---|
|
46e097a02e | ||
|
7c23c3bb1c | ||
|
ace1417de6 | ||
|
a694637958 |
@@ -3,7 +3,7 @@
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"fantomas": {
|
||||
"version": "6.3.15",
|
||||
"version": "6.3.16",
|
||||
"commands": [
|
||||
"fantomas"
|
||||
]
|
||||
|
1
.fantomasignore
Normal file
1
.fantomasignore
Normal file
@@ -0,0 +1 @@
|
||||
.direnv/
|
25
.github/workflows/dotnet.yaml
vendored
25
.github/workflows/dotnet.yaml
vendored
@@ -38,7 +38,30 @@ jobs:
|
||||
- name: Build
|
||||
run: 'nix develop --command dotnet build --no-restore --configuration ${{matrix.config}}'
|
||||
- name: Test
|
||||
run: 'nix develop --command dotnet test --no-build --verbosity normal --configuration ${{matrix.config}} --framework net8.0'
|
||||
run: |
|
||||
nix develop --command dotnet test --no-build --verbosity normal --configuration ${{matrix.config}} --framework net8.0 --filter 'FullyQualifiedName !~ FailingConsumer'
|
||||
|
||||
selftest-intended-failures:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # so that NerdBank.GitVersioning has access to history
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v30
|
||||
with:
|
||||
extra_nix_config: |
|
||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Restore dependencies
|
||||
run: nix develop --command dotnet restore
|
||||
- name: Build
|
||||
run: 'nix develop --command dotnet build --no-restore --configuration Release'
|
||||
- name: Test using self
|
||||
run: 'nix develop --command dotnet exec ./WoofWare.NUnitTestRunner/bin/Release/net6.0/WoofWare.NUnitTestRunner.dll ./FailingConsumer/bin/Release/net8.0/FailingConsumer.dll --trx TrxOut/out.trx || true'
|
||||
- name: Munge output
|
||||
run: 'nix develop --command xmlstarlet sel -N x="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" -t -m "//x:UnitTestResult" -v "@testName" -o ": " -v ".//x:ErrorInfo/x:Message" -n TrxOut/out.trx > snapshot.txt'
|
||||
- name: Check output matches expected
|
||||
run: 'actual=$(cat snapshot.txt | sort) expected=$(cat FailingConsumer/expected.txt | sort) [ "$expected" == "$actual" ]'
|
||||
|
||||
selftest:
|
||||
runs-on: ubuntu-latest
|
||||
|
@@ -12,6 +12,7 @@
|
||||
<Compile Include="RunSubProcess.fs" />
|
||||
<Compile Include="TestNonParallel.fs" />
|
||||
<Compile Include="TestParallel.fs" />
|
||||
<Compile Include="TestParallelIndividualTest.fs" />
|
||||
<Compile Include="TestStdout.fs" />
|
||||
<Compile Include="TestParameterisedFixture.fs" />
|
||||
<Compile Include="TestSetUp.fs" />
|
||||
|
59
Consumer/TestParallelIndividualTest.fs
Normal file
59
Consumer/TestParallelIndividualTest.fs
Normal file
@@ -0,0 +1,59 @@
|
||||
namespace Consumer
|
||||
|
||||
open System
|
||||
open System.Collections.Concurrent
|
||||
open System.Threading
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
|
||||
// These tests are flaky if the bug https://github.com/Smaug123/unofficial-nunit-runner/issues/168 is unfixed.
|
||||
[<TestFixture>]
|
||||
module TestParallelIndividualTest =
|
||||
|
||||
type private Transitions =
|
||||
| Started of int
|
||||
| LockAcquired of int
|
||||
| Exited of int
|
||||
|
||||
let locker = obj ()
|
||||
let private sequence = ConcurrentQueue<Transitions> ()
|
||||
|
||||
[<Test>]
|
||||
[<Parallelizable(ParallelScope.None)>]
|
||||
let ``does not run in parallel`` () =
|
||||
sequence.Enqueue (Transitions.Started 0)
|
||||
let entered = Monitor.TryEnter (locker, TimeSpan.Zero)
|
||||
|
||||
if entered then
|
||||
sequence.Enqueue (Transitions.LockAcquired 0)
|
||||
Monitor.Exit locker
|
||||
sequence.Enqueue (Transitions.Exited 0)
|
||||
else
|
||||
sequence.Enqueue (Transitions.Exited 0)
|
||||
failwith "failed to acquire the lock"
|
||||
|
||||
[<Test>]
|
||||
let ``unrestricted parallelism`` () =
|
||||
sequence.Enqueue (Transitions.Started 1)
|
||||
let entered = Monitor.TryEnter (locker, TimeSpan.Zero)
|
||||
|
||||
if entered then
|
||||
sequence.Enqueue (Transitions.LockAcquired 1)
|
||||
Monitor.Exit locker
|
||||
sequence.Enqueue (Transitions.Exited 1)
|
||||
else
|
||||
sequence.Enqueue (Transitions.Exited 1)
|
||||
failwith "failed to acquire the lock"
|
||||
|
||||
[<OneTimeTearDown>]
|
||||
let ``It worked`` () =
|
||||
let sequence = sequence |> Seq.toList
|
||||
|
||||
let allowed n =
|
||||
[ Transitions.Started n ; Transitions.LockAcquired n ; Transitions.Exited n ]
|
||||
|
||||
if sequence <> allowed 0 @ allowed 1 && sequence <> allowed 1 @ allowed 0 then
|
||||
let s = sequence |> Seq.map string<Transitions> |> String.concat "\n"
|
||||
failwith $"Unexpected sequence!\n%s{s}"
|
||||
|
||||
()
|
20
FailingConsumer/FailingConsumer.fsproj
Normal file
20
FailingConsumer/FailingConsumer.fsproj
Normal file
@@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="TestInsufficientArgs.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FsUnit" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
|
||||
<PackageReference Include="NUnit" Version="4.2.2"/>
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
9
FailingConsumer/TestInsufficientArgs.fs
Normal file
9
FailingConsumer/TestInsufficientArgs.fs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace FailingConsumer
|
||||
|
||||
open NUnit.Framework
|
||||
|
||||
[<TestFixture>]
|
||||
module TestInsufficientArgs =
|
||||
|
||||
[<Test>]
|
||||
let foo (_ : int) = ()
|
1
FailingConsumer/expected.txt
Normal file
1
FailingConsumer/expected.txt
Normal file
@@ -0,0 +1 @@
|
||||
foo: had parameter count mismatch: expected 1, actual 0
|
@@ -41,12 +41,16 @@ module AssemblyLevelAttributes =
|
||||
| [ v ] ->
|
||||
match v.Value with
|
||||
| :? int as v ->
|
||||
match v with
|
||||
| 512 -> levelPar, Some (Parallelizable.Yes AssemblyParallelScope.Fixtures)
|
||||
| 256 -> levelPar, Some (Parallelizable.Yes AssemblyParallelScope.Children)
|
||||
| 257 -> failwith "ParallelScope.All is invalid on assemblies; only Fixtures or Children"
|
||||
| 1 -> failwith "ParallelScope.Self is invalid on assemblies; only Fixtures or Children"
|
||||
| v -> failwith $"Could not recognise value %i{v} of parallel scope on assembly"
|
||||
match ParallelScope.ofInt v with
|
||||
| ParallelScope.Fixtures ->
|
||||
levelPar, Some (Parallelizable.Yes AssemblyParallelScope.Fixtures)
|
||||
| ParallelScope.Children ->
|
||||
levelPar, Some (Parallelizable.Yes AssemblyParallelScope.Children)
|
||||
| ParallelScope.None -> levelPar, Some Parallelizable.No
|
||||
| ParallelScope.All ->
|
||||
failwith "ParallelScope.All is invalid on assemblies; only Fixtures or Children"
|
||||
| ParallelScope.Self ->
|
||||
failwith "ParallelScope.Self is invalid on assemblies; only Fixtures or Children"
|
||||
| v -> failwith $"Unexpectedly non-int value %O{v} of parallel scope on assembly"
|
||||
| _ -> failwith "unexpectedly got multiple args to Parallelizable on assembly"
|
||||
| _ -> levelPar, par
|
||||
|
@@ -164,6 +164,18 @@ module BuildTrxReport =
|
||||
| Some s -> s
|
||||
|
||||
(Some stackTrace, message)
|
||||
| TestFailure.TestFailed (UserMethodFailure.BadParameters (_, expected, actual))
|
||||
| TestFailure.SetUpFailed (UserMethodFailure.BadParameters (_, expected, actual))
|
||||
| TestFailure.TearDownFailed (UserMethodFailure.BadParameters (_, expected, actual)) ->
|
||||
let newMessage =
|
||||
$"had parameter count mismatch: expected %i{expected.Length}, actual %i{actual.Length}"
|
||||
|
||||
let message =
|
||||
match message with
|
||||
| None -> newMessage
|
||||
| Some message -> $"%s{message}\n%s{newMessage}"
|
||||
|
||||
(stackTrace, Some message)
|
||||
| TestFailure.TestFailed (UserMethodFailure.ReturnedNonUnit (_, ret))
|
||||
| TestFailure.SetUpFailed (UserMethodFailure.ReturnedNonUnit (_, ret))
|
||||
| TestFailure.TearDownFailed (UserMethodFailure.ReturnedNonUnit (_, ret)) ->
|
||||
@@ -188,6 +200,14 @@ module BuildTrxReport =
|
||||
Message = None
|
||||
}
|
||||
|> Some
|
||||
| Choice3Of3 (UserMethodFailure.BadParameters (_, expected, actual)) ->
|
||||
{
|
||||
StackTrace = None
|
||||
Message =
|
||||
$"parameter count mismatch, expected %i{expected.Length}, actual %i{actual.Length}"
|
||||
|> Some
|
||||
}
|
||||
|> Some
|
||||
| Choice3Of3 (UserMethodFailure.ReturnedNonUnit (_, ret)) ->
|
||||
{
|
||||
Message = $"returned non-unit value %O{ret}" |> Some
|
||||
|
@@ -61,6 +61,24 @@ type Parallelizable<'scope> =
|
||||
/// This test must always be run on its own.
|
||||
| No
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Parallelizable =
|
||||
/// Functorial map.
|
||||
let inline map<'a, 'b> ([<InlineIfLambda>] f : 'a -> 'b) (p : Parallelizable<'a>) : Parallelizable<'b> =
|
||||
match p with
|
||||
| Parallelizable.No -> Parallelizable.No
|
||||
| Parallelizable.Yes a -> Parallelizable.Yes (f a)
|
||||
|
||||
/// Functorial bind.
|
||||
let inline bind<'a, 'b>
|
||||
([<InlineIfLambda>] f : 'a -> Parallelizable<'b>)
|
||||
(p : Parallelizable<'a>)
|
||||
: Parallelizable<'b>
|
||||
=
|
||||
match p with
|
||||
| Parallelizable.No -> Parallelizable.No
|
||||
| Parallelizable.Yes a -> f a
|
||||
|
||||
/// A single method or member which holds some tests. (Often such a member will represent only one test, but e.g.
|
||||
/// if it has [<TestCaseSource>] then it represents multiple tests.)
|
||||
type SingleTestMethod =
|
||||
@@ -144,6 +162,8 @@ type UserMethodFailure =
|
||||
| ReturnedNonUnit of name : string * result : obj
|
||||
/// A method threw.
|
||||
| Threw of name : string * exn
|
||||
/// Parameter count mismatch.
|
||||
| BadParameters of name : string * expected : Type[] * actual : obj[]
|
||||
|
||||
/// Human-readable representation of the user failure.
|
||||
override this.ToString () =
|
||||
@@ -152,12 +172,22 @@ type UserMethodFailure =
|
||||
$"User-defined method '%s{method}' returned a non-unit: %O{ret}"
|
||||
| UserMethodFailure.Threw (method, exc) ->
|
||||
$"User-defined method '%s{method}' threw: %s{exc.Message}\n %s{exc.StackTrace}"
|
||||
| UserMethodFailure.BadParameters (method, expected, actual) ->
|
||||
let expectedStr = expected |> Seq.map (fun t -> t.Name) |> String.concat ", "
|
||||
|
||||
let actualStr =
|
||||
actual
|
||||
|> Seq.map (fun s -> if isNull s then "null" else s.ToString ())
|
||||
|> String.concat ", "
|
||||
|
||||
$"User-defined method '%s{method}' had parameter count mismatch. Expected: (%s{expectedStr}) (%i{expected.Length} params). Actual: (%s{actualStr}) (%i{actual.Length} params)"
|
||||
|
||||
/// Name (not fully-qualified) of the method which failed.
|
||||
member this.Name =
|
||||
match this with
|
||||
| UserMethodFailure.Threw (name, _)
|
||||
| UserMethodFailure.ReturnedNonUnit (name, _) -> name
|
||||
| UserMethodFailure.BadParameters (name, _, _) -> name
|
||||
|
||||
/// Represents the failure of a single run of one test. An error signalled this way is a user error: the unit under
|
||||
/// test has misbehaved.
|
||||
|
@@ -314,7 +314,7 @@ type ParallelQueue
|
||||
let t () =
|
||||
{ new ThunkEvaluator<_> with
|
||||
member _.Eval<'b> (t : unit -> 'b) rc =
|
||||
let tcs = TaskCompletionSource ()
|
||||
let tcs = TaskCompletionSource TaskCreationOptions.RunContinuationsAsynchronously
|
||||
use ec = ExecutionContext.Capture ()
|
||||
|
||||
fun () ->
|
||||
|
29
WoofWare.NUnitTestRunner.Lib/ParallelScope.fs
Normal file
29
WoofWare.NUnitTestRunner.Lib/ParallelScope.fs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace WoofWare.NUnitTestRunner
|
||||
|
||||
/// Our own strongly-typed rendering of the NUnit ParallelScope enum.
|
||||
/// This is more tightly modelled by ClassParallelScope and AssemblyParallelScope in our own domain; this type exists
|
||||
/// for the initial interop.
|
||||
[<RequireQualifiedAccess>]
|
||||
type ParallelScope =
|
||||
/// Corresponds to NUnit's ParallelScope.Fixtures.
|
||||
| Fixtures
|
||||
/// Corresponds to NUnit's ParallelScope.Children.
|
||||
| Children
|
||||
/// Corresponds to NUnit's ParallelScope.All.
|
||||
| All
|
||||
/// Corresponds to NUnit's ParallelScope.Self.
|
||||
| Self
|
||||
/// Corresponds to NUnit's ParallelScope.None.
|
||||
| None
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module ParallelScope =
|
||||
/// Convert the weakly-typed C# enum that is NUnit's `ParallelScope` to a strongly-typed representation.
|
||||
let ofInt (n : int) =
|
||||
match n with
|
||||
| 512 -> ParallelScope.Fixtures
|
||||
| 256 -> ParallelScope.Children
|
||||
| 257 -> ParallelScope.All
|
||||
| 1 -> ParallelScope.Self
|
||||
| 2 -> ParallelScope.None
|
||||
| _ -> failwith $"Unrecognised ParallelScope enum: %i{n}"
|
@@ -94,7 +94,27 @@ module SingleTestMethod =
|
||||
match par with
|
||||
| Some _ -> failwith $"Got multiple parallelization attributes on %s{method.Name}"
|
||||
| None ->
|
||||
(remaining, isTest, sources, hasData, mods, cats, repeat, comb, Some (Parallelizable.Yes ()))
|
||||
let arg =
|
||||
match Seq.toList attr.ConstructorArguments with
|
||||
| [] -> Parallelizable.Yes ()
|
||||
| [ x ] ->
|
||||
if x.ArgumentType.Name <> "ParallelScope" then
|
||||
failwith
|
||||
$"Got argument %O{x.Value} of unrecognised type %s{x.ArgumentType.Name} on [<Parallelizable>] attribute; expected ParallelScope"
|
||||
|
||||
match ParallelScope.ofInt (unbox<int> x.Value) with
|
||||
| ParallelScope.Children ->
|
||||
failwith
|
||||
$"Unexpected ParallelScope.Children on test %s{method.Name}; this is not valid on individual tests"
|
||||
| ParallelScope.Fixtures ->
|
||||
failwith
|
||||
$"Unexpected ParallelScope.Children on test %s{method.Name}; this is not valid on individual tests"
|
||||
| ParallelScope.All
|
||||
| ParallelScope.Self -> Parallelizable.Yes ()
|
||||
| ParallelScope.None -> Parallelizable.No
|
||||
| s -> failwith $"Got multiple arguments on a [<Parallelizable>] attribute: %O{s}"
|
||||
|
||||
(remaining, isTest, sources, hasData, mods, cats, repeat, comb, Some arg)
|
||||
| s when s.StartsWith ("NUnit.Framework", StringComparison.Ordinal) ->
|
||||
failwith $"Unrecognised attribute on function %s{method.Name}: %s{attr.AttributeType.FullName}"
|
||||
| _ -> (attr :: remaining, isTest, sources, hasData, mods, cats, repeat, comb, par)
|
||||
|
@@ -231,6 +231,9 @@ WoofWare.NUnitTestRunner.Modifier.IsIgnored [property]: [read-only] bool
|
||||
WoofWare.NUnitTestRunner.Modifier.NewExplicit [static method]: string option -> WoofWare.NUnitTestRunner.Modifier
|
||||
WoofWare.NUnitTestRunner.Modifier.NewIgnored [static method]: string option -> WoofWare.NUnitTestRunner.Modifier
|
||||
WoofWare.NUnitTestRunner.Modifier.Tag [property]: [read-only] int
|
||||
WoofWare.NUnitTestRunner.Parallelizable inherit obj
|
||||
WoofWare.NUnitTestRunner.Parallelizable.bind [static method]: ('a -> 'b WoofWare.NUnitTestRunner.Parallelizable) -> 'a WoofWare.NUnitTestRunner.Parallelizable -> 'b WoofWare.NUnitTestRunner.Parallelizable
|
||||
WoofWare.NUnitTestRunner.Parallelizable.map [static method]: ('a -> 'b) -> 'a WoofWare.NUnitTestRunner.Parallelizable -> 'b WoofWare.NUnitTestRunner.Parallelizable
|
||||
WoofWare.NUnitTestRunner.Parallelizable`1 inherit obj, implements 'scope WoofWare.NUnitTestRunner.Parallelizable System.IEquatable, System.Collections.IStructuralEquatable, 'scope WoofWare.NUnitTestRunner.Parallelizable System.IComparable, System.IComparable, System.Collections.IStructuralComparable - union type with 2 cases
|
||||
WoofWare.NUnitTestRunner.Parallelizable`1+Tags inherit obj
|
||||
WoofWare.NUnitTestRunner.Parallelizable`1+Tags.No [static field]: int = 1
|
||||
@@ -255,6 +258,38 @@ WoofWare.NUnitTestRunner.ParallelQueue.Run [method]: WoofWare.NUnitTestRunner.Te
|
||||
WoofWare.NUnitTestRunner.ParallelQueue.RunTestSetup [method]: WoofWare.NUnitTestRunner.TestFixtureRunningToken -> (unit -> 'a) -> ('a * WoofWare.NUnitTestRunner.TestFixtureSetupToken) System.Threading.Tasks.Task
|
||||
WoofWare.NUnitTestRunner.ParallelQueue.RunTestTearDown [method]: WoofWare.NUnitTestRunner.TestFixtureSetupToken -> (unit -> 'a) -> ('a * WoofWare.NUnitTestRunner.TestFixtureTearDownToken) System.Threading.Tasks.Task
|
||||
WoofWare.NUnitTestRunner.ParallelQueue.StartTestFixture [method]: WoofWare.NUnitTestRunner.TestFixture -> WoofWare.NUnitTestRunner.TestFixtureRunningToken System.Threading.Tasks.Task
|
||||
WoofWare.NUnitTestRunner.ParallelScope inherit obj, implements WoofWare.NUnitTestRunner.ParallelScope System.IEquatable, System.Collections.IStructuralEquatable, WoofWare.NUnitTestRunner.ParallelScope System.IComparable, System.IComparable, System.Collections.IStructuralComparable - union type with 5 cases
|
||||
WoofWare.NUnitTestRunner.ParallelScope+Tags inherit obj
|
||||
WoofWare.NUnitTestRunner.ParallelScope+Tags.All [static field]: int = 2
|
||||
WoofWare.NUnitTestRunner.ParallelScope+Tags.Children [static field]: int = 1
|
||||
WoofWare.NUnitTestRunner.ParallelScope+Tags.Fixtures [static field]: int = 0
|
||||
WoofWare.NUnitTestRunner.ParallelScope+Tags.None [static field]: int = 4
|
||||
WoofWare.NUnitTestRunner.ParallelScope+Tags.Self [static field]: int = 3
|
||||
WoofWare.NUnitTestRunner.ParallelScope.All [static property]: [read-only] WoofWare.NUnitTestRunner.ParallelScope
|
||||
WoofWare.NUnitTestRunner.ParallelScope.Children [static property]: [read-only] WoofWare.NUnitTestRunner.ParallelScope
|
||||
WoofWare.NUnitTestRunner.ParallelScope.Equals [method]: (WoofWare.NUnitTestRunner.ParallelScope, System.Collections.IEqualityComparer) -> bool
|
||||
WoofWare.NUnitTestRunner.ParallelScope.Fixtures [static property]: [read-only] WoofWare.NUnitTestRunner.ParallelScope
|
||||
WoofWare.NUnitTestRunner.ParallelScope.get_All [static method]: unit -> WoofWare.NUnitTestRunner.ParallelScope
|
||||
WoofWare.NUnitTestRunner.ParallelScope.get_Children [static method]: unit -> WoofWare.NUnitTestRunner.ParallelScope
|
||||
WoofWare.NUnitTestRunner.ParallelScope.get_Fixtures [static method]: unit -> WoofWare.NUnitTestRunner.ParallelScope
|
||||
WoofWare.NUnitTestRunner.ParallelScope.get_IsAll [method]: unit -> bool
|
||||
WoofWare.NUnitTestRunner.ParallelScope.get_IsChildren [method]: unit -> bool
|
||||
WoofWare.NUnitTestRunner.ParallelScope.get_IsFixtures [method]: unit -> bool
|
||||
WoofWare.NUnitTestRunner.ParallelScope.get_IsNone [method]: unit -> bool
|
||||
WoofWare.NUnitTestRunner.ParallelScope.get_IsSelf [method]: unit -> bool
|
||||
WoofWare.NUnitTestRunner.ParallelScope.get_None [static method]: unit -> WoofWare.NUnitTestRunner.ParallelScope
|
||||
WoofWare.NUnitTestRunner.ParallelScope.get_Self [static method]: unit -> WoofWare.NUnitTestRunner.ParallelScope
|
||||
WoofWare.NUnitTestRunner.ParallelScope.get_Tag [method]: unit -> int
|
||||
WoofWare.NUnitTestRunner.ParallelScope.IsAll [property]: [read-only] bool
|
||||
WoofWare.NUnitTestRunner.ParallelScope.IsChildren [property]: [read-only] bool
|
||||
WoofWare.NUnitTestRunner.ParallelScope.IsFixtures [property]: [read-only] bool
|
||||
WoofWare.NUnitTestRunner.ParallelScope.IsNone [property]: [read-only] bool
|
||||
WoofWare.NUnitTestRunner.ParallelScope.IsSelf [property]: [read-only] bool
|
||||
WoofWare.NUnitTestRunner.ParallelScope.None [static property]: [read-only] WoofWare.NUnitTestRunner.ParallelScope
|
||||
WoofWare.NUnitTestRunner.ParallelScope.Self [static property]: [read-only] WoofWare.NUnitTestRunner.ParallelScope
|
||||
WoofWare.NUnitTestRunner.ParallelScope.Tag [property]: [read-only] int
|
||||
WoofWare.NUnitTestRunner.ParallelScopeModule inherit obj
|
||||
WoofWare.NUnitTestRunner.ParallelScopeModule.ofInt [static method]: int -> WoofWare.NUnitTestRunner.ParallelScope
|
||||
WoofWare.NUnitTestRunner.SingleTestMethod inherit obj, implements WoofWare.NUnitTestRunner.SingleTestMethod System.IEquatable, System.Collections.IStructuralEquatable
|
||||
WoofWare.NUnitTestRunner.SingleTestMethod..ctor [constructor]: (System.Reflection.MethodInfo, WoofWare.NUnitTestRunner.TestKind, WoofWare.NUnitTestRunner.Modifier list, string list, int option, WoofWare.NUnitTestRunner.Combinatorial option, unit WoofWare.NUnitTestRunner.Parallelizable option)
|
||||
WoofWare.NUnitTestRunner.SingleTestMethod.Categories [property]: [read-only] string list
|
||||
@@ -668,13 +703,21 @@ WoofWare.NUnitTestRunner.TrxUnitTestResult.TestId [property]: [read-only] System
|
||||
WoofWare.NUnitTestRunner.TrxUnitTestResult.TestListId [property]: [read-only] System.Guid
|
||||
WoofWare.NUnitTestRunner.TrxUnitTestResult.TestName [property]: [read-only] string
|
||||
WoofWare.NUnitTestRunner.TrxUnitTestResult.TestType [property]: [read-only] System.Guid
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure inherit obj, implements WoofWare.NUnitTestRunner.UserMethodFailure System.IEquatable, System.Collections.IStructuralEquatable - union type with 2 cases
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure inherit obj, implements WoofWare.NUnitTestRunner.UserMethodFailure System.IEquatable, System.Collections.IStructuralEquatable - union type with 3 cases
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+BadParameters inherit WoofWare.NUnitTestRunner.UserMethodFailure
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+BadParameters.actual [property]: [read-only] obj []
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+BadParameters.expected [property]: [read-only] System.Type []
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+BadParameters.get_actual [method]: unit -> obj []
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+BadParameters.get_expected [method]: unit -> System.Type []
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+BadParameters.get_name [method]: unit -> string
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+BadParameters.name [property]: [read-only] string
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+ReturnedNonUnit inherit WoofWare.NUnitTestRunner.UserMethodFailure
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+ReturnedNonUnit.get_name [method]: unit -> string
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+ReturnedNonUnit.get_result [method]: unit -> obj
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+ReturnedNonUnit.name [property]: [read-only] string
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+ReturnedNonUnit.result [property]: [read-only] obj
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+Tags inherit obj
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+Tags.BadParameters [static field]: int = 2
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+Tags.ReturnedNonUnit [static field]: int = 0
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+Tags.Threw [static field]: int = 1
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+Threw inherit WoofWare.NUnitTestRunner.UserMethodFailure
|
||||
@@ -683,13 +726,16 @@ WoofWare.NUnitTestRunner.UserMethodFailure+Threw.get_name [method]: unit -> stri
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+Threw.Item2 [property]: [read-only] System.Exception
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure+Threw.name [property]: [read-only] string
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.Equals [method]: (WoofWare.NUnitTestRunner.UserMethodFailure, System.Collections.IEqualityComparer) -> bool
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.get_IsBadParameters [method]: unit -> bool
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.get_IsReturnedNonUnit [method]: unit -> bool
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.get_IsThrew [method]: unit -> bool
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.get_Name [method]: unit -> string
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.get_Tag [method]: unit -> int
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.IsBadParameters [property]: [read-only] bool
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.IsReturnedNonUnit [property]: [read-only] bool
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.IsThrew [property]: [read-only] bool
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.Name [property]: [read-only] string
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.NewBadParameters [static method]: (string, System.Type [], obj []) -> WoofWare.NUnitTestRunner.UserMethodFailure
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.NewReturnedNonUnit [static method]: (string, obj) -> WoofWare.NUnitTestRunner.UserMethodFailure
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.NewThrew [static method]: (string, System.Exception) -> WoofWare.NUnitTestRunner.UserMethodFailure
|
||||
WoofWare.NUnitTestRunner.UserMethodFailure.Tag [property]: [read-only] int
|
@@ -90,8 +90,15 @@ module TestFixture =
|
||||
let result =
|
||||
try
|
||||
head.Invoke (containingObject, args) |> Ok
|
||||
with :? TargetInvocationException as e ->
|
||||
Error (UserMethodFailure.Threw (head.Name, e.InnerException))
|
||||
with
|
||||
| :? TargetInvocationException as e -> Error (UserMethodFailure.Threw (head.Name, e.InnerException))
|
||||
| :? TargetParameterCountException ->
|
||||
UserMethodFailure.BadParameters (
|
||||
head.Name,
|
||||
head.GetParameters () |> Array.map (fun pm -> pm.ParameterType),
|
||||
args
|
||||
)
|
||||
|> Error
|
||||
|
||||
match result with
|
||||
| Error e -> Error (wrap e)
|
||||
@@ -620,14 +627,16 @@ module TestFixture =
|
||||
| [ v ] ->
|
||||
match v.Value with
|
||||
| :? int as v ->
|
||||
match v with
|
||||
| 512 -> categories, args, Some (Parallelizable.Yes ClassParallelScope.Fixtures)
|
||||
| 256 -> categories, args, Some (Parallelizable.Yes ClassParallelScope.Children)
|
||||
| 257 -> categories, args, Some (Parallelizable.Yes ClassParallelScope.All)
|
||||
| 1 -> categories, args, Some (Parallelizable.Yes ClassParallelScope.Self)
|
||||
| v ->
|
||||
failwith
|
||||
$"Could not recognise value %i{v} of parallel scope in %s{parentType.FullName}"
|
||||
match ParallelScope.ofInt v with
|
||||
| ParallelScope.Fixtures ->
|
||||
categories, args, Some (Parallelizable.Yes ClassParallelScope.Fixtures)
|
||||
| ParallelScope.Children ->
|
||||
categories, args, Some (Parallelizable.Yes ClassParallelScope.Children)
|
||||
| ParallelScope.All ->
|
||||
categories, args, Some (Parallelizable.Yes ClassParallelScope.All)
|
||||
| ParallelScope.Self ->
|
||||
categories, args, Some (Parallelizable.Yes ClassParallelScope.Self)
|
||||
| ParallelScope.None -> categories, args, Some Parallelizable.No
|
||||
| v ->
|
||||
failwith
|
||||
$"Unexpectedly non-int value %O{v} of parallel scope in %s{parentType.FullName}"
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<PackageId>WoofWare.NUnitTestRunner.Lib</PackageId>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<WarnOn>FS3559</WarnOn>
|
||||
<WoofWareMyriadPluginVersion>4.0.6</WoofWareMyriadPluginVersion>
|
||||
<WoofWareMyriadPluginVersion>4.0.7</WoofWareMyriadPluginVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -23,6 +23,7 @@
|
||||
<Compile Include="GeneratedRuntimeConfig.fs">
|
||||
<MyriadFile>RuntimeConfig.fs</MyriadFile>
|
||||
</Compile>
|
||||
<Compile Include="ParallelScope.fs" />
|
||||
<Compile Include="DotnetRuntime.fs" />
|
||||
<Compile Include="Array.fs" />
|
||||
<Compile Include="List.fs" />
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "0.17",
|
||||
"version": "0.19",
|
||||
"publicReleaseRefSpec": [
|
||||
"^refs/heads/main$"
|
||||
],
|
||||
@@ -8,4 +8,4 @@
|
||||
":/Directory.Build.props",
|
||||
":/README.md"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WoofWare.NUnitTestRunner.St
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WoofWare.NUnitTestRunner.StartupHookLogic", "WoofWare.NUnitTestRunner.StartupHookLogic\WoofWare.NUnitTestRunner.StartupHookLogic.csproj", "{A70627C8-9D19-42C2-AFEB-CFBDDDCE045D}"
|
||||
EndProject
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FailingConsumer", "FailingConsumer\FailingConsumer.fsproj", "{DA7160F5-4C3C-4D2E-918B-7DCBA3F4272E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -42,5 +44,9 @@ Global
|
||||
{A70627C8-9D19-42C2-AFEB-CFBDDDCE045D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A70627C8-9D19-42C2-AFEB-CFBDDDCE045D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A70627C8-9D19-42C2-AFEB-CFBDDDCE045D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DA7160F5-4C3C-4D2E-918B-7DCBA3F4272E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DA7160F5-4C3C-4D2E-918B-7DCBA3F4272E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DA7160F5-4C3C-4D2E-918B-7DCBA3F4272E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA7160F5-4C3C-4D2E-918B-7DCBA3F4272E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
6
flake.lock
generated
6
flake.lock
generated
@@ -20,11 +20,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1729850857,
|
||||
"narHash": "sha256-WvLXzNNnnw+qpFOmgaM3JUlNEH+T4s22b5i2oyyCpXE=",
|
||||
"lastModified": 1730272153,
|
||||
"narHash": "sha256-B5WRZYsRlJgwVHIV6DvidFN7VX7Fg9uuwkRW9Ha8z+w=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "41dea55321e5a999b17033296ac05fe8a8b5a257",
|
||||
"rev": "2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@@ -63,6 +63,7 @@
|
||||
pkgs.alejandra
|
||||
pkgs.nodePackages.markdown-link-check
|
||||
pkgs.shellcheck
|
||||
pkgs.xmlstarlet
|
||||
];
|
||||
};
|
||||
net6 = pkgs.mkShell {
|
||||
|
@@ -8,8 +8,8 @@
|
||||
})
|
||||
(fetchNuGet {
|
||||
pname = "fantomas";
|
||||
version = "6.3.15";
|
||||
hash = "sha256-Gjw7MxjUNckMWSfnOye4UTe5fZWnor6RHCls3PNsuG8=";
|
||||
version = "6.3.16";
|
||||
hash = "sha256-4tRdYf+/Q1iedx+DDuIKVGlIWQdr6erM51VdKzZkhCs=";
|
||||
})
|
||||
(fetchNuGet {
|
||||
pname = "Fantomas.Core";
|
||||
@@ -323,8 +323,8 @@
|
||||
})
|
||||
(fetchNuGet {
|
||||
pname = "WoofWare.Myriad.Plugins";
|
||||
version = "4.0.6";
|
||||
hash = "sha256-b0Uh512YyhYQDZ3DS6DhHLf+6pToTi+ga7mZISAucwY=";
|
||||
version = "4.0.7";
|
||||
hash = "sha256-PlDfBVInMd7VxHA8ZYMtRZVsNCL+cAfQ8wZYAzoT1u0=";
|
||||
})
|
||||
(fetchNuGet {
|
||||
pname = "WoofWare.Myriad.Plugins.Attributes";
|
||||
|
Reference in New Issue
Block a user