@@ -62,6 +62,7 @@ param (
6262 [switch ]$testAllButIntegration ,
6363 [switch ]$testpack ,
6464 [switch ]$testAOT ,
65+ [switch ]$testBenchmarks ,
6566 [string ]$officialSkipTests = " false" ,
6667 [switch ]$noVisualStudio ,
6768 [switch ]$sourceBuild ,
@@ -111,6 +112,7 @@ function Print-Usage() {
111112 Write-Host " -testVs Run F# editor unit tests"
112113 Write-Host " -testpack Verify built packages"
113114 Write-Host " -testAOT Run AOT/Trimming tests"
115+ Write-Host " -testBenchmarks Build and Run Benchmark suite"
114116 Write-Host " -officialSkipTests <bool> Set to 'true' to skip running tests"
115117 Write-Host " "
116118 Write-Host " Advanced settings:"
@@ -176,6 +178,7 @@ function Process-Arguments() {
176178 $script :testVs = $False
177179 $script :testpack = $False
178180 $script :testAOT = $False
181+ $script :testBenchmarks = $False
179182 $script :verifypackageshipstatus = $True
180183 }
181184
@@ -211,6 +214,10 @@ function Process-Arguments() {
211214 $script :pack = $True ;
212215 }
213216
217+ if ($testBenchmarks ) {
218+ $script :testBenchmarks = $True
219+ }
220+
214221 foreach ($property in $properties ) {
215222 if (! $property.StartsWith (" /p:" , " InvariantCultureIgnoreCase" )) {
216223 Write-Host " Invalid argument: $property "
@@ -339,7 +346,7 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str
339346
340347 if ($env: RunningAsPullRequest -ne " true" -and $noTestFilter -eq $false ) {
341348 $args += " --filter TestCategory!=PullRequest"
342- }
349+ }`
343350
344351 if ($asBackgroundJob ) {
345352 Write-Host (" Starting on the background: $args " )
@@ -541,12 +548,21 @@ try {
541548 }
542549 }
543550
551+ if ($testBenchmarks ) {
552+ $properties_storage = $properties
553+ $properties += " /p:RuntimeIdentifier=win-x64"
554+ $properties += " /p:Configuration=Release" # Always run in release.
555+ BuildSolution " FSharp.Benchmarks.sln" $False
556+ $properties = $properties_storage
557+ }
558+
544559 if ($pack ) {
545560 $properties_storage = $properties
546561 $properties += " /p:GenerateSbom=false"
547562 BuildSolution " Microsoft.FSharp.Compiler.sln" $True
548563 $properties = $properties_storage
549564 }
565+
550566 if ($build ) {
551567 VerifyAssemblyVersionsAndSymbols
552568 }
@@ -662,6 +678,12 @@ try {
662678 Pop-Location
663679 }
664680
681+ if ($testBenchmarks ) {
682+ Push-Location " $RepoRoot \tests\benchmarks"
683+ ./ SmokeTestBenchmarks.ps1
684+ Pop-Location
685+ }
686+
665687 # verify nupkgs have access to the source code
666688 $nupkgtestFailed = $false
667689 if ($testpack ) {
0 commit comments