-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Move unsupported target conditions to IL in mcc tests #112399
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
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Can we fix the test scripts instead of adding these redundant annotations? |
That would require adding [ConditionalFact] to each test method which would be equally redundant, unless there's some way to mass-annotate that I don't know of. I removed the CLRTestTargetUnsupported from the merged target project, EDIT: tests failing, it's probably necessary, I'll try [ConditionalFact]s |
This reverts commit 166c8a7.
[ConditionalFact]s look messy in IL. The test failures could be side-stepped with <RequiresProcessIsolation> but that defeats the purpose of a merged test target. I reverted CLRTestTargetUnsupported in the merged target. I ran out of ideas to make it less redundant, it probably has to stay this way. |
@jkoritzinsky Is there a way to make |
I'd recommend using ConditionalFact as I want us to move to the attributes overall. There is a nice syntax for IL that I found that we've used for a few tests. Attributes will work for all cases. |
I tried ConditionalFact but apparently it needs XUnitWrapperGenerator to pick up the attributes and generate Main method. The only thing I got working so far with and without
The ConditionalFacts in IL CLR tests have a redundant condition in the build project which we're trying to avoid, e.g. runtime/src/tests/JIT/Methodical/xxobj/sizeof/sizeof32_Target_64Bit_and_arm.il Lines 41 to 50 in 42423ef
runtime/src/tests/JIT/Methodical/xxobj/sizeof/sizeof32_Target_64Bit_and_arm_r.ilproj Line 5 in 42423ef
Can you point me to these tests that avoid the above-mentioned problems? |
For reference,
|
Thanks, it looks nicer. Still the problem was no Main() is generated off of the attribute, I don't see it working anywhere else in CLR tests without the condition doubled in |
'ReferenceXUnitWrapperGenerator' was not set for IL, this change at least puts a project reference: --- a/src/tests/Directory.Build.targets
+++ b/src/tests/Directory.Build.targets
@@ -493,7 +493,7 @@
</ItemGroup>
</Target>
- <PropertyGroup Condition="'$(Language)' == 'C#' and '$(_CLRTestNeedsToRun)' == 'true' and ('$(BuildAsStandalone)' == 'true' or '$(RequiresProcessIsolation)' == 'true' or '$(InMergedTestDirectory)' == 'true' or '$(IsMergedTestRunnerAssembly)' == 'true')">
+ <PropertyGroup Condition="('$(Language)' == 'C#' or '$(Language)' == 'IL') and '$(_CLRTestNeedsToRun)' == 'true' and ('$(BuildAsStandalone)' == 'true' or '$(RequiresProcessIsolation)' == 'true' or '$(InMergedTestDirectory)' == 'true' or '$(IsMergedTestRunnerAssembly)' == 'true')">
<ReferenceXUnitWrapperGenerator Condition="'$(ReferenceXUnitWrapperGenerator)' == ''">true</ReferenceXUnitWrapperGenerator>
</PropertyGroup> Still, the wrapper generator is not called. |
…tor is not called?
The wrapper generator won't be called for IL. You'll need to add a Main method into each IL project that manually calls the different cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CLRTestTargetUnsupported for not-windows added in #111887 to jit64_2.csproj is not respected when CLR tests are built with BuildAllTestsAsStandalone=true.
Part of #84834, cc @dotnet/samsung