Move unsupported target conditions to IL in mcc tests#112399
Move unsupported target conditions to IL in mcc tests#112399jkoritzinsky merged 11 commits intodotnet:mainfrom
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.
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. |
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