Skip to content

Commit 3c340c7

Browse files
committed
Add LoongArch64 support
1 parent c890b91 commit 3c340c7

File tree

10 files changed

+13
-1
lines changed

10 files changed

+13
-1
lines changed

src/Microsoft.TestPlatform.ObjectModel/Architecture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ public enum Architecture
1414
S390x,
1515
Ppc64le,
1616
RiscV64,
17+
LoongArch64,
1718
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,3 +975,4 @@ Microsoft.VisualStudio.TestPlatform.ObjectModel.RunConfiguration.CaptureStandard
975975
Microsoft.VisualStudio.TestPlatform.ObjectModel.RunConfiguration.ForwardStandardOutput.get -> bool
976976
Microsoft.VisualStudio.TestPlatform.ObjectModel.RunConfiguration.DisableSharedTestHost.get -> bool
977977
Microsoft.VisualStudio.TestPlatform.ObjectModel.RunConfiguration.SkipDefaultAdapters.get -> bool
978+
Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture.LoongArch64 = 9 -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ public enum PlatformArchitecture
1515
S390x,
1616
Ppc64le,
1717
RiscV64,
18+
LoongArch64,
1819
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,4 @@ static Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace.ErrorOnI
121121
static Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformAssemblyExtensions.GetAssemblyLocation(this System.Reflection.Assembly! assembly) -> string!
122122
virtual Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformAssemblyResolver.Dispose(bool disposing) -> void
123123
Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.RiscV64 = 6 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture
124+
Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture.LoongArch64 = 7 -> Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformArchitecture

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

Lines changed: 1 addition & 0 deletions
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)6 => PlatformArchitecture.LoongArch64,
3132
(Architecture)8 => PlatformArchitecture.Ppc64le,
3233
(Architecture)9 => PlatformArchitecture.RiscV64,
3334
_ => throw new NotSupportedException(),

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

Lines changed: 1 addition & 0 deletions
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)6 => PlatformArchitecture.LoongArch64,
4445
(Architecture)8 => PlatformArchitecture.Ppc64le,
4546
(Architecture)9 => PlatformArchitecture.RiscV64,
4647
_ => throw new NotSupportedException(),

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ private static string GetTestHostName(Architecture architecture, Framework targe
293293
PlatformArchitecture.S390x => Architecture.S390x,
294294
PlatformArchitecture.Ppc64le => Architecture.Ppc64le,
295295
PlatformArchitecture.RiscV64 => Architecture.RiscV64,
296+
PlatformArchitecture.LoongArch64 => Architecture.LoongArch64,
296297
_ => throw new NotSupportedException(),
297298
};
298299

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,8 @@ PlatformArchitecture TranslateToPlatformArchitecture(Architecture targetArchitec
648648
return PlatformArchitecture.Ppc64le;
649649
case Architecture.RiscV64:
650650
return PlatformArchitecture.RiscV64;
651+
case Architecture.LoongArch64:
652+
return PlatformArchitecture.LoongArch64;
651653
case Architecture.AnyCPU:
652654
case Architecture.Default:
653655
default:
@@ -667,6 +669,7 @@ static bool IsSameArchitecture(Architecture targetArchitecture, PlatformArchitec
667669
Architecture.S390x => platformAchitecture == PlatformArchitecture.S390x,
668670
Architecture.Ppc64le => platformAchitecture == PlatformArchitecture.Ppc64le,
669671
Architecture.RiscV64 => platformAchitecture == PlatformArchitecture.RiscV64,
672+
Architecture.LoongArch64 => platformAchitecture == PlatformArchitecture.LoongArch64,
670673
_ => throw new TestPlatformException($"Invalid target architecture '{targetArchitecture}'"),
671674
};
672675

src/vstest.console/TestPlatformHelpers/TestRequestManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,8 @@ static Architecture TranslateToArchitecture(PlatformArchitecture targetArchitect
888888
return Architecture.Ppc64le;
889889
case PlatformArchitecture.RiscV64:
890890
return Architecture.RiscV64;
891+
case PlatformArchitecture.LoongArch64:
892+
return Architecture.LoongArch64;
891893
default:
892894
EqtTrace.Error($"TestRequestManager.TranslateToArchitecture: Unhandled architecture '{targetArchitecture}'.");
893895
break;

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

Lines changed: 1 addition & 1 deletion
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, Ppc64le, RiscV64.",
88+
"Invalid platform type: {0}. Valid platform types are X86, X64, ARM, ARM64, S390x, Ppc64le, RiscV64, LoongArch64.",
8989
"foo");
9090
}
9191

0 commit comments

Comments
 (0)