Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip tests on Mono #75160

Merged
merged 17 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Compilers/Core/Portable/CodeGen/BasicBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ protected BasicBlock()

internal BasicBlock(ILBuilder builder)
{
Debug.Assert(BitConverter.IsLittleEndian);
Initialize(builder);
}

Expand Down
2 changes: 0 additions & 2 deletions src/Compilers/Core/Portable/CodeGen/ILBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ internal sealed partial class ILBuilder

internal ILBuilder(ITokenDeferral module, LocalSlotManager localSlotManager, OptimizationLevel optimizations, bool areLocalsZeroed)
{
Debug.Assert(BitConverter.IsLittleEndian);

this.module = module;
this.LocalSlotManager = localSlotManager;
_emitState = default(EmitState);
Expand Down
2 changes: 0 additions & 2 deletions src/Compilers/Core/Portable/ConstantValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,6 @@ public static ConstantValue CreateSizeOf(SpecialType st)

public static ConstantValue Create(object value, ConstantValueTypeDiscriminator discriminator)
{
Debug.Assert(BitConverter.IsLittleEndian);

switch (discriminator)
{
case ConstantValueTypeDiscriminator.Null: return Null;
Expand Down
9 changes: 9 additions & 0 deletions src/Compilers/Test/Core/Assert/ConditionalFactAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ public static class ExecutionConditionUtil
public static bool IsLinux => RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
public static bool IsDesktop => RuntimeUtilities.IsDesktopRuntime;
public static bool IsWindowsDesktop => IsWindows && IsDesktop;
// IsMonoDesktop means https://github.com/mono/mono
public static bool IsMonoDesktop => Type.GetType("Mono.Runtime") != null;
public static bool IsMono => MonoHelpers.IsRunningOnMono();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this property or change the logic to be IsMonoDesktop || IsMonoCore?

Copy link
Member

@jjonescz jjonescz Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Separate PR or filing an issue here is fine as well.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to remove as part of new PR.

// IsMonoCore means https://github.com/dotnet/runtime/tree/main/src/mono
public static bool IsMonoCore => Type.GetType("Mono.RuntimeStructs") != null;
public static bool IsCoreClr => !IsDesktop;
public static bool IsCoreClrUnix => IsCoreClr && IsUnix;
public static bool IsMonoOrCoreClr => IsMono || IsCoreClr;
Expand Down Expand Up @@ -332,6 +335,12 @@ public class ClrOnly : ExecutionCondition
public override string SkipReason => "Test not supported on Mono";
}

public class NotOnMonoCore : ExecutionCondition
{
public override bool ShouldSkip => MonoHelpers.IsRunningOnMonoCore();
public override string SkipReason => "Test not supported on Mono Core";
}

public class CoreClrOnly : ExecutionCondition
{
public override bool ShouldSkip => !ExecutionConditionUtil.IsCoreClr;
Expand Down
1 change: 1 addition & 0 deletions src/Compilers/Test/Core/FX/MonoHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ namespace Microsoft.CodeAnalysis.Test.Utilities
public static class MonoHelpers
{
public static bool IsRunningOnMono() => Roslyn.Test.Utilities.ExecutionConditionUtil.IsMonoDesktop;
public static bool IsRunningOnMonoCore() => Roslyn.Test.Utilities.ExecutionConditionUtil.IsMonoCore;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2230,7 +2230,7 @@ End Class
diff2.VerifyIL("C.F", expectedIL.Replace("<<VALUE>>", "2"))
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub Capture_Local()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -2351,7 +2351,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub Capture_Parameter()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -2468,7 +2468,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub Capture_This()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -2576,7 +2576,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub CeaseCapture_Local()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -2651,7 +2651,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub CeaseCapture_LastLocal()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -2825,7 +2825,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub CeaseCapture_This()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -2940,7 +2940,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub AddingAndRemovingClosure()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -3065,7 +3065,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub ChainClosure()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -3235,7 +3235,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub UnchainClosure()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -3390,7 +3390,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub ChangeClosureParent()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -3626,7 +3626,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub ChangeLambdaParent()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -3791,7 +3791,7 @@ End Class
''' The value of the captured variable might be uninitialized in the lambda.
''' We leave it up to the user to set its value as needed.
''' </summary>
<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub UninitializedCapture()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -3871,8 +3871,7 @@ End Class
Verify()
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub CaptureOrdering()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub AsyncMethodOverloads()
Using New EditAndContinueTest(_logger).
AddBaseline(
Expand Down Expand Up @@ -1099,7 +1099,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub UpdateIterator_NoVariables()
Using New EditAndContinueTest().
AddBaseline(
Expand Down Expand Up @@ -1233,7 +1233,7 @@ End Class",
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub UpdateAsync_NoVariables()
Using New EditAndContinueTest().
AddBaseline(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub ModifyMethod_ParameterModifiers_RefOut()
Using New EditAndContinueTest().
AddBaseline(
Expand Down Expand Up @@ -1353,7 +1353,7 @@ BC37230: Cannot continue since the edit includes a reference to an embedded type
End Using
End Sub

<Fact, WorkItem(1175704, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1175704")>
<ConditionalFact(GetType(NotOnMonoCore)), WorkItem(1175704, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1175704")>
Public Sub EventFields()
Using New EditAndContinueTest().
AddBaseline(
Expand Down Expand Up @@ -1418,7 +1418,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
<WorkItem("https://github.com/dotnet/roslyn/issues/69834")>
Public Sub Event_Delete()
Using New EditAndContinueTest().
Expand Down Expand Up @@ -1570,7 +1570,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub Event_TypeChange()
Using New EditAndContinueTest().
AddBaseline(
Expand Down Expand Up @@ -2248,7 +2248,7 @@ End Module</file>
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
<WorkItem("https://github.com/dotnet/roslyn/issues/69834")>
Public Sub Property_TypeChange()
Using New EditAndContinueTest().
Expand Down Expand Up @@ -2465,7 +2465,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub Property_Delete()
Using New EditAndContinueTest().
AddBaseline(
Expand Down Expand Up @@ -2591,7 +2591,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub Property_DeleteGetter()
Using New EditAndContinueTest().
AddBaseline(
Expand Down Expand Up @@ -4635,7 +4635,7 @@ End Class
''' <summary>
''' Local slots must be preserved based on signature.
''' </summary>
<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub PreserveLocalSlotsImplicitNamedArgXml()
Dim source = "
Option Explicit Off
Expand Down Expand Up @@ -5912,7 +5912,7 @@ End Module

#End Region

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub Lambda_Delete()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -6030,7 +6030,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub Method_Delete_WithLambda()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -6255,7 +6255,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub Method_Delete_WithLambda_AddedMethod()
Using test = New EditAndContinueTest()
test.AddBaseline(
Expand Down Expand Up @@ -6369,7 +6369,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
Public Sub Method_Delete_WithLambda_MultipleGenerations()
Dim common = "
Imports System
Expand Down Expand Up @@ -7434,7 +7434,7 @@ End Class",
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
<WorkItem("https://github.com/dotnet/roslyn/issues/69480")>
Public Sub PrivateImplDetails_DataFields_Arrays()
Using New EditAndContinueTest().
Expand Down Expand Up @@ -7534,7 +7534,7 @@ End Class
End Using
End Sub

<Fact>
<ConditionalFact(GetType(NotOnMonoCore))>
<WorkItem("https://github.com/dotnet/roslyn/issues/69480")>
Public Sub PrivateImplDetails_ComputeStringHash()
Using New EditAndContinueTest().
Expand Down