From b0c094c52d9f915363f389367847ff5d838024b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Tue, 18 Jul 2023 16:36:34 +0200 Subject: [PATCH] Reenable a test on iOS/tvOS/Browser that was disabled The referenced ActiveIssue was closed but the test was still disabled, we can actually fix the test to make it work on all platforms. --- .../System.Reflection/tests/AssemblyTests.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Reflection/tests/AssemblyTests.cs b/src/libraries/System.Reflection/tests/AssemblyTests.cs index 3dded508fa7d1..a77bed580267e 100644 --- a/src/libraries/System.Reflection/tests/AssemblyTests.cs +++ b/src/libraries/System.Reflection/tests/AssemblyTests.cs @@ -145,8 +145,6 @@ public void ExportedTypes(Type type, bool expected) } [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "entry assembly won't be xunit.console on browser")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/36892", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst | TestPlatforms.Android)] public void GetEntryAssembly() { Assert.NotNull(Assembly.GetEntryAssembly()); @@ -158,6 +156,21 @@ public void GetEntryAssembly() // The single file test runner is not 'xunit.console'. correct = assembly.IndexOf("System.Reflection.Tests", StringComparison.OrdinalIgnoreCase) != -1; } + else if (PlatformDetection.IsiOS || PlatformDetection.IstvOS) + { + // The iOS/tvOS test runner is not 'xunit.console'. + correct = assembly.IndexOf("AppleTestRunner", StringComparison.OrdinalIgnoreCase) != -1; + } + else if (PlatformDetection.IsAndroid) + { + // The Android test runner is not 'xunit.console'. + correct = assembly.IndexOf("AndroidTestRunner", StringComparison.OrdinalIgnoreCase) != -1; + } + else if (PlatformDetection.IsBrowser) + { + // The browser test runner is not 'xunit.console'. + correct = assembly.IndexOf("WasmTestRunner", StringComparison.OrdinalIgnoreCase) != -1; + } else { // Under Visual Studio, the runner is 'testhost', otherwise it is 'xunit.console'. @@ -778,7 +791,7 @@ public void AssemblyLoadFromBytesNeg() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/36892", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Symbols are in a different location on iOS/tvOS/MacCatalyst")] public void AssemblyLoadFromBytesWithSymbols() { Assembly assembly = typeof(AssemblyTests).Assembly;