From ef1ae202c02050ff37df762e4e3da32acfa99ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Tue, 21 Jul 2020 13:36:06 +0200 Subject: [PATCH] WASM: Enable System.Reflection tests Disable tests that won't work on browser. --- eng/testing/tests.mobile.targets | 8 ++++++++ .../tests/PortableExecutable/PEBuilderTests.cs | 3 +++ src/libraries/System.Reflection/tests/AssemblyTests.cs | 7 +++++-- .../System.Reflection/tests/CoreCLR/AssemblyTests.cs | 1 + src/libraries/tests.proj | 3 --- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 70887c7ac77f6f..5622b19e249bdc 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -147,11 +147,19 @@ + + + + + + + + GetBlobRanges(BlobBuilder builder, IEnumerabl } [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // System.Security.Cryptography isn't supported on browser public void Checksum() { Assert.True(TestChecksumAndAuthenticodeSignature(new MemoryStream(Misc.Signed), Misc.KeyPair)); @@ -661,6 +663,7 @@ public void Checksum() } [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // System.Security.Cryptography isn't supported on browser public void ChecksumFXAssemblies() { var paths = new[] diff --git a/src/libraries/System.Reflection/tests/AssemblyTests.cs b/src/libraries/System.Reflection/tests/AssemblyTests.cs index a244bbb4222484..e4033244fd9b90 100644 --- a/src/libraries/System.Reflection/tests/AssemblyTests.cs +++ b/src/libraries/System.Reflection/tests/AssemblyTests.cs @@ -142,6 +142,7 @@ public void ExportedTypes(Type type, bool expected) } [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // entry assembly won't be xunit.console on browser public void GetEntryAssembly() { Assert.NotNull(Assembly.GetEntryAssembly()); @@ -157,7 +158,8 @@ public void GetFile() AssertExtensions.Throws(null, () => typeof(AssemblyTests).Assembly.GetFile("")); Assert.Null(typeof(AssemblyTests).Assembly.GetFile("NonExistentfile.dll")); Assert.NotNull(typeof(AssemblyTests).Assembly.GetFile("System.Reflection.Tests.dll")); - Assert.Equal(typeof(AssemblyTests).Assembly.GetFile("System.Reflection.Tests.dll").Name, typeof(AssemblyTests).Assembly.Location); + if (PlatformDetection.IsNotBrowser) // see https://github.com/dotnet/runtime/issues/39650 + Assert.Equal(typeof(AssemblyTests).Assembly.GetFile("System.Reflection.Tests.dll").Name, typeof(AssemblyTests).Assembly.Location); } [Fact] @@ -165,7 +167,8 @@ public void GetFiles() { Assert.NotNull(typeof(AssemblyTests).Assembly.GetFiles()); Assert.Equal(1, typeof(AssemblyTests).Assembly.GetFiles().Length); - Assert.Equal(typeof(AssemblyTests).Assembly.GetFiles()[0].Name, typeof(AssemblyTests).Assembly.Location); + if (PlatformDetection.IsNotBrowser) // see https://github.com/dotnet/runtime/issues/39650 + Assert.Equal(typeof(AssemblyTests).Assembly.GetFiles()[0].Name, typeof(AssemblyTests).Assembly.Location); } public static IEnumerable GetHashCode_TestData() diff --git a/src/libraries/System.Reflection/tests/CoreCLR/AssemblyTests.cs b/src/libraries/System.Reflection/tests/CoreCLR/AssemblyTests.cs index d75ba5a0ceb21c..544fc17414aa8d 100644 --- a/src/libraries/System.Reflection/tests/CoreCLR/AssemblyTests.cs +++ b/src/libraries/System.Reflection/tests/CoreCLR/AssemblyTests.cs @@ -11,6 +11,7 @@ namespace System.Reflection.Tests public class AssemblyTests { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39650", TestPlatforms.Browser)] public void CurrentLocation_HasLocaton() { string location = GetExecutingAssembly().Location; diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 4ea05eaec8c961..d069428ca23dfe 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -41,9 +41,6 @@ - - -