@@ -73,7 +73,7 @@ param (
73
73
[switch ]$compressAllMetadata ,
74
74
[switch ]$buildnorealsig = $true ,
75
75
[switch ]$verifypackageshipstatus = $false ,
76
- [string ]$job = " " ,
76
+ [string ]$testBatch = " " ,
77
77
[parameter (ValueFromRemainingArguments = $true )][string []]$properties )
78
78
79
79
Set-StrictMode - version 2.0
@@ -357,17 +357,24 @@ function VerifyAssemblyVersionsAndSymbols() {
357
357
}
358
358
}
359
359
360
- function TestUsingMSBuild ([string ] $testProject , [string ] $targetFramework , [string ]$testadapterpath , [ boolean ] $asBackgroundJob = $false , [ string ] $settings = " " ) {
360
+ function TestUsingMSBuild ([string ] $testProject , [string ] $targetFramework , [string ] $settings = " " ) {
361
361
362
362
$dotnetPath = InitializeDotNetCli
363
363
$dotnetExe = Join-Path $dotnetPath " dotnet.exe"
364
364
$projectName = [System.IO.Path ]::GetFileNameWithoutExtension($testProject )
365
+
366
+ $testBatchSuffix = " "
367
+ if ($testBatch ) {
368
+ $testBatchSuffix = " _batch$testBatch "
369
+ }
370
+
365
371
# {assembly} and {framework} will expand respectively. See https://github.com/spekt/testlogger/wiki/Logger-Configuration#logfilepath
366
372
# This is useful to deconflict log filenames when there are many test assemblies, e.g. when testing a whole solution.
367
- $testLogPath = " $ArtifactsDir \TestResults\$configuration \{assembly}_{framework}$job .xml"
368
- $testBinLogPath = " $LogDir \${projectName} _$targetFramework$job .binlog"
369
- $args = " test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path $testadapterpath --logger "" xunit;LogFilePath=$testLogPath "" /bl:$testBinLogPath "
370
- $args += " --blame --blame-hang-timeout 5minutes --results-directory $ArtifactsDir \TestResults\$configuration -p:vstestusemsbuildoutput=true"
373
+ $testLogPath = " $ArtifactsDir \TestResults\$configuration \{assembly}_{framework}$testBatchSuffix .xml"
374
+
375
+ $testBinLogPath = " $LogDir \${projectName} _$targetFramework$testBatch .binlog"
376
+ $args = " test $testProject -c $configuration -f $targetFramework --logger "" xunit;LogFilePath=$testLogPath "" /bl:$testBinLogPath "
377
+ $args += " --blame-hang-timeout 5minutes --results-directory $ArtifactsDir \TestResults\$configuration "
371
378
372
379
if (-not $noVisualStudio -or $norestore ) {
373
380
$args += " --no-restore"
@@ -378,25 +385,12 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str
378
385
}
379
386
380
387
$args += " $settings "
381
- if ($job ) {
382
- $args += " --filter batch=$job "
383
- }
384
-
385
- if ($asBackgroundJob ) {
386
- Write-Host
387
- Write-Host (" Starting on the background: $args " )
388
- Write-Host (" ------------------------------------" )
389
- Start-Job - ScriptBlock {
390
- $argArray = $using :args -Split " "
391
- & $using :dotnetExe $argArray
392
- if ($LASTEXITCODE -ne 0 ) {
393
- throw " Command failed to execute with exit code $ ( $LASTEXITCODE ) : $using :dotnetExe $using :args "
394
- }
395
- }
396
- } else {
397
- Write-Host (" $args " )
398
- Exec- Console $dotnetExe $args
388
+ if ($testBatch ) {
389
+ $args += " --filter batch=$testBatch "
399
390
}
391
+
392
+ Write-Host (" $args " )
393
+ Exec- Console $dotnetExe $args
400
394
}
401
395
402
396
function Prepare-TempDir () {
@@ -600,20 +594,12 @@ try {
600
594
$script :BuildCategory = " Test"
601
595
$script :BuildMessage = " Failure running tests"
602
596
603
- function Receive ($job ) {
604
- while ($job.HasMoreData ) {
605
- Receive-Job $job | Write-Host
606
- Start-Sleep - Seconds 1
607
- }
608
- Receive-Job $job - Wait - ErrorAction Stop
609
- }
610
-
611
597
if ($testCoreClr ) {
612
- TestUsingMSBuild - testProject " $RepoRoot \FSharp.sln" - targetFramework $script :coreclrTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.ComponentTests\ "
598
+ TestUsingMSBuild - testProject " $RepoRoot \FSharp.sln" - targetFramework $script :coreclrTargetFramework
613
599
}
614
600
615
601
if ($testDesktop ) {
616
- TestUsingMSBuild - testProject " $RepoRoot \FSharp.sln" - targetFramework $script :desktopTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.ComponentTests\ "
602
+ TestUsingMSBuild - testProject " $RepoRoot \FSharp.sln" - targetFramework $script :desktopTargetFramework
617
603
}
618
604
619
605
if ($testFSharpQA ) {
@@ -644,50 +630,49 @@ try {
644
630
}
645
631
646
632
if ($testFSharpCore ) {
647
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" - targetFramework $script :coreclrTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Core.UnitTests\ "
648
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" - targetFramework $script :desktopTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Core.UnitTests\ "
633
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" - targetFramework $script :coreclrTargetFramework
634
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" - targetFramework $script :desktopTargetFramework
649
635
}
650
636
651
637
if ($testCompiler ) {
652
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" - targetFramework $script :coreclrTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.ComponentTests\ "
653
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" - targetFramework $script :desktopTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.ComponentTests\ "
654
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" - targetFramework $script :coreclrTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.Service.Tests\ "
655
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" - targetFramework $script :desktopTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.Service.Tests\ "
638
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" - targetFramework $script :coreclrTargetFramework
639
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" - targetFramework $script :desktopTargetFramework
640
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" - targetFramework $script :coreclrTargetFramework
641
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" - targetFramework $script :desktopTargetFramework
656
642
}
657
643
658
644
659
645
if ($testCompilerComponentTests ) {
660
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" - targetFramework $script :coreclrTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.ComponentTests\ "
661
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" - targetFramework $script :desktopTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.ComponentTests\ "
646
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" - targetFramework $script :coreclrTargetFramework
647
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" - targetFramework $script :desktopTargetFramework
662
648
}
663
649
664
650
665
651
if ($testCompilerService ) {
666
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" - targetFramework $script :coreclrTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.Service.Tests\ "
667
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" - targetFramework $script :desktopTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.Service.Tests\ "
652
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" - targetFramework $script :coreclrTargetFramework
653
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" - targetFramework $script :desktopTargetFramework
668
654
}
669
655
670
656
if ($testCambridge ) {
671
- TestUsingMSBuild - testProject " $RepoRoot \tests\fsharp\FSharpSuite.Tests.fsproj" - targetFramework $script :coreclrTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharpSuite.Tests\ "
672
- TestUsingMSBuild - testProject " $RepoRoot \tests\fsharp\FSharpSuite.Tests.fsproj" - targetFramework $script :desktopTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharpSuite.Tests\ "
657
+ TestUsingMSBuild - testProject " $RepoRoot \tests\fsharp\FSharpSuite.Tests.fsproj" - targetFramework $script :coreclrTargetFramework
658
+ TestUsingMSBuild - testProject " $RepoRoot \tests\fsharp\FSharpSuite.Tests.fsproj" - targetFramework $script :desktopTargetFramework
673
659
}
674
660
675
661
if ($testScripting ) {
676
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" - targetFramework $script :coreclrTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.Private.Scripting.UnitTests\ "
677
- TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" - targetFramework $script :desktopTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Compiler.Private.Scripting.UnitTests\ "
662
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" - targetFramework $script :coreclrTargetFramework
663
+ TestUsingMSBuild - testProject " $RepoRoot \tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" - targetFramework $script :desktopTargetFramework
678
664
}
679
665
680
666
if ($testEditor -and -not $noVisualStudio ) {
681
- TestUsingMSBuild - testProject " $RepoRoot \vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" - targetFramework $script :desktopTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj "
667
+ TestUsingMSBuild - testProject " $RepoRoot \vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" - targetFramework $script :desktopTargetFramework
682
668
}
683
669
684
670
if ($testVs -and -not $noVisualStudio ) {
685
- TestUsingMSBuild - testProject " $RepoRoot \vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" - targetFramework $script :desktopTargetFramework - testadapterpath " $ArtifactsDir \bin\VisualFSharp.UnitTests\ "
671
+ TestUsingMSBuild - testProject " $RepoRoot \vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" - targetFramework $script :desktopTargetFramework
686
672
}
687
673
688
-
689
674
if ($testIntegration ) {
690
- TestUsingMSBuild - testProject " $RepoRoot \vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" - targetFramework $script :desktopTargetFramework - testadapterpath " $ArtifactsDir \bin\FSharp.Editor.IntegrationTests\ "
675
+ TestUsingMSBuild - testProject " $RepoRoot \vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" - targetFramework $script :desktopTargetFramework
691
676
}
692
677
693
678
if ($testAOT ) {
0 commit comments