Skip to content

Commit 517c548

Browse files
authored
Autodetect processor architecture used for tests (#1837)
* Autodetect processor architecture used for tests * Use dotnet runner autodetect mechanism
1 parent bde56ce commit 517c548

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

make.ps1

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Param(
55
[String] $target = "build",
66
[String] $configuration = "Release",
77
[String[]] $frameworks=@('net462','netcoreapp3.1','net6.0','net8.0'),
8-
[String] $platform = "x64",
8+
[String] $platform = $null, # auto-detect
99
[switch] $runIgnored,
1010
[int] $jobs = [System.Environment]::ProcessorCount
1111
)
@@ -62,21 +62,27 @@ function GenerateRunSettings([String] $framework, [String] $platform, [String] $
6262
[System.Xml.XmlDocument]$doc = New-Object System.Xml.XmlDocument
6363

6464
# <RunSettings>
65+
# <RunConfiguration>
66+
# <TargetPlatform>x64</TargetPlatform>
67+
# </RunConfiguration>
6568
# <TestRunParameters>
6669
# <Parameter name="FRAMEWORK" value="net462" />
70+
# <Parameter name="CONFIGURATION" value="Release" />
6771
# </TestRunParameters>
6872
# </RunSettings>
6973

7074
$dec = $doc.CreateXmlDeclaration("1.0","UTF-8",$null)
7175
$doc.AppendChild($dec) | Out-Null
7276

7377
$runSettings = $doc.CreateElement("RunSettings")
74-
78+
7579
$runConfiguration = $doc.CreateElement("RunConfiguration")
7680
$runSettings.AppendChild($runConfiguration) | Out-Null
77-
$targetPlatform = $doc.CreateElement("TargetPlatform")
78-
$targetPlatform.InnerText = $platform
79-
$runConfiguration.AppendChild($targetPlatform) | Out-Null
81+
if ($platform) {
82+
$targetPlatform = $doc.CreateElement("TargetPlatform")
83+
$targetPlatform.InnerText = $platform
84+
$runConfiguration.AppendChild($targetPlatform) | Out-Null
85+
}
8086

8187
$testRunParameters = $doc.CreateElement("TestRunParameters")
8288
$runSettings.AppendChild($testRunParameters) | Out-Null

0 commit comments

Comments
 (0)