未验证 提交 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() {
$tf = "netcoreapp2.0"
$logDir = Join-Path $unitDir "xUnitResults"
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 = @()
$allGood = $true
......
......@@ -20,11 +20,11 @@ xunit_console_version="$(get_package_version dotnet-xunit)"
if [[ "${runtime}" == "dotnet" ]]; then
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
source ${root_path}/build/scripts/obtain_mono.sh
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
echo "Unknown runtime: ${runtime}"
exit 1
......
......@@ -84,9 +84,10 @@ private static IEnumerable<string> GetReferences()
string workingDirectory = null)
{
var io = new TestConsoleIO(input);
var clientDir = Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(CommandLineRunnerTests)));
var buildPaths = new BuildPaths(
clientDir: AppContext.BaseDirectory,
workingDir: workingDirectory ?? AppContext.BaseDirectory,
clientDir: clientDir,
workingDir: workingDirectory ?? clientDir,
sdkDir: null,
tempDir: Path.GetTempPath());
......
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using Roslyn.Test.Utilities;
......@@ -48,6 +49,20 @@ internal static AnalyzerAssemblyLoader CreateAnalyzerAssemblyLoader()
return new DesktopAnalyzerAssemblyLoader();
#else
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
}
}
......
......@@ -24,14 +24,14 @@ private static string GetIlasmPath()
if (CoreClrShim.AssemblyLoadContext.Type == null)
{
return Path.Combine(
Path.GetDirectoryName(CorLightup.Desktop.GetAssemblyLocation(typeof(object).GetTypeInfo().Assembly)),
Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(object))),
"ilasm.exe");
}
else
{
var ilasmExeName = PlatformInformation.IsWindows ? "ilasm.exe" : "ilasm";
var directory = AppContext.BaseDirectory;
var directory = Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(RuntimeUtilities)));
string path = null;
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.
先完成此消息的编辑!
想要评论请 注册