Skip to content
Open
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
17 changes: 16 additions & 1 deletion src/tests/Common/XUnitWrapperGenerator/ITestInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,17 @@ public ConditionalTest(ITestInfo innerTest, string condition)

_innerTest = innerTest;
_condition = condition;
}
}

public ConditionalTest(ITestInfo innerTest, Xunit.TestPlatforms platform)
: this(innerTest, GetPlatformConditionFromTestPlatform(platform))
{
}

public ConditionalTest(ITestInfo innerTest, string condition, Xunit.TestPlatforms platform)
:this(innerTest, $"{(condition.Length == 0 ? "true" : condition)} && ({GetPlatformConditionFromTestPlatform(platform)})")
{
}

public string TestNameExpression { get; }
public string DisplayNameForFiltering { get; }
Expand Down Expand Up @@ -207,6 +212,16 @@ private static string GetPlatformConditionFromTestPlatform(Xunit.TestPlatforms p
{
List<string> platformCheckConditions = new();

if (platform == Xunit.TestPlatforms.Any)
{
return "false";
}

if (platform == 0)
{
return "true";
}

if (platform.HasFlag(Xunit.TestPlatforms.Windows))
{
platformCheckConditions.Add("global::System.OperatingSystem.IsWindows()");
Expand Down
22 changes: 9 additions & 13 deletions src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -847,9 +847,9 @@
continue;
}

Xunit.TestPlatforms skippedTestPlatforms = 0;
Xunit.RuntimeConfiguration skippedConfigurations = 0;
Xunit.RuntimeTestModes skippedTestModes = 0;
Xunit.TestPlatforms skippedTestPlatforms = Xunit.TestPlatforms.Any;
Xunit.RuntimeConfiguration skippedConfigurations = Xunit.RuntimeConfiguration.Any;
Xunit.RuntimeTestModes skippedTestModes = Xunit.RuntimeTestModes.Any;

for (int i = 1; i < filterAttribute.ConstructorArguments.Length; i++)
{
Expand All @@ -875,12 +875,13 @@
}
}

if (skippedTestModes == Xunit.RuntimeTestModes.Any)
if (skippedTestModes == Xunit.RuntimeTestModes.Any
&& skippedConfigurations == Xunit.RuntimeConfigurations.Any

Check failure on line 879 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build coreclr Common Pri0 Test Build AnyOS AnyCPU checked)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L879

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(879,53): error CS0234: The type or namespace name 'RuntimeConfigurations' does not exist in the namespace 'Xunit' (are you missing an assembly reference?) [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 879 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release AllSubsets_Mono_Minijit_RuntimeTests minijit)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L879

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(879,53): error CS0234: The type or namespace name 'RuntimeConfigurations' does not exist in the namespace 'Xunit' (are you missing an assembly reference?) [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 879 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release AllSubsets_Mono_LLVMAot_RuntimeTests llvmaot)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L879

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(879,53): error CS0234: The type or namespace name 'RuntimeConfigurations' does not exist in the namespace 'Xunit' (are you missing an assembly reference?) [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 879 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release NativeAOT)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L879

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(879,53): error CS0234: The type or namespace name 'RuntimeConfigurations' does not exist in the namespace 'Xunit' (are you missing an assembly reference?) [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 879 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug NativeAOT)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L879

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(879,53): error CS0234: The type or namespace name 'RuntimeConfigurations' does not exist in the namespace 'Xunit' (are you missing an assembly reference?) [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 879 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release NativeAOT)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L879

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(879,53): error CS0234: The type or namespace name 'RuntimeConfigurations' does not exist in the namespace 'Xunit' (are you missing an assembly reference?) [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 879 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release AllSubsets_Mono_RuntimeTests monointerpreter)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L879

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(879,53): error CS0234: The type or namespace name 'RuntimeConfigurations' does not exist in the namespace 'Xunit' (are you missing an assembly reference?) [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 879 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_Interpreter_RuntimeTests monointerpreter)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L879

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(879,53): error CS0234: The type or namespace name 'RuntimeConfigurations' does not exist in the namespace 'Xunit' (are you missing an assembly reference?) [/Users/runner/work/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 879 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release NativeAOT)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L879

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(879,53): error CS0234: The type or namespace name 'RuntimeConfigurations' does not exist in the namespace 'Xunit' (are you missing an assembly reference?) [/Users/runner/work/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 879 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_Minijit_RuntimeTests minijit)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L879

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(879,53): error CS0234: The type or namespace name 'RuntimeConfigurations' does not exist in the namespace 'Xunit' (are you missing an assembly reference?) [/Users/runner/work/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 879 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L879

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(879,53): error CS0234: The type or namespace name 'RuntimeConfigurations' does not exist in the namespace 'Xunit' (are you missing an assembly reference?) [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]
&& skippedTestPlatforms == Xunit.TestPlatforms.Any)
{
testInfos = FilterForSkippedRuntime(testInfos, (int)Xunit.TestRuntimes.CoreCLR, options);
}
testInfos = DecorateWithSkipOnPlatform(testInfos, (int)skippedTestPlatforms, options);
testInfos = DecorateWithSkipOnCoreClrConfiguration(testInfos, skippedTestModes, skippedConfigurations);
testInfos = DecorateWithSkipOnCoreClrConfiguration(testInfos, skippedTestModes, skippedConfigurations, skippedTestPlatforms, options);

Check failure on line 884 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build coreclr Common Pri0 Test Build AnyOS AnyCPU checked)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L884

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(884,33): error CS1501: No overload for method 'DecorateWithSkipOnCoreClrConfiguration' takes 5 arguments [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 884 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release AllSubsets_Mono_Minijit_RuntimeTests minijit)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L884

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(884,33): error CS1501: No overload for method 'DecorateWithSkipOnCoreClrConfiguration' takes 5 arguments [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 884 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release AllSubsets_Mono_LLVMAot_RuntimeTests llvmaot)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L884

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(884,33): error CS1501: No overload for method 'DecorateWithSkipOnCoreClrConfiguration' takes 5 arguments [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 884 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release NativeAOT)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L884

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(884,33): error CS1501: No overload for method 'DecorateWithSkipOnCoreClrConfiguration' takes 5 arguments [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 884 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug NativeAOT)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L884

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(884,33): error CS1501: No overload for method 'DecorateWithSkipOnCoreClrConfiguration' takes 5 arguments [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 884 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release NativeAOT)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L884

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(884,33): error CS1501: No overload for method 'DecorateWithSkipOnCoreClrConfiguration' takes 5 arguments [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 884 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release AllSubsets_Mono_RuntimeTests monointerpreter)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L884

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(884,33): error CS1501: No overload for method 'DecorateWithSkipOnCoreClrConfiguration' takes 5 arguments [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 884 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_Interpreter_RuntimeTests monointerpreter)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L884

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(884,33): error CS1501: No overload for method 'DecorateWithSkipOnCoreClrConfiguration' takes 5 arguments [/Users/runner/work/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 884 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release NativeAOT)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L884

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(884,33): error CS1501: No overload for method 'DecorateWithSkipOnCoreClrConfiguration' takes 5 arguments [/Users/runner/work/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 884 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_Minijit_RuntimeTests minijit)

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L884

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(884,33): error CS1501: No overload for method 'DecorateWithSkipOnCoreClrConfiguration' takes 5 arguments [/Users/runner/work/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

Check failure on line 884 in src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs

View check run for this annotation

Azure Pipelines / runtime

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs#L884

src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs(884,33): error CS1501: No overload for method 'DecorateWithSkipOnCoreClrConfiguration' takes 5 arguments [/__w/1/s/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj]

break;
}
Expand All @@ -889,15 +890,10 @@
return testInfos;
}

