Skip to content

Enable filtering for tests on coreclr interpreter#16385

Merged
janvorli merged 1 commit intodotnet:mainfrom
janvorli:enable-interpreter-filtering-for-tests
Dec 8, 2025
Merged

Enable filtering for tests on coreclr interpreter#16385
janvorli merged 1 commit intodotnet:mainfrom
janvorli:enable-interpreter-filtering-for-tests

Conversation

@janvorli
Copy link
Member

@janvorli janvorli commented Dec 8, 2025

While the CoreClrConfigurationDetection and RuntimeTestModes were already modified to add support for coreclr interpreter detection, it was missing wiring in the SkipOnCoreClrAttribute. So setting the attribute with RuntimeTestModes.InterpreterActive on a test has no effect.

This change fixes it.

While the CoreClrConfigurationDetection and RuntimeTestModes were
already modified to add support for coreclr interpreter detection, it
was missing wiring in the SkipOnCoreClrAttribute. So setting the
attribute with RuntimeTestModes.InterpreterActive on a test has no
effect.

This change fixes it.
@janvorli janvorli requested a review from jkotas December 8, 2025 18:26
@janvorli janvorli self-assigned this Dec 8, 2025
@janvorli janvorli requested review from akoeplinger and kg December 8, 2025 18:27
@jkotas
Copy link
Member

jkotas commented Dec 8, 2025

It is ok to fix this in Arcade, however I think it is better to use PlatformDetection properties to skip tests - it is more flexible.

I would add IsCoreClrInterpreter / IsNotCoreClrInterpreter to PlatformDetection under libraries next to the existing IsMonoClrInterpreter properties:

https://github.com/dotnet/runtime/blob/c78f853a7ddb98762552669cae671ef1d201e8db/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs#L32-L33

And used it to implement to disable the tests as needed. I can look like this:

        private static bool SupportsDirtyAccessViolations => !PlatformDetection.IsMonoRuntime && !PlatformDetection.IsCoreClrInterpreter && !PlatformDetection.IsWasm;

        [Fact]
        public void ReadInt16_ZeroPointer_ThrowsException()
        {
            Assert.Throws<AccessViolationException>(() => Marshal.ReadInt16(IntPtr.Zero));
            if (SupportsDirtyAccessViolations)
                Asser.Throws<AccessViolationException>(() => Marshal.ReadInt16(IntPtr.Zero, 2));
        }

@janvorli janvorli merged commit 17c915f into dotnet:main Dec 8, 2025
9 checks passed
@janvorli janvorli deleted the enable-interpreter-filtering-for-tests branch December 8, 2025 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants