diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-android.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-android.yml index 7b9d41475f30e0..417241706c4c91 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-android.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-android.yml @@ -83,3 +83,34 @@ jobs: parameters: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Android devices +# Build the whole product using CoreCLR and run libraries tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: coreclr + platforms: + - android_arm64 + variables: + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: coreclrContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_CoreCLR + isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} + buildArgs: -s clr.runtime+clr.alljits+clr.corelib+clr.nativecorelib+clr.tools+clr.packages+libs+libs.tests+host+packs -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) + timeoutInMinutes: 480 + # extra steps, run tests + postBuildSteps: + - template: /eng/pipelines/libraries/helix.yml + parameters: + creator: dotnet-bot + testRunNamePrefixSuffix: CoreCLR_$(_BuildConfig) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-androidemulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-androidemulator.yml index 4badaf93186c0b..b7b3774f0b5a35 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-androidemulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-androidemulator.yml @@ -118,3 +118,34 @@ jobs: parameters: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Android emulators +# Build the whole product using CoreCLR and run libraries tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: coreclr + platforms: + - android_x64 + variables: + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: coreclrContainsChange + value: $[ stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_CoreCLR + isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} + buildArgs: -s clr.runtime+clr.alljits+clr.corelib+clr.nativecorelib+clr.tools+clr.packages+libs+libs.tests+host+packs -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) + timeoutInMinutes: 240 + # extra steps, run tests + postBuildSteps: + - template: /eng/pipelines/libraries/helix.yml + parameters: + creator: dotnet-bot + testRunNamePrefixSuffix: CoreCLR_$(_BuildConfig) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 7e1da71244461b..8ab3d80a4da963 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -956,7 +956,7 @@ extends: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_CoreCLR - buildArgs: -s clr.runtime+clr.alljits+clr.corelib+clr.nativecorelib+clr.tools+clr.packages+libs++libs.tests+host+packs -c $(_BuildConfig) /p:ArchiveTests=true /p:TestAssemblies=false + buildArgs: -s clr.runtime+clr.alljits+clr.corelib+clr.nativecorelib+clr.tools+clr.packages+libs+libs.tests+host+packs -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=true timeoutInMinutes: 480 condition: >- or( diff --git a/eng/testing/AndroidRunnerTemplate.cmd b/eng/testing/AndroidRunnerTemplate.cmd new file mode 100644 index 00000000000000..a1535a9e2b6e52 --- /dev/null +++ b/eng/testing/AndroidRunnerTemplate.cmd @@ -0,0 +1,47 @@ +@ECHO OFF +setlocal enabledelayedexpansion + +SET EXECUTION_DIR=%~dp0 +SET ASSEMBLY_NAME=%1 +SET TARGET_ARCH=%2 +SET TARGET_OS=%3 +SET TEST_NAME=%4 +SET REPO_ROOT=%5 + +:Arg_Loop +if "%6" == "" goto ArgsDone +set "__AdditionalArgs=!__AdditionalArgs! %6"&shift&goto Arg_Loop +:ArgsDone + +SET "XHARNESS_OUT=%EXECUTION_DIR%xharness-output" + +cd %EXECUTION_DIR% + +:lock +MKDIR androidtests.lock 2>NUL +IF "%errorlevel%" NEQ "0" ( + ping -n 6 127.0.0.1 >NUL + GOTO :lock +) + +IF [%XHARNESS_CLI_PATH%] NEQ [] ( + :: When running in CI, we only have the .NET runtime available + :: We need to call the XHarness CLI DLL directly via dotnet exec + SET HARNESS_RUNNER=%REPO_ROOT%dotnet.cmd exec "%XHARNESS_CLI_PATH%" +) ELSE ( + SET HARNESS_RUNNER=%REPO_ROOT%dotnet.cmd xharness +) + +%HARNESS_RUNNER% android test --instrumentation="net.dot.MonoRunner" --package-name="net.dot.%ASSEMBLY_NAME%" --app="%EXECUTION_DIR%bin\%TEST_NAME%.apk" --output-directory="%XHARNESS_OUT%" --timeout=1800 %__AdditionalArgs% + +SET EXIT_CODE=%ERRORLEVEL% + +ECHO XHarness artifacts: %XHARNESS_OUT% + +RMDIR /Q androidtests.lock 2>NUL +EXIT /B %EXIT_CODE% + +:: ========== FUNCTIONS ========== +:NORMALIZEPATH + SET RETVAL=%~f1 + EXIT /B diff --git a/eng/testing/tests.android.targets b/eng/testing/tests.android.targets index 3c3eb46fa28ebd..4144799c78f908 100644 --- a/eng/testing/tests.android.targets +++ b/eng/testing/tests.android.targets @@ -3,7 +3,7 @@ $(BundleTestAppTargets);BundleTestAndroidApp - + @@ -12,6 +12,10 @@ AndroidBuild + + $(DefineConstants);SINGLE_FILE_TEST_RUNNER + + @@ -22,7 +26,7 @@ AndroidTestRunner.dll - + $(PublishDir) $(BundleDir) @@ -44,7 +48,7 @@ <_InternalForceInterpret>true <_IsNative>true - + <_PublishAssemblies Include="$(PublishDir)\**\*.dll" Exclude="$(PublishDir)\**\*.resources.dll" /> <_SatelliteAssemblies Include="$(PublishDir)\**\*.resources.dll" /> @@ -73,4 +77,4 @@ - \ No newline at end of file + diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 4ffbd60c365dc0..f05b4aa2a67c7b 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -1,14 +1,15 @@ - true - false + true + false RunnerTemplate.cmd RunnerTemplate.sh AppleHelixRunnerTemplate.sh AppleRunnerTemplate.sh - AndroidRunnerTemplate.sh + AndroidRunnerTemplate.sh + AndroidRunnerTemplate.cmd WasiRunnerTemplate.sh WasiRunnerTemplate.cmd WasmRunnerTemplate.sh @@ -172,7 +173,8 @@ TEST_ARCH=$(_AndroidArchitecture) "$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture) $(TargetOS) $(TestProjectName) $(RunTestsCommand) $(Configuration) $(AdditionalXHarnessArguments) - $(RunTestsCommand) $(AdditionalXHarnessArguments) + $(RunTestsCommand) $(AdditionalXHarnessArguments) + $(RunTestsCommand) $(RepoRoot) $(AdditionalXHarnessArguments) "$(RunScriptOutputPath)" $(JSEngine) $(AssemblyName).dll $(Scenario) diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/ConfigBindingGenTestDriver.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/ConfigBindingGenTestDriver.cs index 2c6bf5c33bcaf2..b15815d72527fc 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/ConfigBindingGenTestDriver.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/ConfigBindingGenTestDriver.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; @@ -17,7 +18,7 @@ namespace Microsoft.Extensions.SourceGeneration.Configuration.Binder.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/52062", TestPlatforms.Browser)] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public partial class ConfigurationBindingGeneratorTests : ConfigurationBinderTestsBase { internal sealed class ConfigBindingGenTestDriver diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Baselines.Options.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Baselines.Options.cs index 219c57b9e59131..e887e1b9cdec1f 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Baselines.Options.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Baselines.Options.cs @@ -72,7 +72,7 @@ public async Task Configure_T_NamedParameters_OutOfOrder(string row) using System.Collections.Generic; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; - + public class Program { public static void Main() @@ -84,7 +84,7 @@ public static void Main() {{row}} } - + public class MyClass { public string MyString { get; set; } @@ -109,7 +109,7 @@ public async Task Bind_T_NamedParameters_OutOfOrder(string row) using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; - + public class Program { public static void Main() @@ -121,7 +121,7 @@ public static void Main() {{row}} } - + public class MyClass { public string MyString { get; set; } diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Incremental.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Incremental.cs index aff9a0c20364ca..bb6c5baae32272 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Incremental.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.Incremental.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.Extensions.Configuration.Binder.SourceGeneration; @@ -11,7 +12,7 @@ namespace Microsoft.Extensions.SourceGeneration.Configuration.Binder.Tests { public partial class ConfigurationBindingGeneratorTests : ConfigurationBinderTestsBase { - [ActiveIssue("https://github.com/dotnet/runtime/issues/52062", TestPlatforms.Browser)] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public sealed class IncrementalTests { [Fact] diff --git a/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs b/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs index 5a3479b42c3568..f55323caeedc14 100644 --- a/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs +++ b/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs @@ -24,7 +24,7 @@ namespace Microsoft.Gen.OptionsValidation.Unit.Test; public class EmitterTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task TestEmitterWithCustomValidator() { string source = """ @@ -64,7 +64,7 @@ public partial struct MyOptionsValidator : IValidateOptions Assert.Equal(generatedSource.Replace("\r\n", "\n"), generatedSources[0].SourceText.ToString().Replace("\r\n", "\n")); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task PotentiallyMissingAttributes() { var (diagnostics, _) = await RunGenerator(@" @@ -94,7 +94,7 @@ public partial class FirstValidator : IValidateOptions Assert.Equal(DiagDescriptors.PotentiallyMissingEnumerableValidation.Id, diagnostics[1].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task IgnoredStaticMembers() { var (d, _) = await RunGenerator(@" @@ -129,7 +129,7 @@ public partial class FirstModelValidator : IValidateOptions Assert.Empty(d); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ValidationAttributeOnStaticMember() { var (d, _) = await RunGenerator(@" @@ -168,7 +168,7 @@ public partial class FirstModelValidator : IValidateOptions Assert.All(d, x => Assert.Equal(DiagnosticSeverity.Warning, x.DefaultSeverity)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task CircularTypeReferences() { var (diagnostics, _) = await RunGenerator(@" @@ -189,7 +189,7 @@ public partial class FirstValidator : IValidateOptions Assert.Equal(DiagDescriptors.CircularTypeReferences.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task InvalidValidatorInterface() { var (diagnostics, _) = await RunGenerator(@" @@ -220,7 +220,7 @@ public partial class SecondValidator Assert.Equal(DiagDescriptors.DoesntImplementIValidateOptions.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task NotValidator() { var (diagnostics, _) = await RunGenerator(@" @@ -250,7 +250,7 @@ public partial class SecondValidator Assert.Equal(DiagDescriptors.DoesntImplementIValidateOptions.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ValidatorAlreadyImplementValidateFunction() { var (diagnostics, _) = await RunGenerator(@" @@ -288,7 +288,7 @@ public ValidateOptionsResult Validate(string name, SecondModel options) Assert.Equal(DiagDescriptors.AlreadyImplementsValidateMethod.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task NullValidator() { var (diagnostics, _) = await RunGenerator(@" @@ -319,7 +319,7 @@ public partial class SecondValidator : IValidateOptions Assert.Equal(DiagDescriptors.NullValidatorType.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task NoSimpleValidatorConstructor() { var (diagnostics, _) = await RunGenerator(@" @@ -356,7 +356,7 @@ public SecondValidator(int _) Assert.Equal(DiagDescriptors.ValidatorsNeedSimpleConstructor.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task NoStaticValidator() { var (diagnostics, _) = await RunGenerator(@" @@ -376,7 +376,7 @@ public static partial class FirstValidator : IValidateOptions Assert.Equal(DiagDescriptors.CantBeStaticClass.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task BogusModelType() { var (diagnostics, _) = await RunGenerator(@" @@ -390,7 +390,7 @@ public partial class FirstValidator : IValidateOptions Assert.Empty(diagnostics); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task CantValidateOpenGenericMembers() { var (diagnostics, _) = await RunGenerator(@" @@ -421,7 +421,7 @@ public partial class FirstValidator : IValidateOptions> Assert.Equal(DiagDescriptors.CantUseWithGenericTypes.Id, diagnostics[2].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ClosedGenerics() { var (diagnostics, _) = await RunGenerator(@" @@ -457,7 +457,7 @@ public partial class FirstValidator : IValidateOptions> Assert.Equal(DiagDescriptors.NoEligibleMember.Id, diagnostics[3].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task NoEligibleMembers() { var (diagnostics, _) = await RunGenerator(@" @@ -489,7 +489,7 @@ public partial class SecondValidator : IValidateOptions Assert.Equal(DiagDescriptors.NoEligibleMembersFromValidator.Id, diagnostics[1].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task AlreadyImplemented() { var (diagnostics, _) = await RunGenerator(@" @@ -512,7 +512,7 @@ public void Validate(string name, FirstModel fm) Assert.Equal(DiagDescriptors.AlreadyImplementsValidateMethod.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldNotProduceInfoWhenTheClassHasABaseClass() { var (diagnostics, _) = await RunGenerator(@" @@ -537,7 +537,7 @@ public partial class Validator : IValidateOptions Assert.Empty(diagnostics); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldNotProduceInfoWhenTransitiveClassHasABaseClass() { var (diagnostics, _) = await RunGenerator(@" @@ -568,7 +568,7 @@ public partial class Validator : IValidateOptions Assert.Empty(diagnostics); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [InlineData("bool")] [InlineData("int")] [InlineData("double")] @@ -603,7 +603,7 @@ public partial class Validator : IValidateOptions Assert.Equal(DiagDescriptors.NoEligibleMember.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldProduceWarningWhenTheClassHasNoEligibleMembers() { var (diagnostics, _) = await RunGenerator(@" @@ -623,7 +623,7 @@ public partial class Validator : IValidateOptions Assert.Equal(DiagDescriptors.NoEligibleMembersFromValidator.Id, diagnostics[0].Id); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [InlineData("private")] [InlineData("protected")] public async Task ShouldProduceWarningWhenTheClassMembersAreInaccessible(string accessModifier) @@ -648,7 +648,7 @@ public partial class Validator : IValidateOptions Assert.Equal("SYSLIB1206", diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldNotProduceErrorWhenMultipleValidationAnnotationsExist() { var (diagnostics, _) = await RunGenerator(@" @@ -668,7 +668,7 @@ public partial class Validator : IValidateOptions Assert.Empty(diagnostics); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldNotProduceErrorWhenDataTypeAttributesAreUsed() { var (diagnostics, _) = await RunGenerator(@" @@ -702,7 +702,7 @@ public partial class Validator : IValidateOptions Assert.Empty(diagnostics); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldNotProduceErrorWhenConstVariableIsUsedAsAttributeArgument() { var (diagnostics, _) = await RunGenerator(@" @@ -723,7 +723,7 @@ public partial class Validator : IValidateOptions } // Testing on all existing & eligible annotations extending ValidationAttribute that aren't used above - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldNotProduceAnyMessagesWhenExistingValidationsArePlaced() { var (diagnostics, _) = await RunGenerator(@" @@ -763,7 +763,7 @@ public partial class Validator : IValidateOptions Assert.Empty(diagnostics); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldNotProduceErrorWhenPropertiesAreUsedAsAttributeArgument() { var (diagnostics, _) = await RunGenerator(@" @@ -783,7 +783,7 @@ public partial class Validator : IValidateOptions Assert.Empty(diagnostics); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldSkipWhenOptionsValidatorAttributeDoesNotExist() { var (diagnostics, _) = await RunGenerator(@" @@ -803,7 +803,7 @@ public partial class Validator : IValidateOptions Assert.Empty(diagnostics); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldSkipAtrributeWhenAttributeSymbolCannotBeFound() { var (diagnostics, _) = await RunGenerator(@" @@ -825,7 +825,7 @@ public partial class Validator : IValidateOptions Assert.Empty(diagnostics); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldSkipAtrributeWhenAttributeSymbolIsNotBasedOnValidationAttribute() { var (diagnostics, _) = await RunGenerator(@" @@ -847,7 +847,7 @@ public partial class Validator : IValidateOptions Assert.Empty(diagnostics); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldAcceptAtrributeWhenAttributeIsInDifferentNamespace() { var (diagnostics, _) = await RunGenerator(@" @@ -873,7 +873,7 @@ public partial class Validator : IValidateOptions Assert.Empty(diagnostics); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldHandleAtrributePropertiesOtherThanString() { var (diagnostics, _) = await RunGenerator(@" @@ -907,7 +907,7 @@ public TestAttribute() { Assert.Empty(diagnostics); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ShouldStoreFloatValuesCorrectly() { var backupCulture = CultureInfo.CurrentCulture; @@ -938,7 +938,7 @@ public partial class Validator : IValidateOptions } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task MultiModelValidatorGeneratesOnlyOnePartialTypeBlock() { var (diagnostics, sources) = await RunGenerator(@" @@ -987,7 +987,7 @@ public partial class MultiValidator : IValidateOptions, IValidateOpt Assert.Equal(3, validateMethodDeclarations.Length); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task CircularTypeReferencesInEnumeration() { var (diagnostics, _) = await RunGenerator(@" @@ -1008,7 +1008,7 @@ public partial class FirstValidator : IValidateOptions Assert.Equal(DiagDescriptors.CircularTypeReferences.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task NotValidatorInEnumeration() { var (diagnostics, _) = await RunGenerator(@" @@ -1038,7 +1038,7 @@ public partial class SecondValidator Assert.Equal(DiagDescriptors.DoesntImplementIValidateOptions.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task NullValidatorInEnumeration() { var (diagnostics, _) = await RunGenerator(@" @@ -1069,7 +1069,7 @@ public partial class SecondValidator : IValidateOptions Assert.Equal(DiagDescriptors.NullValidatorType.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task NoSimpleValidatorConstructorInEnumeration() { var (diagnostics, _) = await RunGenerator(@" @@ -1252,7 +1252,7 @@ internal sealed partial class SecondOptionsValidator : IValidateOptions Assert.DoesNotContain("Timeout", generatedSource); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task CantValidateOpenGenericMembersInEnumeration() { var (diagnostics, _) = await RunGenerator(@" @@ -1467,7 +1467,7 @@ public partial class FirstValidator : IValidateOptions> Assert.Equal(DiagDescriptors.CantUseWithGenericTypes.Id, diagnostics[2].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task ClosedGenericsInEnumeration() { var (diagnostics, _) = await RunGenerator(@" @@ -1498,7 +1498,7 @@ public partial class FirstValidator : IValidateOptions> Assert.Equal(DiagDescriptors.NoEligibleMember.Id, diagnostics[2].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task NotEnumerable() { var (diagnostics, _) = await RunGenerator(@" @@ -1519,7 +1519,7 @@ public partial class FirstValidator : IValidateOptions Assert.Equal(DiagDescriptors.NotEnumerableType.Id, diagnostics[0].Id); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task LanguageVersionTest() { string source = """ @@ -1576,7 +1576,7 @@ public partial class FirstModelValidator : IValidateOptions Assert.Equal(0, diags.Length); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser), nameof(PlatformDetection.IsNetCore))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles), nameof(PlatformDetection.IsNetCore))] public async Task DataAnnotationAttributesWithParams() { var (diagnostics, generatedSources) = await RunGenerator(@""" @@ -1709,7 +1709,7 @@ private static CSharpCompilation CreateCompilationForOptionsSource(string assemb return result; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [InlineData(LanguageVersion.CSharp10)] [InlineData(LanguageVersion.CSharp11)] public async Task GeneratedAttributesTest(LanguageVersion languageVersion) @@ -1821,7 +1821,7 @@ public sealed partial class OptionsUsingGeneratedAttributesValidator : IValidate // Console.WriteLine(emittedSource); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task UsingInterfaceAsPropertyTypeForLengthAttributesTests() { var (diagnostics, generatedSources) = await RunGenerator(@""" @@ -1865,7 +1865,7 @@ public partial class MyOptionsValidator : IValidateOptions Assert.Equal(generatedSource.Replace("\r\n", "\n"), generatedSources[0].SourceText.ToString().Replace("\r\n", "\n")); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task OptionsExtendingSystemClassTest() { string source = """ diff --git a/src/libraries/Microsoft.Extensions.Options/tests/SourceGenerationTests/EmitterTests.cs b/src/libraries/Microsoft.Extensions.Options/tests/SourceGenerationTests/EmitterTests.cs index 1f54faf77d7fef..da4aba73863aa8 100644 --- a/src/libraries/Microsoft.Extensions.Options/tests/SourceGenerationTests/EmitterTests.cs +++ b/src/libraries/Microsoft.Extensions.Options/tests/SourceGenerationTests/EmitterTests.cs @@ -17,7 +17,7 @@ namespace Microsoft.Gen.OptionsValidation.Test; public class EmitterTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public async Task TestEmitter() { var sources = new List(); diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs index 4db6681ba537a5..5844f2ccf64d12 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs @@ -10,6 +10,7 @@ namespace Microsoft.VisualBasic.Tests public class ErrObjectTests { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951", typeof(PlatformDetection), nameof(PlatformDetection.IsSingleFile))] [ActiveIssue("https://github.com/mono/mono/issues/14854", TestRuntimes.Mono)] public void Clear() { diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft.VisualBasic.Core.Tests.csproj b/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft.VisualBasic.Core.Tests.csproj index 688a009eb8691f..6b4dbf83662206 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft.VisualBasic.Core.Tests.csproj +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft.VisualBasic.Core.Tests.csproj @@ -62,4 +62,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CompilerResultsTests.cs b/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CompilerResultsTests.cs index aa791baa631aa8..f36b765421ba4e 100644 --- a/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CompilerResultsTests.cs +++ b/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CompilerResultsTests.cs @@ -28,7 +28,7 @@ public void Ctor_TempFileCollection(TempFileCollection tempFiles) Assert.Same(tempFiles, results.TempFiles); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void CompiledAssembly_GetWithPathToAssemblySet_ReturnsExpectedAssembly() { var results = new CompilerResults(null) { PathToAssembly = AssemblyPathHelper.GetAssemblyLocation(typeof(CompilerResultsTests).Assembly) }; diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogTests.cs index ae0c29c15bc0dc..fd3d3c13f00557 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/AssemblyCatalogTests.cs @@ -349,7 +349,7 @@ public void Constructor2_NonExistentFileNameAsCodeBaseArgument_ShouldThrowFileNo }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void Constructor2_NullReflectionContextArgument_ShouldThrowArgumentNull() { AssemblyCatalogConstructorTests.Constructor_NullReflectionContextArgument_ShouldThrowArgumentNull((rc) => @@ -447,7 +447,7 @@ public void Constructor3_NonExistentFileNameAsCodeBaseArgument_ShouldThrowFileNo }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void Constructor3_NullDefinitionOriginArgument_ShouldThrowArgumentNull() { AssemblyCatalogConstructorTests.Constructor_NullDefinitionOriginArgument_ShouldThrowArgumentNull((dO) => @@ -544,7 +544,7 @@ public void Constructor4_NonExistentFileNameAsCodeBaseArgument_ShouldThrowFileNo }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void Constructor4_NullReflectionContextArgument_ShouldThrowArgumentNull() { AssemblyCatalogConstructorTests.Constructor_NullReflectionContextArgument_ShouldThrowArgumentNull((rc) => @@ -553,7 +553,7 @@ public void Constructor4_NullReflectionContextArgument_ShouldThrowArgumentNull() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void Constructor4_NullDefinitionOriginArgument_ShouldThrowArgumentNull() { AssemblyCatalogConstructorTests.Constructor_NullDefinitionOriginArgument_ShouldThrowArgumentNull((dO) => @@ -638,7 +638,7 @@ public void Constructor8_ValueAsAssemblyArgument_ShouldSetAssemblyProperty() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void Constructor8_NullReflectionContextArgument_ShouldThrowArgumentNull() { AssemblyCatalogConstructorTests.Constructor_NullReflectionContextArgument_ShouldThrowArgumentNull((rc) => @@ -648,7 +648,7 @@ public void Constructor8_NullReflectionContextArgument_ShouldThrowArgumentNull() } #pragma warning disable SYSLIB0012 - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void Constructor8_NullDefinitionOriginArgument_ShouldThrowArgumentNull() { AssemblyCatalogConstructorTests.Constructor_NullDefinitionOriginArgument_ShouldThrowArgumentNull((dO) => diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogDebuggerProxyTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogDebuggerProxyTests.cs index 72ae912ef1fd8e..16759cef1f4697 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogDebuggerProxyTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogDebuggerProxyTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.ComponentModel.Composition.Hosting; using System.IO; using System.Linq; @@ -125,8 +126,7 @@ public void LoadedFiles_EmptyDirectory_ShouldBeFine() Assert.Equal(0, proxy.LoadedFiles.Count); } - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser.")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadedFiles_ContainsMultipleDllsAndSomeNonDll_ShouldOnlyContainDlls() { string directoryPath = TemporaryFileCopier.GetNewTemporaryDirectory(); diff --git a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs index c91e51eacd80e6..cddd3ae263f2e3 100644 --- a/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs +++ b/src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs @@ -320,8 +320,7 @@ public void LoadedFiles_EmptyDirectory_ShouldBeFine() Assert.Equal(0, cat.LoadedFiles.Count); } - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser.")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadedFiles_ContainsMultipleDllsAndSomeNonDll_ShouldOnlyContainDlls() { // Add one text file diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationManagerTest.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationManagerTest.cs index ca65cb92533a72..d391f308c7faa6 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationManagerTest.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/Mono/ConfigurationManagerTest.cs @@ -44,6 +44,7 @@ public class ConfigurationManagerTest { [Fact] // OpenExeConfiguration (ConfigurationUserLevel) [ActiveIssue("https://github.com/dotnet/runtime/issues/21528", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951", typeof(PlatformDetection), nameof(PlatformDetection.IsSingleFile))] public void OpenExeConfiguration1_UserLevel_None() { SysConfig config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); @@ -253,6 +254,7 @@ public void mapped_MachineConfig() // Doesn't pass on Mono // [Category("NotWorking")] [ActiveIssue("https://github.com/dotnet/runtime/issues/21528", TargetFrameworkMonikers.NetFramework)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951", typeof(PlatformDetection), nameof(PlatformDetection.IsSingleFile))] public void mapped_ExeConfiguration_null() { SysConfig config = ConfigurationManager.OpenMappedExeConfiguration(null, ConfigurationUserLevel.None); diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs index b0470c1c8a5bd8..edd78bf6e61831 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs @@ -11,6 +11,7 @@ public class StackTraceSymbolsTests { [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [ActiveIssue("https://github.com/dotnet/runtime/issues/51399", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951", TestPlatforms.Android)] public void StackTraceSymbolsDoNotLockFile() { var asmPath = AssemblyPathHelper.GetAssemblyLocation(typeof(StackTraceSymbolsTests).Assembly); diff --git a/src/libraries/System.Diagnostics.TraceSource/tests/System.Diagnostics.TraceSource.Config.Tests/TraceSourceWithConfigurationTests.cs b/src/libraries/System.Diagnostics.TraceSource/tests/System.Diagnostics.TraceSource.Config.Tests/TraceSourceWithConfigurationTests.cs index 7d39211b10872b..1b523f9e88d019 100644 --- a/src/libraries/System.Diagnostics.TraceSource/tests/System.Diagnostics.TraceSource.Config.Tests/TraceSourceWithConfigurationTests.cs +++ b/src/libraries/System.Diagnostics.TraceSource/tests/System.Diagnostics.TraceSource.Config.Tests/TraceSourceWithConfigurationTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Configuration; using System.IO; using System.Reflection; @@ -35,7 +36,7 @@ private static void CreateAndLoadConfigFile(string filename) [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS | TestPlatforms.iOS | TestPlatforms.Android)] public void RuntimeFilterChange() { CreateAndLoadConfigFile("testhost_ConfigWithRuntime.config"); @@ -96,7 +97,7 @@ public void RuntimeFilterChange() [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS | TestPlatforms.iOS | TestPlatforms.Android)] public void Refresh_RemoveSwitch() { // Use a SourceSwitch that logs Error. @@ -137,7 +138,7 @@ void Log() [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS | TestPlatforms.iOS | TestPlatforms.Android)] public void Refresh_ChangeSwitch() { // Use a SourceSwitch that logs Error. @@ -163,7 +164,7 @@ public void Refresh_ChangeSwitch() [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS | TestPlatforms.iOS | TestPlatforms.Android)] public void Refresh_RemoveSource() { // Use a SourceSwitch that logs Error. @@ -197,7 +198,7 @@ public void Refresh_RemoveSource() [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS | TestPlatforms.iOS | TestPlatforms.Android)] public void ConfigWithEvents_RuntimeListener() { CreateAndLoadConfigFile("testhost_ConfigWithRuntime.config"); @@ -264,7 +265,7 @@ private void SubscribeToSwitch_Initializing(object? sender, InitializingSwitchEv [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS | TestPlatforms.iOS | TestPlatforms.Android)] public void AllTypes() { CreateAndLoadConfigFile("testhost_AllTypes.config"); @@ -309,7 +310,7 @@ public void AllTypes() [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS | TestPlatforms.iOS | TestPlatforms.Android)] public void Switch_MissingValue_Throws() { Exception e = Assert.Throws(() => @@ -320,7 +321,7 @@ public void Switch_MissingValue_Throws() [Fact] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/74244", TestPlatforms.tvOS | TestPlatforms.iOS | TestPlatforms.Android)] public void UnsupportedAttribute_Throws() { CreateAndLoadConfigFile("testhost_UnsupportedAttribute_Throws.config"); diff --git a/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs b/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs index 85070e1534a8ee..c3128f15c98dfd 100644 --- a/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs @@ -294,6 +294,7 @@ public async Task WritesUsingGetMemoryWorks() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public async Task CompleteWithLargeWriteThrows() { var completeDelay = TimeSpan.FromMilliseconds(10); diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs index 4166f6942f7729..0d94c9fb861b25 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs @@ -2303,7 +2303,7 @@ public static void Xml_TypeWithSpecialCharacterInStringMember() Assert.Equal(x.Name, y.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] #if XMLSERIALIZERGENERATORTESTS // Lack of AssemblyDependencyResolver results in assemblies that are not loaded by path to get // loaded in the default ALC, which causes problems for this test. diff --git a/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineEnum.cs b/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineEnum.cs index 8bce42af9fac05..4e1f762cae074d 100644 --- a/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineEnum.cs +++ b/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineEnum.cs @@ -76,7 +76,7 @@ public void DefineEnum(string name, TypeAttributes visibility, Type underlyingTy Assert.Equal(FieldAttributes.Public | FieldAttributes.SpecialName | FieldAttributes.RTSpecialName, createdUnderlyingField.Attributes); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [MemberData(nameof(DefineEnum_TestData))] public void DefineEnumPersistedAssembly(string name, TypeAttributes visibility, Type underlyingType) { @@ -103,7 +103,7 @@ public void DefineEnumPersistedAssembly(string name, TypeAttributes visibility, ab.Save(stream); Assembly assemblyFromStream = mlc.LoadFromStream(stream); Type createdEnum = assemblyFromStream.GetType(name); - if (createdEnum != null) // null when name = "a\0b\0c" + if (createdEnum != null) // null when name = "a\0b\0c" { Assert.True(createdEnum.IsEnum); Assert.Equal(Helpers.GetFullName(name), createdEnum.Name); diff --git a/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineType.cs b/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineType.cs index cc68471251d56c..48cc610dd8eb86 100644 --- a/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineType.cs +++ b/src/libraries/System.Reflection.Emit/tests/ModuleBuilder/ModuleBuilderDefineType.cs @@ -95,7 +95,7 @@ void Verify(TypeBuilder type, Module module) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [MemberData(nameof(TestData))] public void DefineTypePersistedAssembly(string name, TypeAttributes attributes, Type parent, PackingSize packingSize, int typesize, Type[] implementedInterfaces) { diff --git a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveAssemblyBuilderTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveAssemblyBuilderTests.cs index 256039267a529c..4b909cca5300f8 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveAssemblyBuilderTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveAssemblyBuilderTests.cs @@ -14,7 +14,7 @@ namespace System.Reflection.Emit.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class AssemblySaveAssemblyBuilderTests { private readonly AssemblyName _assemblyName = new AssemblyName("MyAssembly"); @@ -305,7 +305,7 @@ public void AssemblyWithDifferentTypes() [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/113789", TestRuntimes.Mono)] - [InlineData(true)] + [InlineData(true)] [InlineData(false)] public unsafe void AssemblyWithInstanceBasedFunctionPointer(bool useExplicitThis) { @@ -350,7 +350,7 @@ static unsafe byte[] GenerateMethodInPersistedAssembly(bool useExplicitThis) // In this test, we use typeof(object) for the "this" pointer to ensure the IL could be re-used for other // reference types, but normally this would be the appropriate type such as typeof(MyClassWithGuidProperty). - parameterTypes: [typeof(object), typeof(IntPtr)]); + parameterTypes: [typeof(object), typeof(IntPtr)]); ILGenerator il = methodBuilder.GetILGenerator(); il.Emit(OpCodes.Ldarg_0); // this @@ -489,7 +489,7 @@ void CheckAssembly(Assembly a) Assert.Equal(42, field.GetRawConstantValue()); field = type4.GetField("FieldOffset"); Assert.NotNull(field); - + field = type4.GetField("FieldModopt"); var cmods = field.GetRequiredCustomModifiers(); Assert.Equal(1, cmods.Length); diff --git a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveConstructorBuilderTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveConstructorBuilderTests.cs index 34fe5c2aec3278..1b061f5fabbc3b 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveConstructorBuilderTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveConstructorBuilderTests.cs @@ -7,7 +7,7 @@ namespace System.Reflection.Emit.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class AssemblySaveConstructorBuilderTests { [Fact] diff --git a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveCustomAttributeTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveCustomAttributeTests.cs index 1fd2d53188361a..89d496684e8099 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveCustomAttributeTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveCustomAttributeTests.cs @@ -11,7 +11,7 @@ namespace System.Reflection.Emit.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class AssemblySaveCustomAttributeTests { private List _attributes = new List @@ -208,7 +208,7 @@ public void CreateStructWithPseudoCustomAttributesTest() Type testType = moduleFromDisk.GetTypes()[0]; IList attributesFromDisk = testType.GetCustomAttributesData(); - Assert.Equal(typeAttributes.Count - 3, attributesFromDisk.Count); // 3 pseudo attributes + Assert.Equal(typeAttributes.Count - 3, attributesFromDisk.Count); // 3 pseudo attributes Assert.True((testType.Attributes & TypeAttributes.Serializable) != 0); // SerializableAttribute Assert.True((testType.Attributes & TypeAttributes.SpecialName) != 0); // SpecialNameAttribute Assert.True((testType.Attributes & TypeAttributes.ExplicitLayout) != 0); // StructLayoutAttribute diff --git a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveEnumBuilderTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveEnumBuilderTests.cs index b10126675568e3..809a3e5a1bb011 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveEnumBuilderTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveEnumBuilderTests.cs @@ -8,7 +8,7 @@ namespace System.Reflection.Emit.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class AssemblySaveEnumBuilderTests { private static AssemblyName PopulateAssemblyName() diff --git a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveEventBuilderTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveEventBuilderTests.cs index f4692afe194986..8f8e5cfbd75420 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveEventBuilderTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveEventBuilderTests.cs @@ -9,7 +9,7 @@ namespace System.Reflection.Emit.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class AssemblySaveEventBuilderTests { [Fact] diff --git a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveILGeneratorTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveILGeneratorTests.cs index 2b155556c5f2ab..39d0f74aae4534 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveILGeneratorTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveILGeneratorTests.cs @@ -10,7 +10,7 @@ namespace System.Reflection.Emit.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class AssemblySaveILGeneratorTests { [Fact] @@ -219,7 +219,7 @@ public void ILMaxStack_Test() il1.Emit(OpCodes.Ldarg_2); // push 1 MaxStack 7 il1.Emit(OpCodes.Ldc_I4_5); // push 1 MaxStack 8 il1.Emit(OpCodes.Ldarg_1); // push 1 MaxStack 9 - il1.Emit(OpCodes.Add); // pop 2 push 1 stack size 8 + il1.Emit(OpCodes.Add); // pop 2 push 1 stack size 8 il1.Emit(OpCodes.Sub); // pop 2 push 1 stack size 7 il1.Emit(OpCodes.Mul); // pop 2 push 1 stack size 6 il1.Emit(OpCodes.Add); // pop 2 push 1 stack size 5 @@ -630,7 +630,7 @@ public void ReferenceFieldAndMethodsInIL() MethodBuilder methodMultiply = tb.DefineMethod("Multiply", MethodAttributes.Public, typeof(int), [typeof(int)]); /* class MyType - { + { private int _field; int Multiply(int value) => _field * value; void Main(int a) @@ -643,7 +643,7 @@ void Main(int a) ILGenerator il = methodMultiply.GetILGenerator(); il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Ldfld, field); - il.Emit(OpCodes.Ldarg_1); + il.Emit(OpCodes.Ldarg_1); il.Emit(OpCodes.Mul); il.Emit(OpCodes.Ret); @@ -888,7 +888,7 @@ public void ReferenceStaticFieldAndMethodsInIL() FieldBuilder field = anotherType.DefineField("StaticField", typeof(int), FieldAttributes.Public | FieldAttributes.Static); MethodBuilder staticMethod = anotherType.DefineMethod("StaticMethod", MethodAttributes.Public | MethodAttributes.Static, typeof(void), Type.EmptyTypes); /*class MyType - { + { int Main(int a) { AnotherType.StaticField = a; @@ -2327,7 +2327,7 @@ static void GetCode() // Unreachable. ilg.Emit(OpCodes.Ldarg_0); - // Depth + // Depth ilg.MarkLabel(lab); ilg.Emit(OpCodes.Add); ilg.Emit(OpCodes.Ret); diff --git a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveModuleBuilderTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveModuleBuilderTests.cs index 0c8a7a2aae81cf..0731f8754f964b 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveModuleBuilderTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveModuleBuilderTests.cs @@ -7,7 +7,7 @@ namespace System.Reflection.Emit.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class AssemblySaveModuleBuilderTests { [Fact] diff --git a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySavePropertyBuilderTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySavePropertyBuilderTests.cs index 6bff85e29e928e..60dfad0dcd0775 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySavePropertyBuilderTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySavePropertyBuilderTests.cs @@ -10,7 +10,7 @@ namespace System.Reflection.Emit.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class AssemblySavePropertyBuilderTests { [Fact] diff --git a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveTypeBuilderAPIsTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveTypeBuilderAPIsTests.cs index 9cf05f68a6f71e..74ab67d8d60622 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveTypeBuilderAPIsTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveTypeBuilderAPIsTests.cs @@ -9,7 +9,7 @@ namespace System.Reflection.Emit.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class AssemblySaveTypeBuilderAPIsTests { [Fact] diff --git a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveTypeBuilderTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveTypeBuilderTests.cs index b052a2861961b6..1894d8d5f35b86 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveTypeBuilderTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveTypeBuilderTests.cs @@ -11,7 +11,7 @@ namespace System.Reflection.Emit.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class AssemblySaveTypeBuilderTests { private static readonly AssemblyName s_assemblyName = new AssemblyName("MyDynamicAssembly") diff --git a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineField.cs b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineField.cs index 4b7613157c3c2a..19481655258161 100644 --- a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineField.cs +++ b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineField.cs @@ -60,7 +60,7 @@ public void DefineField(string name, Type fieldType, FieldAttributes attributes, } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [MemberData(nameof(TestData))] public void DefineFieldPersistedAssembly(string name, Type fieldType, FieldAttributes attributes, FieldAttributes expectedAttributes) { @@ -108,7 +108,7 @@ public void DefineField_NameCollision() Assert.Throws(() => createdType.GetField("FieldName", Helpers.AllFlags)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void DefineField_NameCollisionPersistedAssembly() { PersistedAssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderAndTypeBuilder(out TypeBuilder type); @@ -144,7 +144,7 @@ public void DefineField_65536Fields() Assert.Throws(() => type.CreateType()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void DefineField_65536FieldsPersistedAssembly() { PersistedAssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderAndTypeBuilder(out TypeBuilder type); @@ -179,7 +179,7 @@ public void DefineFieldMethod_LongName() Assert.Equal(Helpers.s_512Chars, method.Name); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void DefineFieldMethod_LongNamePersistedAssembly() { PersistedAssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderAndTypeBuilder(out TypeBuilder type); diff --git a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineMethod.cs b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineMethod.cs index 1694945863f92b..9989ef29c60598 100644 --- a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineMethod.cs +++ b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineMethod.cs @@ -95,7 +95,7 @@ public void DefineMethod(string name, MethodAttributes attributes, CallingConven VerifyMethod(type4, method4, name, attributes, callingConvention, returnType, parameterTypes); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [MemberData(nameof(TestData))] public void DefineMethodPersistedAssembly(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) { @@ -136,10 +136,10 @@ public void DefineMethod_65536Methods() // System.TypeLoadException : Type 'TestType' from assembly 'TestAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' // contains more methods than the current implementation allows. - Assert.Throws(() => type.CreateType()); + Assert.Throws(() => type.CreateType()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [ActiveIssue("https://github.com/dotnet/runtime/issues/2389", TestRuntimes.Mono)] public void DefineMethod_65536MethodsPersistedAssembly() { diff --git a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineProperty.cs b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineProperty.cs index 99d0d572eb418f..011e2308a1f372 100644 --- a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineProperty.cs +++ b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineProperty.cs @@ -50,7 +50,7 @@ public void DefineProperty(string name, PropertyAttributes attributes, Type retu Assert.Equal(returnType ?? typeof(void), createdProperty.PropertyType); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [MemberData(nameof(TestData))] public void DefinePropertyPersistedAssembly(string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes, string expectedName, PropertyAttributes _) { @@ -91,10 +91,10 @@ public void DefineProperty_NameCollision() Assert.Equal(2, properties.Length); Assert.Equal("PropertyName", properties[0].Name); Assert.Equal("PropertyName", properties[1].Name); - Assert.Throws(() => createdType.GetProperty("PropertyName", Helpers.AllFlags)); + Assert.Throws(() => createdType.GetProperty("PropertyName", Helpers.AllFlags)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void DefineProperty_NameCollisionPersistedAssembly() { PersistedAssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderAndTypeBuilder(out TypeBuilder type); diff --git a/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs b/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs index 00e924fcb47b0a..3292f12de6d7b8 100644 --- a/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.IO; using System.Reflection; using System.Reflection.Emit; @@ -106,8 +107,7 @@ public static void LoadFromAssemblyName_AssemblyNotFound() Assert.Throws(() => loadContext.LoadFromAssemblyName(asmName)); } - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Corelib does not exist on disc for Browser builds")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public static void LoadFromAssemblyName_ValidTrustedPlatformAssembly() { var asmName = typeof(System.Linq.Enumerable).Assembly.GetName(); diff --git a/src/libraries/System.Runtime.Loader/tests/ContextualReflection.cs b/src/libraries/System.Runtime.Loader/tests/ContextualReflection.cs index 1d61dbd4afd493..8e035c8038b4bc 100644 --- a/src/libraries/System.Runtime.Loader/tests/ContextualReflection.cs +++ b/src/libraries/System.Runtime.Loader/tests/ContextualReflection.cs @@ -144,6 +144,7 @@ public void FixtureSetupAssertions() } [ActiveIssue("https://github.com/mono/mono/issues/15142", TestRuntimes.Mono)] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class ContextualReflectionTest : IClassFixture { IContextualReflectionTestFixture _fixture; diff --git a/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs b/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs index 227f4d9111a1ff..ab0814f4e1e7be 100644 --- a/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs @@ -85,7 +85,7 @@ private Assembly ResolveNullAssembly(AssemblyLoadContext sender, AssemblyName as // Does not apply to Mono AOT scenarios as it is expected the name of the .aotdata file matches // the true name of the assembly and not the physical file name. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadInDefaultContext() { // This will attempt to load an assembly, by path, in the Default Load context via the Resolving event diff --git a/src/libraries/System.Runtime.Loader/tests/RefEmitLoadContext/RefEmitLoadContextTest.cs b/src/libraries/System.Runtime.Loader/tests/RefEmitLoadContext/RefEmitLoadContextTest.cs index 1863ad3767d1f1..3694e501adb48d 100644 --- a/src/libraries/System.Runtime.Loader/tests/RefEmitLoadContext/RefEmitLoadContextTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/RefEmitLoadContext/RefEmitLoadContextTest.cs @@ -64,7 +64,7 @@ private static void DeleteDirectory() catch { } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] [ActiveIssue("https://github.com/dotnet/runtime/issues/31804", TestRuntimes.Mono)] public static void LoadRefEmitAssembly() { diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs index 91afc052ae742c..7f5599020944f7 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs @@ -1116,7 +1116,7 @@ public static void DCS_TypeNamesWithSpecialCharacters() Assert.Equal(x.PropertyNameWithSpecialCharacters\u6F22\u00F1, y.PropertyNameWithSpecialCharacters\u6F22\u00F1); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] #if XMLSERIALIZERGENERATORTESTS // Lack of AssemblyDependencyResolver results in assemblies that are not loaded by path to get // loaded in the default ALC, which causes problems for this test. @@ -1135,7 +1135,7 @@ public static void DCS_TypeInCollectibleALC() Assert.True(!weakRef.IsAlive); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] #if XMLSERIALIZERGENERATORTESTS // Lack of AssemblyDependencyResolver results in assemblies that are not loaded by path to get // loaded in the default ALC, which causes problems for this test. diff --git a/src/libraries/System.Runtime/tests/System.Globalization.Calendars.Tests/CalendarTestWithConfigSwitch/CalendarTests.cs b/src/libraries/System.Runtime/tests/System.Globalization.Calendars.Tests/CalendarTestWithConfigSwitch/CalendarTests.cs index 4d1205811b8608..804a3a55b270ae 100644 --- a/src/libraries/System.Runtime/tests/System.Globalization.Calendars.Tests/CalendarTestWithConfigSwitch/CalendarTests.cs +++ b/src/libraries/System.Runtime/tests/System.Globalization.Calendars.Tests/CalendarTestWithConfigSwitch/CalendarTests.cs @@ -10,6 +10,7 @@ namespace System.Globalization.Tests public static class CalendarTests { [Fact] + [SkipOnPlatform(TestPlatforms.Android, "Doesn't throw on mobile")] public static void TestJapaneseCalendarDateParsing() { CultureInfo ciJapanese = new CultureInfo("ja-JP") { DateTimeFormat = { Calendar = new JapaneseCalendar() } }; diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/DisabledFileLockingTests/DisabledFileLockingSwitchTests.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/DisabledFileLockingTests/DisabledFileLockingSwitchTests.cs index 736991961ac96e..8b83bae43f2f65 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/DisabledFileLockingTests/DisabledFileLockingSwitchTests.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/DisabledFileLockingTests/DisabledFileLockingSwitchTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using Xunit; namespace System.IO.Tests @@ -8,6 +9,7 @@ namespace System.IO.Tests public class DisabledFileLockingSwitchTests { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951", typeof(PlatformDetection), nameof(PlatformDetection.IsSingleFile))] public static void ConfigSwitchIsHonored() { Assert.Equal(OperatingSystem.IsWindows(), PlatformDetection.IsFileLockingEnabled); diff --git a/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs b/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs index 57a5e1277fcfe9..eff32bc09ffe5f 100644 --- a/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs +++ b/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs @@ -39,7 +39,7 @@ public class AssemblyTests : FileCleanupTestBase public AssemblyTests() { - if (PlatformDetection.IsAssemblyLoadingSupported) + if (PlatformDetection.IsAssemblyLoadingSupported && PlatformDetection.HasAssemblyFiles) { // Assembly.Location does not return the file path for single-file deployment targets. DestTestAssemblyPath = Path.Combine(base.TestDirectory, s_sourceTestAssemblyName); @@ -229,7 +229,7 @@ public void GetFile() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void GetFile_InMemory() { var inMemBlob = File.ReadAllBytes(SourceTestAssemblyPath); @@ -241,7 +241,7 @@ public void GetFile_InMemory() Assert.Throws(() => asm.GetFiles(getResourceModules: false)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void CodeBaseInMemory() { var inMemBlob = File.ReadAllBytes(SourceTestAssemblyPath); @@ -392,7 +392,7 @@ public void Load_Invalid() Assert.Throws(() => Assembly.Load(new AssemblyName("no such assembly"))); // No such assembly } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadFile() { Assembly currentAssembly = typeof(AssemblyTests).Assembly; @@ -416,20 +416,20 @@ public void LoadFile() Assert.Equal(loadedAssembly1, loadedAssembly2); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadFile_NullPath_ThrowsArgumentNullException() { AssertExtensions.Throws("path", () => Assembly.LoadFile(null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadFile_NoSuchPath_ThrowsFileNotFoundException() { string rootedPath = Path.GetFullPath(Guid.NewGuid().ToString("N")); AssertExtensions.ThrowsContains(() => Assembly.LoadFile(rootedPath), rootedPath); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadFile_PartiallyQualifiedPath_ThrowsArgumentException() { string path = "System.Runtime.Tests.dll"; @@ -439,7 +439,7 @@ public void LoadFile_PartiallyQualifiedPath_ThrowsArgumentException() // This test should apply equally to Unix, but this reliably hits a particular one of the // myriad ways that assembly load can fail - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] [PlatformSpecific(TestPlatforms.Windows)] public void LoadFile_ValidPEBadIL_ThrowsBadImageFormatExceptionWithPath() { @@ -450,7 +450,7 @@ public void LoadFile_ValidPEBadIL_ThrowsBadImageFormatExceptionWithPath() AssertExtensions.ThrowsContains(() => Assembly.LoadFile(path), path); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] [InlineData(0)] [InlineData(5)] [InlineData(50)] @@ -471,20 +471,20 @@ public void LoadFile_ValidPEBadIL_ThrowsBadImageFormatExceptionWithPath_ByInitia } #pragma warning disable SYSLIB0056 // AssemblyHashAlgorithm overload is not supported and throws NotSupportedException. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadFromUsingHashValue() { Assert.Throws(() => Assembly.LoadFrom("abc", null, System.Configuration.Assemblies.AssemblyHashAlgorithm.SHA1)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadFrom_WithHashValue_ThrowsNotSupportedException() { Assert.Throws(() => Assembly.LoadFrom(DestTestAssemblyPath, new byte[0], Configuration.Assemblies.AssemblyHashAlgorithm.None)); } #pragma warning restore SYSLIB0056 // AssemblyHashAlgorithm overload is not supported and throws NotSupportedException. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadFrom_SamePath_ReturnsEqualAssemblies() { Assembly assembly1 = Assembly.LoadFrom(DestTestAssemblyPath); @@ -492,7 +492,7 @@ public void LoadFrom_SamePath_ReturnsEqualAssemblies() Assert.Equal(assembly1, assembly2); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadFrom_SameIdentityAsAssemblyWithDifferentPath_ReturnsEqualAssemblies() { Assembly assembly1 = Assembly.LoadFrom(AssemblyPathHelper.GetAssemblyLocation(typeof(AssemblyTests).Assembly)); @@ -503,28 +503,28 @@ public void LoadFrom_SameIdentityAsAssemblyWithDifferentPath_ReturnsEqualAssembl Assert.Equal(assembly1, assembly2); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadFrom_NullAssemblyFile_ThrowsArgumentNullException() { AssertExtensions.Throws("assemblyFile", () => Assembly.LoadFrom(null)); AssertExtensions.Throws("assemblyFile", () => Assembly.UnsafeLoadFrom(null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadFrom_EmptyAssemblyFile_ThrowsArgumentException() { AssertExtensions.Throws("path", null, (() => Assembly.LoadFrom(""))); AssertExtensions.Throws("path", null, (() => Assembly.UnsafeLoadFrom(""))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadFrom_NoSuchFile_ThrowsFileNotFoundException() { Assert.Throws(() => Assembly.LoadFrom("NoSuchPath")); Assert.Throws(() => Assembly.UnsafeLoadFrom("NoSuchPath")); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void UnsafeLoadFrom_SamePath_ReturnsEqualAssemblies() { Assembly assembly1 = Assembly.UnsafeLoadFrom(DestTestAssemblyPath); @@ -532,7 +532,7 @@ public void UnsafeLoadFrom_SamePath_ReturnsEqualAssemblies() Assert.Equal(assembly1, assembly2); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadModule() { Assembly assembly = typeof(AssemblyTests).Assembly; @@ -567,7 +567,7 @@ public void Location_ExecutingAssembly_IsNotNull() } #pragma warning disable SYSLIB0012 - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] // single file + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser), nameof(PlatformDetection.HasAssemblyFiles))] // single file public void CodeBase() { if (PlatformDetection.IsNativeAot) @@ -819,7 +819,7 @@ public void AssemblyLoadFromStringNeg() Assert.Throws(() => Assembly.Load("no such assembly")); // No such assembly } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void AssemblyLoadFromBytes() { Assembly assembly = typeof(AssemblyTests).Assembly; @@ -843,8 +843,9 @@ public void AssemblyLoadFromBytesNeg() Assert.Throws(() => Assembly.Load(new byte[0])); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Symbols are in a different location on iOS/tvOS/MacCatalyst")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951", TestPlatforms.Android)] public void AssemblyLoadFromBytesWithSymbols() { Assembly assembly = typeof(AssemblyTests).Assembly; @@ -864,7 +865,7 @@ public void AssemblyReflectionOnlyLoadFromString() Assert.Throws(() => Assembly.ReflectionOnlyLoad(an.FullName)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] public void AssemblyReflectionOnlyLoadFromBytes() { Assembly assembly = typeof(AssemblyTests).Assembly; diff --git a/src/libraries/System.Runtime/tests/System.Reflection.Tests/CoreCLR/AssemblyTests.cs b/src/libraries/System.Runtime/tests/System.Reflection.Tests/CoreCLR/AssemblyTests.cs index 5e043eb306f63c..0146537db43527 100644 --- a/src/libraries/System.Runtime/tests/System.Reflection.Tests/CoreCLR/AssemblyTests.cs +++ b/src/libraries/System.Runtime/tests/System.Reflection.Tests/CoreCLR/AssemblyTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.IO; using System.Runtime.Loader; using Xunit; @@ -9,8 +10,7 @@ namespace System.Reflection.Tests { public class AssemblyTests { - [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/39650", TestPlatforms.Browser)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void CurrentLocation_HasLocaton() { string location = GetExecutingAssembly().Location; diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/AppDomainTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/AppDomainTests.cs index e3c0a312eab3bb..54c473bf00b8d3 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/AppDomainTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/AppDomainTests.cs @@ -366,7 +366,7 @@ public void Load() Assert.NotNull(AppDomain.CurrentDomain.Load(typeof(AppDomainTests).Assembly.FullName)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.HasAssemblyFiles))] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser.")] public void LoadBytes() { @@ -792,7 +792,7 @@ private void CopyTestAssemblies() string rootPath; string assemblyResolvePath = "AssemblyResolveTestApp"; string appOutsideTPAPath = "TestAppOutsideOfTPA"; - + if (PlatformDetection.IsiOS || PlatformDetection.IstvOS) { rootPath = Path.GetTempPath(); @@ -839,7 +839,7 @@ public static void GetPermissionSet() #pragma warning restore SYSLIB0003 // Obsolete: CAS } - public static bool FileCreateCaseSensitiveAndAssemblyLoadingSupported => PlatformDetection.FileCreateCaseSensitive && PlatformDetection.IsAssemblyLoadingSupported; + public static bool FileCreateCaseSensitiveAndAssemblyLoadingSupported => PlatformDetection.FileCreateCaseSensitive && PlatformDetection.IsAssemblyLoadingSupported && PlatformDetection.HasAssemblyFiles; [ConditionalTheory(nameof(FileCreateCaseSensitiveAndAssemblyLoadingSupported))] [MemberData(nameof(TestingCreateInstanceFromObjectHandleData))] diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/EnvironmentTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/EnvironmentTests.cs index 6d8e5372051759..a73dcc6a91a583 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/EnvironmentTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/EnvironmentTests.cs @@ -94,7 +94,7 @@ public void ProcessPath_Idempotent() } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Throws PNSE")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.Android, "Throws PNSE")] public void ProcessPath_MatchesExpectedValue() { string expectedProcessPath = PlatformDetection.IsBrowser ? null : Process.GetCurrentProcess().MainModule.FileName; diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/ExceptionTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/ExceptionTests.cs index 4ad6379e4069d1..885b5a1ce0433d 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/ExceptionTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/ExceptionTests.cs @@ -109,6 +109,7 @@ public static void Exception_TargetSite_Rethrow() [Fact] [ActiveIssue("https://github.com/mono/mono/issues/15140", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951", TestPlatforms.Android)] public static void ThrowStatementDoesNotResetExceptionStackLineSameMethod() { (string, string, int) rethrownExceptionStackFrame = (null, null, 0); @@ -139,6 +140,7 @@ private static (string, string, int) ThrowAndRethrowSameMethod(out (string, stri [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue(https://github.com/dotnet/runtime/issues/1871)] can't use ActiveIssue for archs [ActiveIssue("https://github.com/mono/mono/issues/15141", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951", TestPlatforms.Android)] public static void ThrowStatementDoesNotResetExceptionStackLineOtherMethod() { (string, string, int) rethrownExceptionStackFrame = (null, null, 0); diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorIncrementalTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorIncrementalTests.cs index 5bcb01a94bde9a..115181e2079028 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorIncrementalTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorIncrementalTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -11,10 +12,9 @@ namespace System.Text.Json.SourceGeneration.UnitTests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/58226", TestPlatforms.Browser)] [SkipOnCoreClr("https://github.com/dotnet/runtime/issues/71962", ~RuntimeConfiguration.Release)] [SkipOnMono("https://github.com/dotnet/runtime/issues/92467")] - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotX86Process))] // https://github.com/dotnet/runtime/issues/71962 + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotX86Process), nameof(PlatformDetection.HasAssemblyFiles))] // https://github.com/dotnet/runtime/issues/71962 public static class JsonSourceGeneratorIncrementalTests { [Theory] @@ -44,12 +44,12 @@ public static void CompilingEquivalentSourcesResultsInEqualModels() { string source1 = """ using System.Text.Json.Serialization; - + namespace Test { [JsonSerializable(typeof(MyPoco))] public partial class JsonContext : JsonSerializerContext { } - + public class MyPoco { public int MyProperty { get; set; } = 42; @@ -60,7 +60,7 @@ public class MyPoco string source2 = """ using System; using System.Text.Json.Serialization; - + namespace Test { // Same as above but with different implementation @@ -100,12 +100,12 @@ public static void CompilingDifferentSourcesResultsInUnequalModels() { string source1 = """ using System.Text.Json.Serialization; - + namespace Test { [JsonSerializable(typeof(MyPoco))] public partial class JsonContext : JsonSerializerContext { } - + public class MyPoco { public int MyProperty { get; set; } = 42; @@ -115,12 +115,12 @@ public class MyPoco string source2 = """ using System.Text.Json.Serialization; - + namespace Test { [JsonSerializable(typeof(MyPoco))] public partial class JsonContext : JsonSerializerContext { } - + public class MyPoco { public int MyProperty { get; } = 42; // same, but missing a getter @@ -248,12 +248,12 @@ public static void IncrementalGenerator_EquivalentSources_DoesNotRegenerate() string source1 = """ using System; using System.Text.Json.Serialization; - + namespace Test { [JsonSerializable(typeof(MyPoco))] public partial class JsonContext : JsonSerializerContext { } - + public class MyPoco { public string MyProperty { get; set; } = 42; @@ -264,7 +264,7 @@ public class MyPoco string source2 = """ using System; using System.Text.Json.Serialization; - + namespace Test { // Same as above but with different implementation @@ -317,12 +317,12 @@ public static void IncrementalGenerator_DifferentSources_Regenerates() string source1 = """ using System; using System.Text.Json.Serialization; - + namespace Test { [JsonSerializable(typeof(MyPoco))] public partial class JsonContext : JsonSerializerContext { } - + public class MyPoco { public string MyProperty { get; set; } = 42; @@ -333,12 +333,12 @@ public class MyPoco string source2 = """ using System; using System.Text.Json.Serialization; - + namespace Test { [JsonSerializable(typeof(MyPoco))] public partial class JsonContext : JsonSerializerContext { } - + public class MyPoco { public string MyProperty { get; } = 42; // same, but missing a getter diff --git a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/RegexGeneratorHelper.netcoreapp.cs b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/RegexGeneratorHelper.netcoreapp.cs index 90e638570f629f..677bf16d32ff0a 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/RegexGeneratorHelper.netcoreapp.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/RegexGeneratorHelper.netcoreapp.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; @@ -21,6 +22,7 @@ namespace System.Text.RegularExpressions.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public static class RegexGeneratorHelper { private static readonly CSharpParseOptions s_previewParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview).WithDocumentationMode(DocumentationMode.Diagnose); diff --git a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/UpgradeToGeneratedRegexAnalyzerTests.cs b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/UpgradeToGeneratedRegexAnalyzerTests.cs index 2a8b634e78d973..afc509f070c136 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/UpgradeToGeneratedRegexAnalyzerTests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/UpgradeToGeneratedRegexAnalyzerTests.cs @@ -15,6 +15,7 @@ namespace System.Text.RegularExpressions.Tests { [ActiveIssue("https://github.com/dotnet/runtime/issues/69823", TestRuntimes.Mono)] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public class UpgradeToGeneratedRegexAnalyzerTests { private const string UseRegexSourceGeneratorDiagnosticId = @"SYSLIB1045"; diff --git a/src/libraries/System.Threading/tests/MutexTests.cs b/src/libraries/System.Threading/tests/MutexTests.cs index b83cfd571fa203..de4cc8bb7eaf2e 100644 --- a/src/libraries/System.Threading/tests/MutexTests.cs +++ b/src/libraries/System.Threading/tests/MutexTests.cs @@ -236,6 +236,7 @@ public void Ctor_InvalidNames_Unix() [Theory] [MemberData(nameof(GetValidNames))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void Ctor_ValidName(string name) { bool createdNew; @@ -317,6 +318,7 @@ public void Ctor_TryCreateGlobalMutexTest_Uwp(bool currentUserOnly, bool current [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [MemberData(nameof(GetValidNames))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void OpenExisting(string name) { Mutex resultHandle; @@ -350,6 +352,7 @@ public void OpenExisting_InvalidNames() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void OpenExisting_UnavailableName() { string name = Guid.NewGuid().ToString("N"); @@ -386,6 +389,7 @@ public void NamedWaitHandleOptionsTest() [Theory] [MemberData(nameof(NamePrefixes_MemberData))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void NameOptionsApiCompatibilityTest(string namePrefix) { string name = Guid.NewGuid().ToString("N"); @@ -447,6 +451,7 @@ public static IEnumerable NamePrefixAndOptionsCompatibilityTest_Member [Theory] [MemberData(nameof(NamePrefixAndOptionsCompatibilityTest_MemberData))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void NamePrefixAndOptionsCompatibilityTest(bool currentUserOnly, bool currentSessionOnly, string namePrefix) { string name = namePrefix + Guid.NewGuid().ToString("N"); @@ -478,6 +483,7 @@ public static IEnumerable NameNamespaceTests_MemberData() [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoNorServerCore))] // Windows Nano Server and Server Core apparently use the same namespace for the Local\ and Global\ prefixes [MemberData(nameof(NameNamespaceTests_MemberData))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void NameNamespaceTest( bool create_currentUserOnly, bool create_currentSessionOnly, @@ -592,6 +598,7 @@ public static IEnumerable AbandonExisting_MemberData() [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [MemberData(nameof(AbandonExisting_MemberData))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void AbandonExisting( string name, WaitHandleWaitType waitType, @@ -845,6 +852,7 @@ private static void IncrementValueInFileNTimes(Mutex mutex, string fileName, int [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/96191", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void NamedMutex_ThreadExitDisposeRaceTest() { var mutexName = Guid.NewGuid().ToString("N"); @@ -906,6 +914,7 @@ public void NamedMutex_ThreadExitDisposeRaceTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114951",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void NamedMutex_DisposeWhenLockedRaceTest() { var mutexName = Guid.NewGuid().ToString("N"); diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index f45117efae117b..9bf6d8eba21cb4 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -193,90 +193,60 @@ - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - + + + + + + - - - - + + - - - - - + - - - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mono/msbuild/android/build/AndroidBuild.targets b/src/mono/msbuild/android/build/AndroidBuild.targets index 5e45180b07960a..56dd94a5983986 100644 --- a/src/mono/msbuild/android/build/AndroidBuild.targets +++ b/src/mono/msbuild/android/build/AndroidBuild.targets @@ -22,7 +22,7 @@ <_MobileIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'mobile')) $(PlatformTarget) $(AssemblyName) - False + false diff --git a/src/mono/msbuild/apple/build/AppleBuild.props b/src/mono/msbuild/apple/build/AppleBuild.props index a3fc8dc30b3be1..ba3ff16ac72337 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.props +++ b/src/mono/msbuild/apple/build/AppleBuild.props @@ -17,7 +17,7 @@ true true - false + false <_IsLibraryMode Condition="('$(UseNativeAOTRuntime)' != 'true' and '$(NativeLib)' != '') or ('$(UseNativeAOTRuntime)' == 'true' and '$(NativeLib)' == 'Shared')">true diff --git a/src/mono/sample/Android/AndroidSampleApp.csproj b/src/mono/sample/Android/AndroidSampleApp.csproj index 74ce1168a1ab57..b0f10b8c163825 100644 --- a/src/mono/sample/Android/AndroidSampleApp.csproj +++ b/src/mono/sample/Android/AndroidSampleApp.csproj @@ -9,7 +9,6 @@ Link false $(ForceAOT) - True HelloAndroid $(AssemblyName).dll true diff --git a/src/tasks/AndroidAppBuilder/ApkBuilder.cs b/src/tasks/AndroidAppBuilder/ApkBuilder.cs index 9944e69d31e469..21fd800c89681a 100644 --- a/src/tasks/AndroidAppBuilder/ApkBuilder.cs +++ b/src/tasks/AndroidAppBuilder/ApkBuilder.cs @@ -195,11 +195,8 @@ public ApkBuilder(TaskLoggingHelper logger) Directory.CreateDirectory(Path.Combine(OutputDir, "assets")); var extensionsToIgnore = new List { ".so", ".a", ".dex", ".jar" }; - if (StripDebugSymbols) - { - extensionsToIgnore.Add(".pdb"); - extensionsToIgnore.Add(".dbg"); - } + extensionsToIgnore.Add(".pdb"); + extensionsToIgnore.Add(".dbg"); // Copy sourceDir to OutputDir/assets-tozip (ignore native files) // these files then will be zipped and copied to apk/assets/assets.zip @@ -391,6 +388,8 @@ public ApkBuilder(TaskLoggingHelper logger) project.GenerateCMake(OutputDir, MinApiLevel, StripDebugSymbols); project.BuildCMake(OutputDir, StripDebugSymbols); + // TODO: https://github.com/dotnet/runtime/issues/115717 + string abi = project.Abi; // 2. Compile Java files diff --git a/src/tests/build.proj b/src/tests/build.proj index 2a6dc297f2d7da..f0ccb7759a9120 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -211,9 +211,8 @@ $(IntermediateOutputPath)\AndroidApps\$(Category) $(BuildDir)\apk $(XUnitTestBinBase)$(CategoryWithSlash)\$(Category).apk - False 127.0.0.1:9000,nosuspend,listen - True + true $(ArtifactsBinDir)microsoft.netcore.app.runtime.android-$(TargetArchitecture)\$(Configuration)\runtimes\android-$(TargetArchitecture)\ arm64-v8a armeabi-v7a