From 1d87c6158dbc68e4729fdf8a9bb761c92961d304 Mon Sep 17 00:00:00 2001 From: Jimmy Byrd Date: Mon, 8 Jul 2019 10:58:19 -0400 Subject: [PATCH] Fix Fsharp template --- .../content/BenchmarkConfig.fs | 27 +++++++++---------- .../content/_BenchmarkName_.fs | 12 ++++++--- .../content/_BenchmarkProjectName_.fsproj | 6 +++++ 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/BenchmarkConfig.fs b/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/BenchmarkConfig.fs index f7d541f620..c58200368f 100644 --- a/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/BenchmarkConfig.fs +++ b/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/BenchmarkConfig.fs @@ -1,20 +1,17 @@ -open BenchmarkDotNet.Analysers; -open BenchmarkDotNet.Attributes; -open BenchmarkDotNet.Columns; -open BenchmarkDotNet.Configs; -open BenchmarkDotNet.Exporters; -open BenchmarkDotNet.Exporters.Csv; -open BenchmarkDotNet.Jobs; -open BenchmarkDotNet.Loggers; +module Configs + +open BenchmarkDotNet.Configs +open BenchmarkDotNet.Diagnosers +open BenchmarkDotNet.Exporters +open BenchmarkDotNet.Validators + +type BenchmarkConfig() as self = -type BenchmarkConfig() = // Configure your benchmarks, see for more details: https://benchmarkdotnet.org/articles/configs/configs.html. - ManualConfig - .Create(DefaultConfig.Instance) - .With(Job.ShortRun.With(Runtime.Mono)) - .With(Job.ShortRun.With(Runtime.Core)) + inherit ManualConfig() + do + self .With(MemoryDiagnoser.Default) .With(MarkdownExporter.GitHub) .With(ExecutionValidator.FailOnError) - inherit ManualConfig() - new() = BenchmarkConfig() + |> ignore diff --git a/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/_BenchmarkName_.fs b/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/_BenchmarkName_.fs index aac3bd6e0d..62bb41500a 100644 --- a/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/_BenchmarkName_.fs +++ b/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/_BenchmarkName_.fs @@ -1,9 +1,11 @@ -open System; -open BenchmarkDotNet; -open BenchmarkDotNet.Attributes; +module Benchmark + +open System +open BenchmarkDotNet +open BenchmarkDotNet.Attributes #if config -[] +[)>] #endif type $(BenchmarkName) () = [] @@ -36,3 +38,5 @@ type $(BenchmarkName) () = [] member this.AsyncToSync () = Async.Sleep(this.sleepTime) |> Async.RunSynchronously + + diff --git a/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/_BenchmarkProjectName_.fsproj b/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/_BenchmarkProjectName_.fsproj index 35639d57c8..5b30b5452a 100644 --- a/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/_BenchmarkProjectName_.fsproj +++ b/templates/BenchmarkDotNet.BenchmarkProjectTemplate.FSharp/content/_BenchmarkProjectName_.fsproj @@ -14,4 +14,10 @@ + + + + + +