Skip to content

Commit ba953ca

Browse files
committed
Pass arguments to build -t benchmark
1 parent f61e68e commit ba953ca

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

FSharp.SystemTextJson.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.29009.5
55
MinimumVisualStudioVersion = 15.0.26124.0
6-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{CB1D506A-0E4B-4D73-9B71-A775E5BBED64}"
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build", ".build", "{CB1D506A-0E4B-4D73-9B71-A775E5BBED64}"
77
ProjectSection(SolutionItems) = preProject
88
.gitignore = .gitignore
99
appveyor.yml = appveyor.yml
@@ -25,7 +25,7 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.SystemTextJson.Tests
2525
EndProject
2626
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{E7CE56A4-261F-495E-B1AE-F0333FF932CA}"
2727
EndProject
28-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.SystemTextJson.Benchmarks", "benchmarks\FSharp.SystemTextJson.Benchmarks\FSharp.SystemTextJson.Benchmarks.fsproj", "{507E640D-9E7B-4386-994B-913E4CDD64D0}"
28+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.SystemTextJson.Benchmarks", "benchmarks\FSharp.SystemTextJson.Benchmarks\FSharp.SystemTextJson.Benchmarks.fsproj", "{507E640D-9E7B-4386-994B-913E4CDD64D0}"
2929
EndProject
3030
Global
3131
GlobalSection(SolutionConfigurationPlatforms) = preSolution

build.fsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,19 @@ Target.create "Test" (fun _ ->
7272

7373
/// This target doesn't need a dependency chain, because the benchmarks actually wrap and build the referenced
7474
/// project(s) as part of the run.
75-
Target.create "Benchmark" (fun _ ->
76-
DotNet.exec (fun o -> { o with
77-
WorkingDirectory = Paths.benchmarks } ) "run" "-c release --filter \"*\""
75+
Target.create "Benchmark" (fun p ->
76+
let args = p.Context.Arguments
77+
seq {
78+
yield! ["-p"; Paths.benchmarks; "-c"; "release"; "--"]
79+
if not (List.contains "-f" args || List.contains "--filter" args) then
80+
yield! ["--filter"; "*"]
81+
yield! args
82+
}
83+
|> Args.toWindowsCommandLine
84+
|> DotNet.exec id "run"
7885
|> fun r ->
79-
if r.OK
80-
then ()
81-
else failwithf "Benchmarks failed with code %d:\n%A" r.ExitCode r.Errors
86+
if not r.OK then
87+
failwithf "Benchmarks failed with code %d:\n%A" r.ExitCode r.Errors
8288
)
8389

8490
Target.create "All" ignore

0 commit comments

Comments
 (0)