private static ImmutableArray<ITestInfo> DecorateWithSkipOnCoreClrConfiguration(ImmutableArray<ITestInfo> testInfos, Xunit.RuntimeTestModes skippedTestModes, Xunit.RuntimeConfiguration skippedConfigurations)
private static ImmutableArray<ITestInfo> DecorateWithSkipOnCoreClrConfiguration(ImmutableArray<ITestInfo> testInfos, Xunit.RuntimeTestModes skippedTestModes, Xunit.RuntimeConfiguration skippedConfigurations, Xunit.TestPlatforms skippedTestPlatforms)
{
const string ConditionClass = "TestLibrary.CoreClrConfigurationDetection";
List<string> conditions = new();
if (skippedConfigurations.HasFlag(Xunit.RuntimeConfiguration.Debug | Xunit.RuntimeConfiguration.Checked | Xunit.RuntimeConfiguration.Release))
{
// If all configurations are skipped, just skip the test as a whole
return ImmutableArray<ITestInfo>.Empty;
}

if (skippedConfigurations.HasFlag(Xunit.RuntimeConfiguration.Debug))
{
Expand Down Expand Up @@ -961,7 +957,7 @@
conditions.Add($"!{ConditionClass}.IsGCStressC");
}

return ImmutableArray.CreateRange<ITestInfo>(testInfos.Select(t => new ConditionalTest(t, string.Join(" && ", conditions))));
return ImmutableArray.CreateRange<ITestInfo>(testInfos.Select(t => new ConditionalTest(t, string.Join(" && ", conditions), ~skippedTestPlatforms)));
}

private static ImmutableArray<ITestInfo> FilterForSkippedTargetFrameworkMonikers(ImmutableArray<ITestInfo> testInfos, int v)
Expand Down
Loading