Skip to content

Commit bbdeb4c

Browse files
[release/7.0] Fix test issues on armv6, ppc64le on runtime-community (#75367)
* Fix test issues on armv6, s390x, ppc64le on runtime-community * Remove s390x Active issue, it will be fixed by another backport Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
1 parent cd483c1 commit bbdeb4c

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-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
@@ -60,7 +60,9 @@ public static partial class PlatformDetection
6060
public static bool IsNotArm64Process => !IsArm64Process;
6161
public static bool IsArmOrArm64Process => IsArmProcess || IsArm64Process;
6262
public static bool IsNotArmNorArm64Process => !IsArmOrArm64Process;
63+
public static bool IsS390xProcess => (int)RuntimeInformation.ProcessArchitecture == 5; // Architecture.S390x
6364
public static bool IsArmv6Process => (int)RuntimeInformation.ProcessArchitecture == 7; // Architecture.Armv6
65+
public static bool IsPpc64leProcess => (int)RuntimeInformation.ProcessArchitecture == 8; // Architecture.Ppc64le
6466
public static bool IsX64Process => RuntimeInformation.ProcessArchitecture == Architecture.X64;
6567
public static bool IsX86Process => RuntimeInformation.ProcessArchitecture == Architecture.X86;
6668
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)

0 commit comments

Comments
 (0)