diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c37d0a..95cfba0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,14 +15,14 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, ubuntu-latest] - dotnet: [6.0.x] + os: [windows-latest, ubuntu-latest, macos-latest] + dotnet: [9.0.x] runs-on: ${{ matrix.os }} - + steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ matrix.dotnet }} - name: Build & Tests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 376f9b0..f5b50a4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,11 +12,11 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.0.x + dotnet-version: 9.0.x - name: Build, Tests & Release if: github.ref == 'refs/heads/master' run: dotnet run --project ./fake-build/Build.fsproj -- -t PublishNuget diff --git a/Directory.Build.props b/Directory.Build.props index 8705d91..3127391 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,16 +1,7 @@ - - true - true - - - - - - - + Phillip Trelford, Ruben Bartelink, Milos Chaloupka Copyright © 2010-21 Phillip Trelford, Ruben Bartelink, Milos Chaloupka https://github.com/fsprojects/TickSpec @@ -29,7 +20,7 @@ snupkg - + diff --git a/Examples/ByFeature/CustomContainer/CustomContainer.fsproj b/Examples/ByFeature/CustomContainer/CustomContainer.fsproj index 45311d8..1031dfc 100644 --- a/Examples/ByFeature/CustomContainer/CustomContainer.fsproj +++ b/Examples/ByFeature/CustomContainer/CustomContainer.fsproj @@ -1,8 +1,8 @@  - + - net6.0;net452 + net9.0 @@ -14,13 +14,12 @@ - - - - - + + + + + - \ No newline at end of file diff --git a/Examples/ByFeature/DependencyInjection/DependencyInjection.fsproj b/Examples/ByFeature/DependencyInjection/DependencyInjection.fsproj index bc6677f..92d42d6 100644 --- a/Examples/ByFeature/DependencyInjection/DependencyInjection.fsproj +++ b/Examples/ByFeature/DependencyInjection/DependencyInjection.fsproj @@ -1,8 +1,8 @@  - + - net6.0;net452 + net9.0 @@ -14,8 +14,8 @@ - - - + + + \ No newline at end of file diff --git a/Examples/ByFeature/FunctionalInjection/FunctionalInjection.fsproj b/Examples/ByFeature/FunctionalInjection/FunctionalInjection.fsproj index 170a9f5..15919d0 100644 --- a/Examples/ByFeature/FunctionalInjection/FunctionalInjection.fsproj +++ b/Examples/ByFeature/FunctionalInjection/FunctionalInjection.fsproj @@ -1,8 +1,8 @@  - + - net6.0;net452 + net9.0 @@ -27,8 +27,8 @@ - - - + + + \ No newline at end of file diff --git a/Examples/ByFeature/TaggedExamples/TaggedExamples.fsproj b/Examples/ByFeature/TaggedExamples/TaggedExamples.fsproj index 15ed963..7d21329 100644 --- a/Examples/ByFeature/TaggedExamples/TaggedExamples.fsproj +++ b/Examples/ByFeature/TaggedExamples/TaggedExamples.fsproj @@ -1,8 +1,8 @@ - + - net6.0;net452 + net9.0 @@ -14,8 +14,8 @@ - - - + + + \ No newline at end of file diff --git a/Examples/ByFramework/CommandLine/CSharp/CSharp.csproj b/Examples/ByFramework/CommandLine/CSharp/CSharp.csproj index 95cacde..0b4f739 100644 --- a/Examples/ByFramework/CommandLine/CSharp/CSharp.csproj +++ b/Examples/ByFramework/CommandLine/CSharp/CSharp.csproj @@ -1,9 +1,9 @@  - + Exe - net6.0;net452 + net9.0 diff --git a/Examples/ByFramework/CommandLine/FSharp/FSharp.fsproj b/Examples/ByFramework/CommandLine/FSharp/FSharp.fsproj index 90b66bb..3ce0ece 100644 --- a/Examples/ByFramework/CommandLine/FSharp/FSharp.fsproj +++ b/Examples/ByFramework/CommandLine/FSharp/FSharp.fsproj @@ -1,9 +1,9 @@  - + Exe - net6.0;net452 + net9.0 diff --git a/Examples/ByFramework/CommandLine/TicTacToe/TicTacToe.fsproj b/Examples/ByFramework/CommandLine/TicTacToe/TicTacToe.fsproj index f7875bc..0d50495 100644 --- a/Examples/ByFramework/CommandLine/TicTacToe/TicTacToe.fsproj +++ b/Examples/ByFramework/CommandLine/TicTacToe/TicTacToe.fsproj @@ -1,9 +1,9 @@  - + Exe - net6.0;net452 + net9.0 diff --git a/Examples/ByFramework/Expecto/FSharp.Expecto/Expecto.FSharp.fsproj b/Examples/ByFramework/Expecto/FSharp.Expecto/Expecto.FSharp.fsproj index cd82246..c788e2d 100644 --- a/Examples/ByFramework/Expecto/FSharp.Expecto/Expecto.FSharp.fsproj +++ b/Examples/ByFramework/Expecto/FSharp.Expecto/Expecto.FSharp.fsproj @@ -1,8 +1,8 @@  - + - net6.0 + net9.0 Exe False @@ -19,11 +19,10 @@ - - - - + + + diff --git a/Examples/ByFramework/Expecto/FSharp.Expecto/Program.fs b/Examples/ByFramework/Expecto/FSharp.Expecto/Program.fs index 30e1cad..b77ccf3 100644 --- a/Examples/ByFramework/Expecto/FSharp.Expecto/Program.fs +++ b/Examples/ByFramework/Expecto/FSharp.Expecto/Program.fs @@ -30,5 +30,5 @@ let additionTests = featureTest "Addition.feature" [] let main args = - runTestsInAssembly defaultConfig args + runTestsInAssemblyWithCLIArgs [] args diff --git a/Examples/ByFramework/MSTest/MSTest.FSharp/MSTest.FSharp.fsproj b/Examples/ByFramework/MSTest/MSTest.FSharp/MSTest.FSharp.fsproj index b569599..cd52acc 100644 --- a/Examples/ByFramework/MSTest/MSTest.FSharp/MSTest.FSharp.fsproj +++ b/Examples/ByFramework/MSTest/MSTest.FSharp/MSTest.FSharp.fsproj @@ -1,8 +1,8 @@  - + - net6.0;net452 + net9.0 @@ -12,11 +12,10 @@ - - - + + + - \ No newline at end of file diff --git a/Examples/ByFramework/NUnit/CSharp.NUnit/NUnit.CSharp.csproj b/Examples/ByFramework/NUnit/CSharp.NUnit/NUnit.CSharp.csproj index 83a2de3..e44c629 100644 --- a/Examples/ByFramework/NUnit/CSharp.NUnit/NUnit.CSharp.csproj +++ b/Examples/ByFramework/NUnit/CSharp.NUnit/NUnit.CSharp.csproj @@ -1,8 +1,8 @@  - + - net6.0;net452 + net9.0 @@ -12,8 +12,8 @@ - - - + + + \ No newline at end of file diff --git a/Examples/ByFramework/NUnit/FSharp.NUnit/NUnit.FSharp.fsproj b/Examples/ByFramework/NUnit/FSharp.NUnit/NUnit.FSharp.fsproj index 6a87d5e..a4ec099 100644 --- a/Examples/ByFramework/NUnit/FSharp.NUnit/NUnit.FSharp.fsproj +++ b/Examples/ByFramework/NUnit/FSharp.NUnit/NUnit.FSharp.fsproj @@ -1,8 +1,8 @@  - + - net6.0;net452 + net9.0 @@ -14,8 +14,8 @@ - - - + + + \ No newline at end of file diff --git a/Examples/ByFramework/xUnit/FSharp.xUnit/Xunit.FSharp.fsproj b/Examples/ByFramework/xUnit/FSharp.xUnit/Xunit.FSharp.fsproj index 9366137..68fdd1b 100644 --- a/Examples/ByFramework/xUnit/FSharp.xUnit/Xunit.FSharp.fsproj +++ b/Examples/ByFramework/xUnit/FSharp.xUnit/Xunit.FSharp.fsproj @@ -1,8 +1,8 @@  - + - net6.0;net452 + net9.0 @@ -16,11 +16,10 @@ - - - + + + - \ No newline at end of file diff --git a/Examples/ByStyle/Attributes/Attributes.fsproj b/Examples/ByStyle/Attributes/Attributes.fsproj index cc2a90f..9609176 100644 --- a/Examples/ByStyle/Attributes/Attributes.fsproj +++ b/Examples/ByStyle/Attributes/Attributes.fsproj @@ -1,8 +1,8 @@  - + - net6.0;net452 + net9.0 @@ -38,8 +38,8 @@ - - - + + + \ No newline at end of file diff --git a/Examples/ByStyle/Attributes/Prelude.fs b/Examples/ByStyle/Attributes/Prelude.fs index 745b22c..c2edd24 100644 --- a/Examples/ByStyle/Attributes/Prelude.fs +++ b/Examples/ByStyle/Attributes/Prelude.fs @@ -5,7 +5,7 @@ module NUnitExtensions = open NUnit.Framework type Assert with static member Contains(expected:obj, xs:'a list) = - Assert.Contains(expected, xs |> List.toArray) + CollectionAssert.Contains(xs |> List.toArray, expected) module Union = open Microsoft.FSharp.Reflection diff --git a/Examples/ByStyle/Functional/Functional.fsproj b/Examples/ByStyle/Functional/Functional.fsproj index a9c76ab..e1f9dac 100644 --- a/Examples/ByStyle/Functional/Functional.fsproj +++ b/Examples/ByStyle/Functional/Functional.fsproj @@ -1,8 +1,8 @@  - + - net6.0;net452 + net9.0 @@ -18,8 +18,8 @@ - - - + + + \ No newline at end of file diff --git a/Examples/ByStyle/Interactive/Interactive.fsproj b/Examples/ByStyle/Interactive/Interactive.fsproj index 7ca8b60..3b24704 100644 --- a/Examples/ByStyle/Interactive/Interactive.fsproj +++ b/Examples/ByStyle/Interactive/Interactive.fsproj @@ -1,8 +1,8 @@  - + - net6.0;net452 + net9.0 diff --git a/TickSpec.Tests/TickSpec.Tests.fsproj b/TickSpec.Tests/TickSpec.Tests.fsproj index fccb25b..7337219 100644 --- a/TickSpec.Tests/TickSpec.Tests.fsproj +++ b/TickSpec.Tests/TickSpec.Tests.fsproj @@ -1,8 +1,7 @@  - - net6.0;net452 + net9.0 @@ -13,8 +12,8 @@ - - - + + + \ No newline at end of file diff --git a/TickSpec/FeatureGen.fs b/TickSpec/FeatureGen.fs index b3eac16..a31aeea 100644 --- a/TickSpec/FeatureGen.fs +++ b/TickSpec/FeatureGen.fs @@ -1,21 +1,28 @@ -namespace TickSpec +namespace TickSpec -#if !NETSTANDARD2_0 open System open System.Collections.Generic open System.Diagnostics +open System.Diagnostics.SymbolStore +open System.IO open System.Reflection open System.Reflection.Emit +open System.Reflection.Metadata +open System.Reflection.Metadata.Ecma335 +open System.Reflection.PortableExecutable +open System.Runtime.Loader open TickSpec.ScenarioGen -type internal FeatureGen(featureName:string,documentUrl:string) = - let assemblyName = "Feature" - /// Feature dynamic assembly +type internal FeatureGen(featureName:string, documentUrl:string) = + // Create unique assembly name to avoid conflicts when multiple features are loaded + let assemblyName = sprintf "Feature_%s_%s" (featureName.Replace(" ", "_")) (Guid.NewGuid().ToString("N")) + /// Feature persisted assembly builder (for PDB support) let assemblyBuilder = - AppDomain.CurrentDomain - .DefineDynamicAssembly( - AssemblyName(assemblyName), - AssemblyBuilderAccess.Run) + PersistedAssemblyBuilder( + AssemblyName(assemblyName), + typeof.Assembly) + /// Separate load context for this feature assembly + let loadContext = AssemblyLoadContext(assemblyName, isCollectible = true) /// Set assembly debuggable attribute do let debuggableAttribute = let ctor = @@ -28,12 +35,72 @@ type internal FeatureGen(featureName:string,documentUrl:string) = assemblyBuilder.SetCustomAttribute debuggableAttribute /// Feature dynamic module let module_ = - assemblyBuilder.DefineDynamicModule - (featureName+".dll", true) - /// Feature source document - let doc = module_.DefineDocument(documentUrl, Guid.Empty, Guid.Empty, Guid.Empty) + assemblyBuilder.DefineDynamicModule(featureName+".dll") + /// Document writer for sequence points + let doc = module_.DefineDocument(documentUrl, SymLanguageType.CSharp, SymLanguageVendor.Microsoft, SymDocumentType.Text) + + /// Mutable to track if assembly has been saved + let mutable savedAssembly : Assembly option = None + + /// Save the assembly to memory and load it + member private this.EnsureAssemblyLoaded() = + match savedAssembly with + | Some asm -> asm + | None -> + // Generate metadata with PDB support using out parameters + let mutable ilStream : BlobBuilder = null + let mutable mappedFieldData : BlobBuilder = null + let mutable pdbBuilder : MetadataBuilder = null + let metadataBuilder = assemblyBuilder.GenerateMetadata(&ilStream, &mappedFieldData, &pdbBuilder) + + // Get row counts for PDB builder + let rowCounts = metadataBuilder.GetRowCounts() + + // Create portable PDB builder (no entry point for DLL) + let portablePdbBuilder = + PortablePdbBuilder( + pdbBuilder, + rowCounts, + Unchecked.defaultof) + + // Serialize PDB to get content ID + let pdbBlobBuilder = BlobBuilder() + let pdbContentId = portablePdbBuilder.Serialize(pdbBlobBuilder) + let pdbBytes = pdbBlobBuilder.ToArray() + + // Create debug directory entry + let debugDirectoryBuilder = DebugDirectoryBuilder() + debugDirectoryBuilder.AddCodeViewEntry(assemblyName + ".pdb", pdbContentId, portablePdbBuilder.FormatVersion) + + // Create PE with debug info + let peHeaderBuilder = PEHeaderBuilder(imageCharacteristics = Characteristics.Dll) + + let peBuilder = + ManagedPEBuilder( + peHeaderBuilder, + MetadataRootBuilder(metadataBuilder), + ilStream, + mappedFieldData = mappedFieldData, + debugDirectoryBuilder = debugDirectoryBuilder) + + // Write PE to byte array + let peBlobBuilder = BlobBuilder() + peBuilder.Serialize(peBlobBuilder) |> ignore + let peBytes = peBlobBuilder.ToArray() + + // Load assembly from stream with PDB for debugging + use peStream = new MemoryStream(peBytes) + use pdbStream = new MemoryStream(pdbBytes) + let asm = loadContext.LoadFromStream(peStream, pdbStream) + savedAssembly <- Some asm + asm + /// Assembly of generated feature - member this.Assembly = assemblyBuilder :> Assembly + member this.Assembly = this.EnsureAssemblyLoaded() + + /// Gets the document writer for sequence points + member this.Document = doc + /// Generates scenario type from lines member this.GenScenario (events) @@ -42,5 +109,3 @@ type internal FeatureGen(featureName:string,documentUrl:string) = lines:(LineSource * MethodInfo * string[]) [], parameters:(string * string)[]) = generateScenario module_ doc events parsers (scenarioName,lines,parameters) - -#endif \ No newline at end of file diff --git a/TickSpec/ScenarioGen.fs b/TickSpec/ScenarioGen.fs index a6c1528..1758a01 100644 --- a/TickSpec/ScenarioGen.fs +++ b/TickSpec/ScenarioGen.fs @@ -1,18 +1,34 @@ module internal TickSpec.ScenarioGen -#if !NETSTANDARD2_0 open System open System.Collections.Generic +open System.Diagnostics.SymbolStore open System.Reflection open System.Reflection.Emit open Microsoft.FSharp.Reflection +/// Sanitizes scenario name for use as a type name +/// Replaces characters that have special meaning in .NET type names: +/// comma (,), plus (+), ampersand (&), asterisk (*), brackets ([ ]), period (.), backslash (\) +/// Also replaces angle brackets (< >) which cause issues in metadata +let sanitizeTypeName (name: string) = + name + .Replace("\\", "_") // backslash first to avoid double-escaping + .Replace(",", "_") + .Replace("+", "_") + .Replace("&", "_") + .Replace("*", "_") + .Replace("[", "_") + .Replace("]", "_") + .Replace("<", "_") + .Replace(">", "_") + /// Defines scenario type let defineScenarioType (module_:ModuleBuilder) (scenarioName) = module_.DefineType( - scenarioName, + sanitizeTypeName scenarioName, TypeAttributes.Public ||| TypeAttributes.Class) /// Defines _provider field @@ -368,7 +384,7 @@ let storeMethodResultInProvider /// Defines step method let defineStepMethod - doc + (doc:ISymbolDocumentWriter) (scenarioBuilder:TypeBuilder) (providerField:FieldBuilder) (parsers:IDictionary) @@ -383,8 +399,8 @@ let defineStepMethod [||]) /// Step method ILGenerator let gen = stepMethod.GetILGenerator() - // Set marker in source document - gen.MarkSequencePoint(doc,n,1,n,line.Text.Length+1) + // Mark sequence point for debugging/breakpoints + gen.MarkSequencePoint(doc, n, 1, n, 100) // Handle generic methods let mi = if mi.ContainsGenericParameters then @@ -410,7 +426,7 @@ let defineStepMethod emitArgument gen providerField parsers (arg,p) gen.Emit(OpCodes.Stloc, locals.[i]) // } - gen.Emit(OpCodes.Leave_S, block) + gen.Emit(OpCodes.Leave, block) // catch(Exception ex) { gen.BeginCatchBlock(typeof) // throw ArgumentException(message, name, ex); @@ -533,24 +549,24 @@ let defineRunMethod beforeStepEvents |> emitEvents gen.Emit(OpCodes.Ldarg_0) gen.Emit(OpCodes.Callvirt,stepMethod) - gen.Emit(OpCodes.Leave_S, exit) + gen.Emit(OpCodes.Leave, exit) gen.BeginFinallyBlock() afterStepEvents |> emitEvents gen.EndExceptionBlock() ) - gen.Emit(OpCodes.Leave_S, exit) + gen.Emit(OpCodes.Leave, exit) gen.BeginFinallyBlock() // Execute after scenario events afterScenarioEvents |> emitEvents gen.EndExceptionBlock() - gen.Emit(OpCodes.Leave_S, exitOuter) + gen.Emit(OpCodes.Leave, exitOuter) gen.BeginFinallyBlock() // Dispose the ServiceProvider if it is IDisposable gen.Emit(OpCodes.Ldarg_0) gen.Emit(OpCodes.Ldfld, providerField) gen.Emit(OpCodes.Isinst, typeof) let labelNoDispose = gen.DefineLabel() - gen.Emit(OpCodes.Brfalse_S, labelNoDispose) + gen.Emit(OpCodes.Brfalse, labelNoDispose) gen.Emit(OpCodes.Ldarg_0) gen.Emit(OpCodes.Ldfld, providerField) gen.Emit(OpCodes.Callvirt, typeof.GetMethod("Dispose")) @@ -560,6 +576,7 @@ let defineRunMethod gen.Emit(OpCodes.Ret) /// Generates Type for specified Scenario +/// Returns the type name (for lookup after assembly is loaded) let generateScenario (module_:ModuleBuilder) doc @@ -581,7 +598,6 @@ let generateScenario |> Array.map (defineStepMethod doc scenarioBuilder providerField parsers) defineRunMethod scenarioBuilder providerField events stepMethods - /// Return scenario - scenarioBuilder.CreateType() - -#endif \ No newline at end of file + /// Create the type and return its sanitized name (for lookup after assembly load) + scenarioBuilder.CreateType() |> ignore + sanitizeTypeName scenarioName \ No newline at end of file diff --git a/TickSpec/StepAttributes.fs b/TickSpec/StepAttributes.fs index 7614da2..fd200fa 100644 --- a/TickSpec/StepAttributes.fs +++ b/TickSpec/StepAttributes.fs @@ -12,21 +12,21 @@ type StepAttribute internal (step:string) = type GivenAttribute(step:string) = inherit StepAttribute (step) new () = GivenAttribute(null) - new (format,[] args) = + new (format:string,[] args:obj[]) = GivenAttribute(String.Format(format,args)) /// Method annotation for when step [] type WhenAttribute(step) = inherit StepAttribute (step) new () = WhenAttribute(null) - new (format,[] args) = + new (format:string,[] args:obj[]) = WhenAttribute(String.Format(format,args)) /// Method annotation for then step [] type ThenAttribute(step) = inherit StepAttribute(step) new () = ThenAttribute(null) - new (format,[] args) = + new (format:string,[] args:obj[]) = ThenAttribute(String.Format(format,args)) /// Method annotation for parsers of string -> 'a diff --git a/TickSpec/TickSpec.fs b/TickSpec/TickSpec.fs index 5b13d6c..e51fef6 100644 --- a/TickSpec/TickSpec.fs +++ b/TickSpec/TickSpec.fs @@ -26,8 +26,8 @@ type StepDefinitions (givens,whens,thens,events,valueParsers) = static let getStepAttributes (m:MemberInfo) = Attribute.GetCustomAttributes(m,typeof) static let isMethodInScope (feature:string) (scenario:ScenarioSource) (scopedTags,scopedFeatures,scopedScenarios,m) = - let trim p (s:string) = - if s.StartsWith p then (s.Substring p.Length).Trim() else s + let trim (p:string) (s:string) = + if s.StartsWith(p) then (s.Substring p.Length).Trim() else s let tagged = match scopedTags with | [] -> true @@ -259,7 +259,6 @@ type StepDefinitions (givens,whens,thens,events,valueParsers) = member __.GenerateFeature (sourceUrl:string,lines:string[]) = let featureSource = parseFeature lines let feature = featureSource.Name -#if !NETSTANDARD2_0 let gen = FeatureGen(featureSource.Name,sourceUrl) let genType scenario = let lines = @@ -271,10 +270,26 @@ type StepDefinitions (givens,whens,thens,events,valueParsers) = events valueParsers (scenario.Name, lines, scenario.Parameters) - let createAction scenario (scenarioMetadata: ScenarioMetadata) = - let t = lazy (genType scenario) + // Generate ALL types BEFORE accessing assembly (required for PersistedAssemblyBuilder) + let scenarioTypes = + featureSource.Scenarios + |> Seq.map (fun scenario -> + let scenarioMetadata = + { Name=scenario.Name;Description=getDescription scenario.Steps;Parameters=scenario.Parameters;Tags=scenario.Tags;Rule=scenario.Rule } + let typeName = genType scenario + (scenario, scenarioMetadata, typeName)) + |> Seq.toArray + // Now get the assembly (this finalizes the builder) + let assembly = gen.Assembly + let createAction (typeName: string) (scenarioMetadata: ScenarioMetadata) = TickSpec.Action(fun () -> - let ctor = t.Force().GetConstructor([| + let t = + assembly.GetTypes() + |> Array.tryFind (fun t -> t.Name = typeName) + |> Option.defaultWith (fun () -> + failwithf "Type '%s' not found in generated assembly. Available types: %A" + typeName (assembly.GetTypes() |> Array.map (fun t -> t.FullName))) + let ctor = t.GetConstructor([| typeof> typeof |]) @@ -288,18 +303,11 @@ type StepDefinitions (givens,whens,thens,events,valueParsers) = mi.Invoke(instance,[||]) |> ignore ) let scenarios = - featureSource.Scenarios - |> Seq.map (fun scenario -> - let scenarioMetadata = - { Name=scenario.Name;Description=getDescription scenario.Steps;Parameters=scenario.Parameters;Tags=scenario.Tags;Rule=scenario.Rule } - createAction scenario scenarioMetadata + scenarioTypes + |> Seq.map (fun (_, scenarioMetadata, typeName) -> + createAction typeName scenarioMetadata |> Scenario.fromScenarioMetadata scenarioMetadata ) - let assembly = gen.Assembly -#else - let scenarios = __.GenerateScenarios lines - let assembly = null -#endif { Name = featureSource.Name; Source = sourceUrl; Assembly = assembly; diff --git a/TickSpec/TickSpec.fsproj b/TickSpec/TickSpec.fsproj index 1a7426d..0662019 100644 --- a/TickSpec/TickSpec.fsproj +++ b/TickSpec/TickSpec.fsproj @@ -1,8 +1,7 @@  - - netstandard2.0;net452 + net9.0 TickSpec TickSpec is a lightweight Behaviour Driven Development (BDD) framework for .Net. diff --git a/Wiring/TickSpec.Xunit/TickSpec.Xunit.fsproj b/Wiring/TickSpec.Xunit/TickSpec.Xunit.fsproj index e121869..a9a05af 100644 --- a/Wiring/TickSpec.Xunit/TickSpec.Xunit.fsproj +++ b/Wiring/TickSpec.Xunit/TickSpec.Xunit.fsproj @@ -1,8 +1,7 @@  - - netstandard2.0;net452 + net9.0 TickSpec.Xunit TickSpec integration with Xunit. @@ -18,6 +17,6 @@ - + diff --git a/fake-build/Build.fs b/fake-build/Build.fs index 87eb2a0..5168892 100644 --- a/fake-build/Build.fs +++ b/fake-build/Build.fs @@ -81,17 +81,12 @@ let createTargets () = ) Target.create "Test" (fun _ -> - // Xunit seems to be failing under Linux with net452 runner, let's just skip it - // the .NET 4 tests all together there - let framework = if Environment.isWindows then None else Some "net6.0" - Sln |> DotNet.test (fun o -> { o with Configuration = DotNet.Release NoBuild = true MSBuildParams = { o.MSBuildParams with DisableInternalBinLog = true } - Framework = framework } ) ) diff --git a/fake-build/Build.fsproj b/fake-build/Build.fsproj index 74d2462..b572bf5 100644 --- a/fake-build/Build.fsproj +++ b/fake-build/Build.fsproj @@ -1,8 +1,7 @@ Exe - net6.0 - Major + net9.0 @@ -18,6 +17,6 @@ - + diff --git a/netfx.props b/netfx.props deleted file mode 100644 index c41b419..0000000 --- a/netfx.props +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - true - - - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono - /usr/lib/mono - /usr/local/lib/mono - - - $(BaseFrameworkPathOverrideForMono)/4.5-api - $(BaseFrameworkPathOverrideForMono)/4.5.1-api - $(BaseFrameworkPathOverrideForMono)/4.5.2-api - $(BaseFrameworkPathOverrideForMono)/4.6-api - $(BaseFrameworkPathOverrideForMono)/4.6.1-api - $(BaseFrameworkPathOverrideForMono)/4.6.2-api - $(BaseFrameworkPathOverrideForMono)/4.7-api - $(BaseFrameworkPathOverrideForMono)/4.7.1-api - true - - - $(FrameworkPathOverride)/Facades;$(AssemblySearchPaths) - - \ No newline at end of file