Skip to content

Commit c02ece8

Browse files
nohwndGiridhar TrivedigiritrivediSapana-Khemkar
authored
[rel/17.4] Fix Invalid target architecture 'S390x' error (#4079)
Co-authored-by: Giridhar Trivedi <giridhar.trivedi@ibm.com> Co-authored-by: Giridhar Trivedi <giritrivedi@gmail.com> Co-authored-by: Sapana-Khemkar <94051076+Sapana-Khemkar@users.noreply.github.com>
1 parent f760ea3 commit c02ece8

File tree

10 files changed

+18
-3
lines changed

10 files changed

+18
-3
lines changed

src/Microsoft.TestPlatform.ObjectModel/Architecture.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ public enum Architecture
1111
ARM,
1212
AnyCPU,
1313
ARM64,
14-
S390x
14+
S390x,
15+
Ppc64le
1516
}

src/Microsoft.TestPlatform.ObjectModel/PublicAPI/PublicAPI.Shipped.txt

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.ARM = 3 -> Microsof
113113
Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.ARM64 = 5 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture
114114
Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.Default = 0 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture
115115
Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.S390x = 6 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture
116+
Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.Ppc64le = 7 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture
116117
Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.X64 = 2 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture
117118
Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.X86 = 1 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture
118119
Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet

src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/PlatformArchitecture.cs

+1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ public enum PlatformArchitecture
1313
ARM,
1414
ARM64,
1515
S390x,
16+
Ppc64le,
1617
}

src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/PublicAPI.Shipped.txt

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture
6767
Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.ARM = 2 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture
6868
Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.ARM64 = 3 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture
6969
Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.S390x = 4 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture
70+
Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.Ppc64le = 5 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture
7071
Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.X64 = 1 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture
7172
Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.X86 = 0 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture
7273
Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformAssemblyExtensions

src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/PlatformEnvironment.cs

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public PlatformArchitecture Architecture
2828
// preview 6 or later, so use the numerical value for now.
2929
// case System.Runtime.InteropServices.Architecture.S390x:
3030
(Architecture)5 => PlatformArchitecture.S390x,
31+
(Architecture)8 => PlatformArchitecture.Ppc64le,
3132
_ => throw new NotSupportedException(),
3233
};
3334
}

src/Microsoft.TestPlatform.PlatformAbstractions/netcore/System/ProcessHelper.cs

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public PlatformArchitecture GetCurrentProcessArchitecture()
4141
// preview 6 or later, so use the numerical value for now.
4242
// case System.Runtime.InteropServices.Architecture.S390x:
4343
(Architecture)5 => PlatformArchitecture.S390x,
44+
(Architecture)8 => PlatformArchitecture.Ppc64le,
4445
_ => throw new NotSupportedException(),
4546
};
4647
}

src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs

+1
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ private static string GetTestHostName(Architecture architecture, Framework targe
274274
PlatformArchitecture.ARM => Architecture.ARM,
275275
PlatformArchitecture.ARM64 => Architecture.ARM64,
276276
PlatformArchitecture.S390x => Architecture.S390x,
277+
PlatformArchitecture.Ppc64le => Architecture.Ppc64le,
277278
_ => throw new NotSupportedException(),
278279
};
279280

src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs

+6
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,10 @@ PlatformArchitecture TranslateToPlatformArchitecture(Architecture targetArchitec
536536
return PlatformArchitecture.ARM;
537537
case Architecture.ARM64:
538538
return PlatformArchitecture.ARM64;
539+
case Architecture.S390x:
540+
return PlatformArchitecture.S390x;
541+
case Architecture.Ppc64le:
542+
return PlatformArchitecture.Ppc64le;
539543
case Architecture.AnyCPU:
540544
case Architecture.Default:
541545
default:
@@ -552,6 +556,8 @@ static bool IsSameArchitecture(Architecture targetArchitecture, PlatformArchitec
552556
Architecture.X64 => platformAchitecture == PlatformArchitecture.X64,
553557
Architecture.ARM => platformAchitecture == PlatformArchitecture.ARM,
554558
Architecture.ARM64 => platformAchitecture == PlatformArchitecture.ARM64,
559+
Architecture.S390x => platformAchitecture == PlatformArchitecture.S390x,
560+
Architecture.Ppc64le => platformAchitecture == PlatformArchitecture.Ppc64le,
555561
_ => throw new TestPlatformException($"Invalid target architecture '{targetArchitecture}'"),
556562
};
557563

src/vstest.console/TestPlatformHelpers/TestRequestManager.cs

+2
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,8 @@ static Architecture TranslateToArchitecture(PlatformArchitecture targetArchitect
841841
return Architecture.ARM64;
842842
case PlatformArchitecture.S390x:
843843
return Architecture.S390x;
844+
case PlatformArchitecture.Ppc64le:
845+
return Architecture.Ppc64le;
844846
default:
845847
EqtTrace.Error($"TestRequestManager.TranslateToArchitecture: Unhandled architecture '{targetArchitecture}'.");
846848
break;

test/vstest.console.UnitTests/Processors/PlatformArgumentProcessorTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void InitializeShouldThrowIfArgumentIsNotAnArchitecture()
8585
{
8686
ExceptionUtilities.ThrowsException<CommandLineException>(
8787
() => _executor.Initialize("foo"),
88-
"Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x.",
88+
"Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, Ppc64le.",
8989
"foo");
9090
}
9191

@@ -94,7 +94,7 @@ public void InitializeShouldThrowIfArgumentIsNotASupportedArchitecture()
9494
{
9595
ExceptionUtilities.ThrowsException<CommandLineException>(
9696
() => _executor.Initialize("AnyCPU"),
97-
"Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x.",
97+
"Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, Ppc64le.",
9898
"AnyCPU");
9999
}
100100

0 commit comments

Comments
 (0)