提交 517114f7 编写于 作者: J Jared Parsons

Fix CoreClr Windows tests

上级 2d138a8d
......@@ -7,6 +7,7 @@
<CommandLineParserVersion>2.0.273-beta</CommandLineParserVersion>
<EnvDTEVersion>8.0.1</EnvDTEVersion>
<EnvDTE80Version>8.0.0</EnvDTE80Version>
<dotnetxunitVersion>2.3.0-beta4-build3742</dotnetxunitVersion>
<FakeSignVersion>0.9.2</FakeSignVersion>
<GitLinkVersion>3.0.0</GitLinkVersion>
<LibGit2SharpVersion>0.22.0</LibGit2SharpVersion>
......@@ -228,6 +229,7 @@
<xunitVersion>2.2.0</xunitVersion>
<xunitanalyzersVersion>0.5.0</xunitanalyzersVersion>
<xunitassertVersion>2.2.0</xunitassertVersion>
<xunitextensibilityexecution>2.2.0</xunitextensibilityexecution>
<xunitrunnerconsoleVersion>2.2.0</xunitrunnerconsoleVersion>
<xunitrunnervisualstudioVersion>2.2.0</xunitrunnervisualstudioVersion>
<xunitrunnerwpfVersion>1.0.41</xunitrunnerwpfVersion>
......
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(MSBuildThisFileDirectory)..\Targets\Packages.props" />
<Import Project="$(MSBuildThisFileDirectory)..\Targets\FixedPackages.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="dotnet-xunit" Version="$(dotnetxunitVersion)" />
</ItemGroup>
</Project>
......@@ -248,6 +248,7 @@ function Create-Directory([string]$dir) {
# Return the version of the NuGet package as used in this repo
function Get-PackageVersion([string]$name) {
$name = $name.Replace(".", "")
$name = $name.Replace("-", "")
$deps = Join-Path $repoDir "build\Targets\Packages.props"
$nodeName = "$($name)Version"
$x = [xml](Get-Content -raw $deps)
......@@ -418,6 +419,7 @@ function Restore-Packages([string]$msbuildDir = "", [string]$project = "") {
else {
$all = @(
"Base Toolset:build\ToolsetPackages\BaseToolset.csproj",
"CoreClr Toolset:build\ToolsetPackages\CoreToolset.csproj",
"Roslyn:Roslyn.sln",
"Samples:src\Samples\Samples.sln",
"Templates:src\Setup\Templates\Templates.sln",
......
......@@ -292,8 +292,8 @@ function Test-XUnitCoreClr() {
$runtimeIdentifier = "win7-x64"
$tf = "netcoreapp2.0"
$logDir = Join-Path $unitDir "xUnitResults"
$logFile = Join-Path $logDir "TestResults.xml"
Create-Directory $logDir
$xunitConsole = Join-Path (Get-PackageDir "dotnet-xunit") "tools\$tf\xunit.console.dll"
# A number of our tests need to be published before they can be executed in order to get some
# runtime assets.
......@@ -321,9 +321,16 @@ function Test-XUnitCoreClr() {
$dllName = Get-ChildItem -name "*.UnitTests.dll" -path $testDir
$dllPath = Join-Path $testDir $dllName
$args = "exec"
$args += " --depsfile " + [IO.Path]::ChangeExtension($dllPath, ".deps.json")
$args += " --runtimeconfig " + [IO.Path]::ChangeExtension($dllPath, ".runtimeconfig.json")
$args += " $xunitConsole"
$args += " $dllPath"
$args += " -xml " + (Join-Path $logDir ([IO.Path]::ChangeExtension($dllName, ".xml")))
try {
Write-Host "Running $dllName"
Exec-Console $dotnet "vstest $dllPath"
Exec-Console $dotnet $args
}
catch {
Write-Host "Failed"
......
......@@ -217,7 +217,7 @@ private bool CheckPackageReferences(TextWriter textWriter)
var allGood = true;
foreach (var packageRef in _projectUtil.GetPackageReferences())
{
var name = packageRef.Name.Replace(".", "");
var name = packageRef.Name.Replace(".", "").Replace("-", "");
var floatingName = $"$({name}Version)";
var fixedName = $"$({name}FixedVersion)";
if (packageRef.Version != floatingName && packageRef.Version != fixedName)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册