Skip to content

Commit 937c83a

Browse files
committed
Avoid building Windows-only binaries on linux/mac
1 parent 9b09077 commit 937c83a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Microsoft.VisualStudio.Threading.slnx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,13 @@
4444
<File Path="test/Directory.Build.targets" />
4545
<File Path="test/dirs.proj" />
4646
<Project Path="samples/samples.csproj" />
47-
<Project Path="test/IsolatedTestHost/IsolatedTestHost.csproj" />
47+
<Project Path="test/IsolatedTestHost/IsolatedTestHost.csproj">
48+
<Build Solution="*|NonWindows" Project="false" />
49+
</Project>
4850
<Project Path="test/Microsoft.VisualStudio.Threading.Analyzers.Tests/Microsoft.VisualStudio.Threading.Analyzers.Tests.csproj" />
49-
<Project Path="test/Microsoft.VisualStudio.Threading.Tests.Win7RegistryWatcher/Microsoft.VisualStudio.Threading.Tests.Win7RegistryWatcher.csproj" />
51+
<Project Path="test/Microsoft.VisualStudio.Threading.Tests.Win7RegistryWatcher/Microsoft.VisualStudio.Threading.Tests.Win7RegistryWatcher.csproj">
52+
<Build Solution="*|NonWindows" Project="false" />
53+
</Project>
5054
<Project Path="test/Microsoft.VisualStudio.Threading.Tests/Microsoft.VisualStudio.Threading.Tests.csproj" />
5155
<Project Path="test/NativeAOTCompatibility.Test/NativeAOTCompatibility.Test.csproj" />
5256
</Folder>

tools/dotnet-test-cloud.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ if ($x86) {
4747
$testBinLog = Join-Path $ArtifactStagingFolder (Join-Path build_logs test.binlog)
4848
$testDiagLog = Join-Path $ArtifactStagingFolder (Join-Path test_logs diag.log)
4949

50+
$extraArgs = @()
51+
if ($IsLinux -or $IsMacOS) {
52+
$extraArgs += '-p:Platform=NonWindows'
53+
}
54+
5055
& $dotnet test $RepoRoot `
5156
--no-build `
5257
-c $Configuration `
@@ -58,6 +63,7 @@ $testDiagLog = Join-Path $ArtifactStagingFolder (Join-Path test_logs diag.log)
5863
-bl:"$testBinLog" `
5964
--diag "$testDiagLog;TraceLevel=info" `
6065
--logger trx `
66+
@extraArgs `
6167

6268
$unknownCounter = 0
6369
Get-ChildItem -Recurse -Path $RepoRoot\test\*.trx |% {

0 commit comments

Comments
 (0)