Skip to content

Commit

Permalink
Autodetect processor architecture used for tests (#1837)
Browse files Browse the repository at this point in the history
* Autodetect processor architecture used for tests

* Use dotnet runner autodetect mechanism
  • Loading branch information
BCSharp authored Dec 11, 2024
1 parent bde56ce commit 517c548
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Param(
[String] $target = "build",
[String] $configuration = "Release",
[String[]] $frameworks=@('net462','netcoreapp3.1','net6.0','net8.0'),
[String] $platform = "x64",
[String] $platform = $null, # auto-detect
[switch] $runIgnored,
[int] $jobs = [System.Environment]::ProcessorCount
)
Expand Down Expand Up @@ -62,21 +62,27 @@ function GenerateRunSettings([String] $framework, [String] $platform, [String] $
[System.Xml.XmlDocument]$doc = New-Object System.Xml.XmlDocument

# <RunSettings>
# <RunConfiguration>
# <TargetPlatform>x64</TargetPlatform>
# </RunConfiguration>
# <TestRunParameters>
# <Parameter name="FRAMEWORK" value="net462" />
# <Parameter name="CONFIGURATION" value="Release" />
# </TestRunParameters>
# </RunSettings>

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

$runSettings = $doc.CreateElement("RunSettings")

$runConfiguration = $doc.CreateElement("RunConfiguration")
$runSettings.AppendChild($runConfiguration) | Out-Null
$targetPlatform = $doc.CreateElement("TargetPlatform")
$targetPlatform.InnerText = $platform
$runConfiguration.AppendChild($targetPlatform) | Out-Null
if ($platform) {
$targetPlatform = $doc.CreateElement("TargetPlatform")
$targetPlatform.InnerText = $platform
$runConfiguration.AppendChild($targetPlatform) | Out-Null
}

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

0 comments on commit 517c548

Please sign in to comment.