Skip to content

Commit a1a1ded

Browse files
authored
Fix test issues on armv6, s390x, ppc64le on runtime-community (#75282)
The VerifyArchitecture test wasn't handling armv6 process running on arm64, only armv7. Also disabled tests that are failing on s390x/ppc64le with ActiveIssue.
1 parent f591e98 commit a1a1ded

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ public static partial class PlatformDetection
6161
public static bool IsNotArm64Process => !IsArm64Process;
6262
public static bool IsArmOrArm64Process => IsArmProcess || IsArm64Process;
6363
public static bool IsNotArmNorArm64Process => !IsArmOrArm64Process;
64+
public static bool IsS390xProcess => (int)RuntimeInformation.ProcessArchitecture == 5; // Architecture.S390x
6465
public static bool IsArmv6Process => (int)RuntimeInformation.ProcessArchitecture == 7; // Architecture.Armv6
66+
public static bool IsPpc64leProcess => (int)RuntimeInformation.ProcessArchitecture == 8; // Architecture.Ppc64le
6567
public static bool IsX64Process => RuntimeInformation.ProcessArchitecture == Architecture.X64;
6668
public static bool IsX86Process => RuntimeInformation.ProcessArchitecture == Architecture.X86;
6769
public static bool IsNotX86Process => !IsX86Process;

src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/CheckArchitectureTests.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,15 @@ public void VerifyArchitecture()
2929
break;
3030

3131
case Architecture.Arm64:
32-
Assert.Equal(IntPtr.Size == 4 ? Architecture.Arm : Architecture.Arm64, processArch);
32+
if (IntPtr.Size == 8)
33+
{
34+
Assert.Equal(Architecture.Arm64, processArch);
35+
}
36+
else
37+
{
38+
// armv7/armv6 process running on arm64 host
39+
Assert.True(processArch == Architecture.Arm || processArch == Architecture.Armv6, $"Unexpected process architecture: {processArch}");
40+
}
3341
break;
3442

3543
case Architecture.Wasm:

src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public partial class BinaryFormatterTests : FileCleanupTestBase
2525
[ConditionalTheory(typeof(Environment), nameof(Environment.Is64BitProcess))]
2626
[SkipOnCoreClr("Long running tests: https://github.com/dotnet/runtime/issues/11191", ~RuntimeConfiguration.Release)]
2727
[ActiveIssue("https://github.com/dotnet/runtime/issues/35915", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))]
28+
[ActiveIssue("https://github.com/dotnet/runtime/issues/75281", typeof(PlatformDetection), nameof(PlatformDetection.IsPpc64leProcess))]
2829
[InlineData(2 * 6_584_983 - 2)] // previous limit
2930
[InlineData(2 * 7_199_369 - 2)] // last pre-computed prime number
3031
public void SerializeHugeObjectGraphs(int limit)

src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryReaderTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ public static void ReadStringTest()
165165
}
166166

167167
[Fact]
168+
[ActiveIssue("https://github.com/dotnet/runtime/issues/74494", typeof(PlatformDetection), nameof(PlatformDetection.IsS390xProcess))]
168169
public static void BinaryXml_ReadPrimitiveTypes()
169170
{
170171
float f = 1.23456788f;
@@ -202,6 +203,7 @@ public static void BinaryXml_ReadPrimitiveTypes()
202203
}
203204

204205
[Fact]
206+
[ActiveIssue("https://github.com/dotnet/runtime/issues/74494", typeof(PlatformDetection), nameof(PlatformDetection.IsS390xProcess))]
205207
public static void BinaryXml_Array_RoundTrip()
206208
{
207209
int[] ints = new int[] { -1, 0x01020304, 0x11223344, -1 };

0 commit comments

Comments
 (0)