Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public class DefaultTestHostManager : ITestRuntimeProvider2
private readonly IProcessHelper _processHelper;
private readonly IFileHelper _fileHelper;
private readonly IEnvironment _environment;
private readonly IDotnetHostHelper _dotnetHostHelper;
private readonly IEnvironmentVariableHelper _environmentVariableHelper;
private bool _disableAppDomain;
private Architecture _architecture;
Expand All @@ -78,7 +77,6 @@ public DefaultTestHostManager()
: this(
new ProcessHelper(),
new FileHelper(),
new DotnetHostHelper(),
new PlatformEnvironment(),
new EnvironmentVariableHelper())
{
Expand All @@ -91,17 +89,14 @@ public DefaultTestHostManager()
/// <param name="fileHelper">File helper instance.</param>
/// <param name="environment">Instance of platform environment.</param>
/// <param name="environmentVariableHelper">The environment helper.</param>
/// <param name="dotnetHostHelper">Instance of dotnet host helper.</param>
internal DefaultTestHostManager(
IProcessHelper processHelper,
IFileHelper fileHelper,
IDotnetHostHelper dotnetHostHelper,
IEnvironment environment,
IEnvironmentVariableHelper environmentVariableHelper)
{
_processHelper = processHelper;
_fileHelper = fileHelper;
_dotnetHostHelper = dotnetHostHelper;
_environment = environment;
_environmentVariableHelper = environmentVariableHelper;
}
Expand Down Expand Up @@ -210,28 +205,26 @@ public virtual TestProcessStartInfo GetTestHostProcessStartInfo(

EqtTrace.Verbose("DefaultTestHostmanager.GetTestHostProcessStartInfo: Trying to use {0} from {1}", originalTestHostProcessName, testhostProcessPath);

// .NET Framework tests run through testhost.exe, which can only run on Windows.
// Running them on other operating systems previously relied on Mono, which is no
// longer supported. Fail with a clear message instead of launching Mono.
if (!_environment.OperatingSystem.Equals(PlatformOperatingSystem.Windows))
{
throw new TestPlatformException(Resources.NetFrameworkTestsNotSupportedOnNonWindows);
}

var launcherPath = testhostProcessPath;
var processName = _processHelper.GetCurrentProcessFileName();
if (processName is not null)
{
if (!_environment.OperatingSystem.Equals(PlatformOperatingSystem.Windows)
&& !processName.EndsWith(DotnetHostHelper.MONOEXENAME, StringComparison.OrdinalIgnoreCase))
{
launcherPath = _dotnetHostHelper.GetMonoPath();
argumentsString = testhostProcessPath.AddDoubleQuote() + " " + argumentsString;
}
else
// Patching the relative path for IDE scenarios.
if (!(processName.EndsWith("dotnet", StringComparison.OrdinalIgnoreCase)
|| processName.EndsWith("dotnet.exe", StringComparison.OrdinalIgnoreCase))
&& !File.Exists(testhostProcessPath))
{
// Patching the relative path for IDE scenarios.
if (_environment.OperatingSystem.Equals(PlatformOperatingSystem.Windows)
&& !(processName.EndsWith("dotnet", StringComparison.OrdinalIgnoreCase)
|| processName.EndsWith("dotnet.exe", StringComparison.OrdinalIgnoreCase))
&& !File.Exists(testhostProcessPath))
{
testhostProcessPath = Path.Combine(currentWorkingDirectory, "..", originalTestHostProcessName);
EqtTrace.Verbose("DefaultTestHostmanager.GetTestHostProcessStartInfo: Could not find {0} in previous location, now using {1}", originalTestHostProcessName, testhostProcessPath);
launcherPath = testhostProcessPath;
}
testhostProcessPath = Path.Combine(currentWorkingDirectory, "..", originalTestHostProcessName);
EqtTrace.Verbose("DefaultTestHostmanager.GetTestHostProcessStartInfo: Could not find {0} in previous location, now using {1}", originalTestHostProcessName, testhostProcessPath);
launcherPath = testhostProcessPath;
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,9 @@ The specified framework can be found at:
</value>
<comment>'{0}' is the placeholder for 'dotnet.exe' or 'dotnet' value and depends on platform Windows/Unix, '{1}' is the placeholder for the architeture name like ARM64, X64 etc...</comment>
</data>
<data name="NetFrameworkTestsNotSupportedOnNonWindows" xml:space="preserve">
<value>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Ověřte, že:
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">Nejde najít {0}. Ujistěte se, že testovací projekt má odkaz na balíček nuget Microsoft.NET.Test.Sdk.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Bestätigen Sie, dass:
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">"{0}" wurde nicht gefunden. Stellen Sie sicher, dass das Testprojekt einen NuGet-Verweis des Pakets "Microsoft.NET.Test.Sdk" aufweist.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Compruebe que:
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">No se encuentra {0}. Asegúrese de que el proyecto de prueba tenga una referencia NuGet del paquete "Microsoft.NET.Test.Sdk".</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Vérifiez ce qui suit :
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">{0} est introuvable. Vérifiez que le projet de test a une référence nuget du package "Microsoft.NET.Test.Sdk".</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Verificare che:
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">Non è possibile trovare {0}. Assicurarsi che il progetto di test includa un riferimento NuGet del pacchetto "Microsoft.NET.Test.Sdk".</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Verify that:
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">{0} を見つけることができません。テスト プロジェクトにパッケージ "Microsoft.NET.Test.Sdk" の NuGet 参照があることを確認してください。</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Verify that:
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">{0}을(를) 찾을 수 없습니다. 테스트 프로젝트에 "Microsoft.NET.Test.Sdk" 패키지의 nuget 참조가 포함되어 있는지 확인하세요.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Sprawdź, czy:
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">Nie można znaleźć elementu {0}. Upewnij się, że projekt testowy ma odwołanie nuget do pakietu „Microsoft.NET.Test.Sdk”.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Verifique se:
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">Não foi possível localizar {0}. Certifique-se de que o projeto de teste tem uma referência nuget do pacote "Microsoft.NET.Test.Sdk".</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Verify that:
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">Не удается найти {0}. Убедитесь, что в тестовом проекте есть ссылка NuGet на пакет "Microsoft.NET.Test.Sdk".</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Verify that:
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">{0} bulunamıyor. Test projesinin "Microsoft.NET.Test.Sdk" paketinde nuget başvurusu olduğundan emin olun.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Verify that:
{0}</target>
<note />
</trans-unit>
<trans-unit id="NetFrameworkTestsNotSupportedOnNonWindows">
<source>Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</source>
<target state="new">Running .NET Framework tests is supported on Windows only.

Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework.</target>
<note />
</trans-unit>
<trans-unit id="UnableToFindDepsFile">
<source>Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk".</source>
<target state="translated">无法找到 {0}。确保测试项目具有包 "Microsoft.NET.Test.Sdk" 的 nuget 引用。</target>
Expand Down
Loading
Loading