Skip to content

Commit

Permalink
Fix test suppression on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Sep 22, 2021
1 parent a07f142 commit e153b3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ public static IEnumerable<RegexEngine> AvailableEngines
get
{
yield return RegexEngine.Interpreter;

yield return RegexEngine.Compiled;

if (PlatformDetection.IsNetCore &&
PlatformDetection.IsReflectionEmitSupported && // the source generator doesn't use reflection emit, but it does use Roslyn for the equivalent
PlatformDetection.IsNotMobile &&
PlatformDetection.IsNotBrowser)
{
yield return RegexEngine.SourceGenerated;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ namespace System.Text.RegularExpressions.Generator.Tests
{
// Tests don't actually use reflection emit, but they do generate assembly via Roslyn in-memory at run time and expect it to be JIT'd.
// The tests also use typeof(object).Assembly.Location, which returns an empty string on wasm.
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
[PlatformSpecific(~TestPlatforms.Browser)]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported), nameof(PlatformDetection.IsNotMobile), nameof(PlatformDetection.IsNotBrowser))]
public class RegexGeneratorParserTests
{
[Fact]
Expand Down

0 comments on commit e153b3a

Please sign in to comment.