未验证 提交 da3b3660 编写于 作者: J Jared Parsons 提交者: GitHub

Merge pull request #24611 from jaredpar/fix-xunit

Move to xunit.console for CoreClr tests
...@@ -393,7 +393,7 @@ function Test-XUnitCoreClr() { ...@@ -393,7 +393,7 @@ function Test-XUnitCoreClr() {
$tf = "netcoreapp2.0" $tf = "netcoreapp2.0"
$logDir = Join-Path $unitDir "xUnitResults" $logDir = Join-Path $unitDir "xUnitResults"
Create-Directory $logDir Create-Directory $logDir
$xunitConsole = Join-Path (Get-PackageDir "dotnet-xunit") "tools\$tf\xunit.console.dll" $xunitConsole = Join-Path (Get-PackageDir "xunit.runner.console") "tools\$tf\xunit.console.dll"
$dlls = @() $dlls = @()
$allGood = $true $allGood = $true
......
...@@ -20,11 +20,11 @@ xunit_console_version="$(get_package_version dotnet-xunit)" ...@@ -20,11 +20,11 @@ xunit_console_version="$(get_package_version dotnet-xunit)"
if [[ "${runtime}" == "dotnet" ]]; then if [[ "${runtime}" == "dotnet" ]]; then
target_framework=netcoreapp2.0 target_framework=netcoreapp2.0
xunit_console="${nuget_dir}"/dotnet-xunit/"${xunit_console_version}"/tools/${target_framework}/xunit.console.dll xunit_console="${nuget_dir}"/xunit.runner.console/"${xunit_console_version}"/tools/${target_framework}/xunit.console.dll
elif [[ "${runtime}" == "mono" ]]; then elif [[ "${runtime}" == "mono" ]]; then
source ${root_path}/build/scripts/obtain_mono.sh source ${root_path}/build/scripts/obtain_mono.sh
target_framework=net461 target_framework=net461
xunit_console="${nuget_dir}"/dotnet-xunit/"${xunit_console_version}"/tools/net452/xunit.console.exe xunit_console="${nuget_dir}"/xunit.runner.console/"${xunit_console_version}"/tools/net452/xunit.console.exe
else else
echo "Unknown runtime: ${runtime}" echo "Unknown runtime: ${runtime}"
exit 1 exit 1
......
...@@ -84,9 +84,10 @@ private static IEnumerable<string> GetReferences() ...@@ -84,9 +84,10 @@ private static IEnumerable<string> GetReferences()
string workingDirectory = null) string workingDirectory = null)
{ {
var io = new TestConsoleIO(input); var io = new TestConsoleIO(input);
var clientDir = Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(CommandLineRunnerTests)));
var buildPaths = new BuildPaths( var buildPaths = new BuildPaths(
clientDir: AppContext.BaseDirectory, clientDir: clientDir,
workingDir: workingDirectory ?? AppContext.BaseDirectory, workingDir: workingDirectory ?? clientDir,
sdkDir: null, sdkDir: null,
tempDir: Path.GetTempPath()); tempDir: Path.GetTempPath());
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using Roslyn.Test.Utilities; using Roslyn.Test.Utilities;
...@@ -48,6 +49,20 @@ internal static AnalyzerAssemblyLoader CreateAnalyzerAssemblyLoader() ...@@ -48,6 +49,20 @@ internal static AnalyzerAssemblyLoader CreateAnalyzerAssemblyLoader()
return new DesktopAnalyzerAssemblyLoader(); return new DesktopAnalyzerAssemblyLoader();
#else #else
return new ThrowingAnalyzerAssemblyLoader(); return new ThrowingAnalyzerAssemblyLoader();
#endif
}
/// <summary>
/// Get the location of the assembly that contains this type
/// </summary>
internal static string GetAssemblyLocation(Type type)
{
#if NET461 || NET46 || NETCOREAPP2_0
return type.GetTypeInfo().Assembly.Location;
#elif NETSTANDARD1_3
throw new NotSupportedException();
#else
#error Unsupported configuration
#endif #endif
} }
} }
......
...@@ -24,14 +24,14 @@ private static string GetIlasmPath() ...@@ -24,14 +24,14 @@ private static string GetIlasmPath()
if (CoreClrShim.AssemblyLoadContext.Type == null) if (CoreClrShim.AssemblyLoadContext.Type == null)
{ {
return Path.Combine( return Path.Combine(
Path.GetDirectoryName(CorLightup.Desktop.GetAssemblyLocation(typeof(object).GetTypeInfo().Assembly)), Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(object))),
"ilasm.exe"); "ilasm.exe");
} }
else else
{ {
var ilasmExeName = PlatformInformation.IsWindows ? "ilasm.exe" : "ilasm"; var ilasmExeName = PlatformInformation.IsWindows ? "ilasm.exe" : "ilasm";
var directory = AppContext.BaseDirectory; var directory = Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(RuntimeUtilities)));
string path = null; string path = null;
while (directory != null && !File.Exists(path = Path.Combine(directory, "Binaries", "Tools", "ILAsm", ilasmExeName))) while (directory != null && !File.Exists(path = Path.Combine(directory, "Binaries", "Tools", "ILAsm", ilasmExeName)))
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册