diff --git a/Directory.Build.props b/Directory.Build.props index 1f4335e3f095d..043dbed1f5f74 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -20,6 +20,7 @@ <_hostOS Condition="'$(TargetOS)' == 'Browser'">Browser $(_hostOS) true + true diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml index b9c723e0ebf7b..8e5e8630500e3 100644 --- a/eng/pipelines/runtime-staging.yml +++ b/eng/pipelines/runtime-staging.yml @@ -172,7 +172,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:EnableSoftTrimming=true /p:BuildDarwinFrameworks=true + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true timeoutInMinutes: 180 condition: >- or( @@ -185,6 +185,7 @@ jobs: extraStepsParameters: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) + extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true condition: >- or( eq(variables['librariesContainsChange'], true), diff --git a/eng/testing/AppleHelixRunnerTemplate.sh b/eng/testing/AppleHelixRunnerTemplate.sh new file mode 100644 index 0000000000000..467b98f3d5d74 --- /dev/null +++ b/eng/testing/AppleHelixRunnerTemplate.sh @@ -0,0 +1,5 @@ +XHARNESS_EXECUTION_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +XHARNESS_OUT="$XHARNESS_EXECUTION_DIR/xharness-output" + +# RunCommands defined in tests.mobile.targets +[[RunCommands]] \ No newline at end of file diff --git a/eng/testing/AppleRunnerTemplate.sh b/eng/testing/AppleRunnerTemplate.sh index 42f787af20d88..0ebff54c48393 100644 --- a/eng/testing/AppleRunnerTemplate.sh +++ b/eng/testing/AppleRunnerTemplate.sh @@ -7,15 +7,18 @@ ASSEMBLY_NAME=$1 TARGET_ARCH=$2 TARGET_OS=$3 TEST_NAME=$4 +CONFIGURATION=$5 XHARNESS_CMD="test" XHARNESS_OUT="$EXECUTION_DIR/xharness-output" XCODE_PATH=$(xcode-select -p)/../.. -if [ -n "$5" ]; then +if [ -n "$6" ]; then XHARNESS_CMD="run" - ADDITIONAL_ARGS=${@:5} + ADDITIONAL_ARGS=${@:6} fi +if [[ "$CONFIGURATION" != "Debug" ]]; then $CONFIGURATION="Release"; fi + if [[ "$TARGET_OS" == "maccatalyst" ]]; then TARGET=maccatalyst; fi if [[ "$TARGET_OS" == "iossimulator" && "$TARGET_ARCH" == "x86" ]]; then TARGET=ios-simulator-32; fi @@ -29,11 +32,11 @@ if [[ "$TARGET_OS" == "tvossimulator" && "$TARGET_ARCH" == "arm64" ]]; then TARG if [[ "$TARGET_OS" == "tvos" && "$TARGET_ARCH" == "arm64" ]]; then TARGET=tvos-device; fi # "Release" in SCHEME_SDK is what xcode produces (see "bool Optimized" property in AppleAppBuilderTask) -if [[ "$TARGET" == "ios-simulator-"* ]]; then SCHEME_SDK=Release-iphonesimulator; fi -if [[ "$TARGET" == "tvos-simulator" ]]; then SCHEME_SDK=Release-appletvsimulator; fi -if [[ "$TARGET" == "ios-device" ]]; then SCHEME_SDK=Release-iphoneos; fi -if [[ "$TARGET" == "tvos-device" ]]; then SCHEME_SDK=Release-appletvos; fi -if [[ "$TARGET" == "maccatalyst" ]]; then SCHEME_SDK=Release-maccatalyst; fi +if [[ "$TARGET" == "ios-simulator-"* ]]; then SCHEME_SDK=$CONFIGURATION-iphonesimulator; fi +if [[ "$TARGET" == "tvos-simulator" ]]; then SCHEME_SDK=$CONFIGURATION-appletvsimulator; fi +if [[ "$TARGET" == "ios-device" ]]; then SCHEME_SDK=$CONFIGURATION-iphoneos; fi +if [[ "$TARGET" == "tvos-device" ]]; then SCHEME_SDK=$CONFIGURATION-appletvos; fi +if [[ "$TARGET" == "maccatalyst" ]]; then SCHEME_SDK=$CONFIGURATION-maccatalyst; fi if [[ "$TARGET" == "ios-device" || "$TARGET" == "tvos-device" ]]; then SIGNAL_APP_END="--signal-app-end"; fi diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets new file mode 100644 index 0000000000000..8c7a6a44a5d22 --- /dev/null +++ b/eng/testing/tests.ioslike.targets @@ -0,0 +1,187 @@ + + + $(BundleTestAppTargets);BundleTestAppleApp + + + + helix + helix + local + + + + <_AOTBuildCommand>export PATH=$HELIX_CORRELATION_PAYLOAD/build/cmake/cmake-3.16.4-Darwin-x86_64/CMake.app/Contents/bin:$PATH && + <_AOTBuildCommand>$(_AOTBuildCommand) dotnet msbuild publish/ProxyProjectForAOTOnHelix.proj /bl:$XHARNESS_OUT/AOTBuild.binlog + + + <_AOTBuildCommand Condition="'$(ContinuousIntegrationBuild)' != 'true'">$(_AOTBuildCommand) /p:RuntimeSrcDir=$(RepoRoot) /p:RuntimeConfig=$(Configuration) + + <_AOTBuildCommand>$(_AOTBuildCommand) /p:XHARNESS_EXECUTION_DIR="$XHARNESS_EXECUTION_DIR" /p:RunAOTCompilation=$(RunAOTCompilation) /p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:MonoForceInterpreter=$(MonoForceInterpreter) /p:MonoEnableLLVM=true /p:DevTeamProvisioning=$(DevTeamProvisioning) /p:UsePortableRuntimePack=true /p:Configuration=$(Configuration) + <_AOTBuildCommand>$(_AOTBuildCommand) + + <_ResetSimulatorSwitch Condition="'$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOSSimulator'">--reset-simulator + <_SignalAppEndSwitch Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'">--signal-app-end + + <_AfterBuildCommands> + mv $XHARNESS_OUT/AOTBuild.binlog "$HELIX_WORKITEM_UPLOAD_ROOT" + sign "$app" + xharness apple test --app "$app" --output-directory "$output_directory" --target "$target" --timeout "$timeout" --xcode "$xcode_path" -v --launch-timeout "$launch_timeout" $(_ResetSimulatorSwitch) $(_SignalAppEndSwitch) -- + + + $(_AOTBuildCommand) $(_AfterBuildCommands) + + + + + + + PrepareForAppleBuildApp;$(AppleBuildAppDependsOn);_CopyTestArchive + + AppleBuildApp + $(BundleTestAppleAppDependsOn);_BundleAOTTestAppleAppForHelix;_CopyTestArchive + + + + + + + + + $(BundleDir)publish + + + + <_MainAssemblyPath Condition="'%(AppleAssembliesToBundle.FileName)' == $(AssemblyName) and '%(AppleAssembliesToBundle.Extension)' == '.dll'">%(AppleAssembliesToBundle.Identity) + $([System.IO.Path]::ChangeExtension($(_MainAssemblyPath), '.runtimeconfig.json')) + + + + + + + + + + + + + + <_BundlePdbFiles Include="$([System.IO.Path]::ChangeExtension('%(AppleAssembliesToBundle.Identity)', '.pdb'))" /> + + + + + + + + + <_PublishBundleFiles Include="@(BundleFiles->'$(AppBundlePath)/%(FileName)%(Extension)')" /> + + <_RuntimePackFiles Include="$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)**\*.*" /> + <_RuntimePackFiles Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)*.*" /> + + <_UnusedRuntimePackFiles Include="@(_PublishBundleFiles)" Exclude="@(_RuntimePackFiles->'$(AppBundlePath)/%(FileName)%(Extension)')" /> + <_UsedRuntimePackFiles Include="@(_PublishBundleFiles)" Exclude="@(_UnusedRuntimePackFiles)" /> + + <_RuntimePackFilesToDelete Include="@(_RuntimePackFiles->'$(AppBundlePath)/%(FileName)%(Extension)')" /> + + + + + + + + <_ApplePropertyNames Include="InvariantGlobalization" /> + <_ApplePropertyNames Include="AssemblyName" /> + <_ApplePropertyNames Include="MonoEnableLLVM" /> + + <_ApplePropertiesToPass + Include="$(%(_ApplePropertyNames.Identity))" + Name="%(_ApplePropertyNames.Identity)" + ConditionToUse__="%(_ApplePropertyNames.ConditionToUse__)" /> + + <_AppleUsedRuntimePackFiles + Include="@(_UsedRuntimePackFiles->'%(FileName)%(Extension)')" + RemoveMetadata="_IsNative;TargetDir" /> + + <_AppleItemsToPass Include="@(_AppleUsedRuntimePackFiles)" + OriginalItemName__="_AppleUsedRuntimePackFiles" /> + + + + + + + + + + + + + + + + true + AppleTestRunner.dll + + $(PublishDir) + $(BundleDir) + + + + true + false + false + true + + + + + <_InternalForceInterpret>true + <_IsNative>true + + + <_PublishAssemblies Include="$(PublishDir)\**\*.dll" Exclude="$(PublishDir)\**\*.resources.dll" /> + <_SatelliteAssemblies Include="$(PublishDir)\**\*.resources.dll" /> + + + <_InternalForceInterpret Condition="'$(UseMonoJustInterp)' == 'true' and '%(FileName)%(Extension)' != 'System.Private.CoreLib.dll'">true + <_IsNative>false + + + + + + + + + + + <_AppBundleDir>$(AppBundlePath)/../ + + + + + + + + + \ No newline at end of file diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 481a3091b64ac..17783b7ed5ec4 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -6,13 +6,16 @@ $(AppBundleRoot)runonly\$(AssemblyName) $([MSBuild]::NormalizeDirectory('$(PublishDir)', 'AppBundle')) $([MSBuild]::NormalizePath('$(BundleDir)', '$(RunScriptOutputName)')) - true - + true - BundleTestAppleApp;BundleTestAndroidApp + BundleTestAndroidApp Publish + + true + + true @@ -33,7 +36,8 @@ - --expected-exit-code $(ExpectedExitCode) + $(Configuration) + $(AdditionalXHarnessArguments) --expected-exit-code $(ExpectedExitCode) @@ -51,12 +55,15 @@ + + + <_MobileIntermediateOutputPath>$(IntermediateOutputPath)mobile - - @@ -149,126 +156,16 @@ Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'" /> - - - - - - - - - - - - - - true - AppleTestRunner.dll - <_MobileIntermediateOutputPath Condition="'$(RunAOTCompilation)' == 'true'">$(IntermediateOutputPath)mobile - true - false - false - true - - - Full - Full - JustInterp - - - <_AotExcludeAssemblies Include="$(PublishDir)System.Runtime.WindowsRuntime.dll" /> - <_AotExcludeAssemblies Include="@(NativeLibraries->'$(PublishDir)%(Identity)')" /> - - - <_AotIncludeAssemblies Condition="'$(RunAOTCompilation)' == 'true' and '$(AOTMode)' == 'JustInterp'" Include="$(PublishDir)System.Private.CoreLib.dll" /> - <_AotIncludeAssemblies Condition="'$(RunAOTCompilation)' == 'true' and '$(AOTMode)' != 'JustInterp'" Include="$(PublishDir)*.dll" /> - - - @(MonoAOTCompilerDefaultAotArguments, ';') - @(MonoAOTCompilerDefaultProcessArguments, ';') - - - <_BundleNonAotAssemblies Condition="'$(RunAOTCompilation)' == 'true' and '$(AOTMode)' == 'JustInterp'" Include="$(PublishDir)*.dll" Exclude="$(PublishDir)System.Private.CoreLib.dll" /> - - - - - - - - - - - - - - - - - - - - - - - - - <_appFiles Include="$(AppBundlePath)/../**/*" /> - - - - - - - - Link - CopyUsed + link + copyused - + + + + + + + - + + + RunnerTemplate.cmd RunnerTemplate.sh - AppleRunnerTemplate.sh + AppleHelixRunnerTemplate.sh + AppleRunnerTemplate.sh AndroidRunnerTemplate.sh WasmRunnerTemplate.sh WasmRunnerTemplate.cmd @@ -12,6 +13,7 @@ $(MSBuildThisFileDirectory)$(RunScriptInputName) RunTests.sh + build-apple-app.sh RunTests.cmd $([MSBuild]::NormalizePath('$(OutDir)', '$(RunScriptOutputName)')) @@ -42,9 +44,12 @@ + DependsOnTargets="GenerateRunScript;ZipTestArchive" /> + + diff --git a/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs b/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs index d61144d0e4313..44ea87e8a78a5 100644 --- a/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs +++ b/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs @@ -37,7 +37,8 @@ public void RootDisposesProviders() Assert.True(provider5.IsDisposed); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void RootDisposesChangeTokenRegistrations() { var changeToken = new ChangeToken(); diff --git a/src/libraries/Common/tests/System/Xml/XmlCoreTest/FilePathUtil.cs b/src/libraries/Common/tests/System/Xml/XmlCoreTest/FilePathUtil.cs index 982dedfede9da..4524d11ceab4c 100644 --- a/src/libraries/Common/tests/System/Xml/XmlCoreTest/FilePathUtil.cs +++ b/src/libraries/Common/tests/System/Xml/XmlCoreTest/FilePathUtil.cs @@ -42,6 +42,11 @@ public static string GetHttpStandardPath() return Path.Combine(GetHttpDataPath(), "StandardTests"); } + public static string GetWriteableTestRootPath() + { + return (PlatformDetection.IsiOS || PlatformDetection.IstvOS) ? Path.GetTempPath() : string.Empty; + } + public static string GetTestDataPath() { return Path.Combine(GetDataPath(), "TestData"); diff --git a/src/libraries/Common/tests/System/Xml/XmlCoreTest/XmlCoreTest.csproj b/src/libraries/Common/tests/System/Xml/XmlCoreTest/XmlCoreTest.csproj index ecef82389ff63..c83346ac205bc 100644 --- a/src/libraries/Common/tests/System/Xml/XmlCoreTest/XmlCoreTest.csproj +++ b/src/libraries/Common/tests/System/Xml/XmlCoreTest/XmlCoreTest.csproj @@ -19,5 +19,6 @@ + \ No newline at end of file diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index c4e2e657c07ab..b153e3f525e6a 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -38,8 +38,10 @@ public static partial class PlatformDetection public static bool IsSolaris => RuntimeInformation.IsOSPlatform(OSPlatform.Create("SOLARIS")); public static bool IsBrowser => RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")); public static bool IsNotBrowser => !IsBrowser; - public static bool IsMobile => IsBrowser || IsMacCatalyst || IsiOS || IstvOS || IsAndroid; + public static bool IsMobile => IsBrowser || IsAppleMobile || IsAndroid; public static bool IsNotMobile => !IsMobile; + public static bool IsAppleMobile => IsMacCatalyst || IsiOS || IstvOS; + public static bool IsNotAppleMobile => !IsAppleMobile; public static bool IsNotNetFramework => !IsNetFramework; public static bool IsArmProcess => RuntimeInformation.ProcessArchitecture == Architecture.Arm; @@ -61,9 +63,10 @@ public static partial class PlatformDetection public static bool IsThreadingSupported => !IsBrowser; public static bool IsBinaryFormatterSupported => IsNotMobile; + public static bool IsSymLinkSupported => !IsiOS && !IstvOS; public static bool IsSpeedOptimized => !IsSizeOptimized; - public static bool IsSizeOptimized => IsBrowser || IsAndroid || IsiOS || IstvOS || IsMacCatalyst; + public static bool IsSizeOptimized => IsBrowser || IsAndroid || IsAppleMobile; public static bool IsBrowserDomSupported => GetIsBrowserDomSupported(); public static bool IsBrowserDomSupportedOrNotBrowser => IsNotBrowser || GetIsBrowserDomSupported(); @@ -130,6 +133,7 @@ public static bool IsDrawingSupported #if NETCOREAPP public static bool IsReflectionEmitSupported => RuntimeFeature.IsDynamicCodeSupported; + public static bool IsNotReflectionEmitSupported => !IsReflectionEmitSupported; #else public static bool IsReflectionEmitSupported => true; #endif @@ -138,7 +142,7 @@ public static bool IsDrawingSupported // System.Security.Cryptography.Xml.XmlDsigXsltTransform.GetOutput() relies on XslCompiledTransform which relies // heavily on Reflection.Emit - public static bool IsXmlDsigXsltTransformSupported => !PlatformDetection.IsInAppContainer; + public static bool IsXmlDsigXsltTransformSupported => !PlatformDetection.IsInAppContainer && IsReflectionEmitSupported; public static bool IsPreciseGcSupported => !IsMonoRuntime; diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index 635f2bfc037ce..2412b8d4ed861 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -116,7 +116,7 @@ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(TestArchiveRoot)runtime/ - true + true $(ArtifactsDir)bundles\ $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'ref', '$(NetCoreAppCurrent)')) diff --git a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs index 1913f764d0c30..bee80f1f9d9a9 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs @@ -13,7 +13,8 @@ namespace Microsoft.Extensions.Configuration.FileExtensions.Test { public class FileConfigurationProviderTest { - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void ProviderDisposesChangeTokenRegistration() { var changeToken = new ConfigurationRootTest.ChangeToken(); @@ -39,7 +40,8 @@ public void ProviderDisposesChangeTokenRegistration() new object[] { @$"{Path.DirectorySeparatorChar}{Guid.NewGuid()}{Path.DirectorySeparatorChar}configuration.txt" } }; - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/52319", TestPlatforms.Android)] public void ProviderThrowsInvalidDataExceptionWhenLoadFails() { @@ -72,7 +74,7 @@ public void ProviderThrowsInvalidDataExceptionWhenLoadFails() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(ProviderThrowsInvalidDataExceptionInput))] public void ProviderThrowsFileNotFoundExceptionWhenNotFound(string physicalPath) { @@ -91,7 +93,7 @@ public void ProviderThrowsFileNotFoundExceptionWhenNotFound(string physicalPath) Assert.Contains(physicalPath, exception.Message); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(ProviderThrowsInvalidDataExceptionInput))] public void ProviderThrowsDirectoryNotFoundExceptionWhenNotFound(string physicalPath) { diff --git a/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/tests/ConfigurationExtensionTest.cs b/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/tests/ConfigurationExtensionTest.cs index 03667ab17b33c..e0d86e456227c 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/tests/ConfigurationExtensionTest.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/tests/ConfigurationExtensionTest.cs @@ -53,6 +53,7 @@ private void SetSecret(string id, string key, string value) [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60584", TestPlatforms.iOS | TestPlatforms.tvOS)] public void AddUserSecrets_FindsAssemblyAttribute() { var randValue = Guid.NewGuid().ToString(); @@ -68,6 +69,7 @@ public void AddUserSecrets_FindsAssemblyAttribute() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60584", TestPlatforms.iOS | TestPlatforms.tvOS)] public void AddUserSecrets_FindsAssemblyAttributeFromType() { var randValue = Guid.NewGuid().ToString(); @@ -122,6 +124,7 @@ public void AddUserSecrets_DoesThrowsIfNotOptionalAndSecretDoesNotExist() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60584", TestPlatforms.iOS | TestPlatforms.tvOS)] public void AddUserSecrets_With_SecretsId_Passed_Explicitly() { var userSecretsId = Guid.NewGuid().ToString(); diff --git a/src/libraries/Microsoft.Extensions.Configuration/tests/ConfigurationManagerTest.cs b/src/libraries/Microsoft.Extensions.Configuration/tests/ConfigurationManagerTest.cs index 89da788351754..256d15a16c625 100644 --- a/src/libraries/Microsoft.Extensions.Configuration/tests/ConfigurationManagerTest.cs +++ b/src/libraries/Microsoft.Extensions.Configuration/tests/ConfigurationManagerTest.cs @@ -171,7 +171,8 @@ public void DisposesProvidersOnRemoval() Assert.True(provider5.IsDisposed); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void DisposesChangeTokenRegistrationsOnDispose() { var changeToken = new TestChangeToken(); @@ -189,7 +190,8 @@ public void DisposesChangeTokenRegistrationsOnDispose() Assert.Empty(changeToken.Callbacks); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void DisposesChangeTokenRegistrationsOnRemoval() { var changeToken = new TestChangeToken(); diff --git a/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ArrayTests.cs b/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ArrayTests.cs index 0ef348ac163fd..d173c3e3cdb68 100644 --- a/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ArrayTests.cs +++ b/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ArrayTests.cs @@ -48,6 +48,7 @@ public class ArrayTests : IDisposable [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60583", TestPlatforms.iOS | TestPlatforms.tvOS)] public void DifferentConfigSources_Merged_KeysAreSorted() { var config = BuildConfig(); @@ -77,6 +78,7 @@ public void DifferentConfigSources_Merged_KeysAreSorted() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60583", TestPlatforms.iOS | TestPlatforms.tvOS)] public void DifferentConfigSources_Merged_WithOverwrites() { var config = BuildConfig(); @@ -103,7 +105,17 @@ private IConfiguration BuildConfig() public ArrayTests() { - var basePath = AppContext.BaseDirectory ?? string.Empty; + string basePath; + + if (PlatformDetection.IsAppleMobile && !PlatformDetection.IsMacCatalyst) + { + basePath = Path.GetTempPath(); + } + else + { + basePath = AppContext.BaseDirectory ?? string.Empty; + } + _iniConfigFilePath = Path.GetRandomFileName(); _xmlConfigFilePath = Path.GetRandomFileName(); _json1ConfigFilePath = Path.GetRandomFileName(); diff --git a/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs b/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs index d397549609401..9314f4e0dd333 100644 --- a/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs +++ b/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs @@ -362,6 +362,7 @@ public IConfigurationProvider Build(IConfigurationBuilder builder) [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60583", TestPlatforms.iOS | TestPlatforms.tvOS)] public void OnLoadErrorWillBeCalledOnJsonParseError() { _fileSystem.WriteFile(Path.Combine(_basePath, "error.json"), @"{""JsonKey1"": ", absolute: true); @@ -873,6 +874,7 @@ public void SetBasePathCalledMultipleTimesForEachSourceLastOneWins() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60583", TestPlatforms.iOS | TestPlatforms.tvOS)] public void GetDefaultBasePathForSources() { var builder = new ConfigurationBuilder(); diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs index a3f2d8acc9e92..82af4c38d17e9 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs @@ -13,7 +13,8 @@ namespace Microsoft.Extensions.DependencyModel.Tests { public class CompilationLibraryTests { - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void ResolveReferencePathsAcceptsCustomResolvers() { var fail = new Mock(); @@ -49,6 +50,7 @@ public void ResolveReferencePathsAcceptsCustomResolvers() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60583", TestPlatforms.iOS | TestPlatforms.tvOS)] public void ResolveReferencePathsAcceptsNullCustomResolvers() { var library = TestLibraryFactory.Create(); diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs index 99fb51405af9b..585fc4e023406 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs @@ -14,7 +14,8 @@ namespace Microsoft.Extensions.DependencyModel.Tests { public class CompositeResolverTests { - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void ReturnsFirstSuccesfullResolve() { var fail = new Mock(); @@ -44,7 +45,8 @@ public void ReturnsFirstSuccesfullResolve() Times.Never()); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void PassesLibraryToAllResolvers() { var fail = new Mock(); @@ -64,7 +66,8 @@ public void PassesLibraryToAllResolvers() failTwo.Verify(r => r.TryResolveAssemblyPaths(library, null), Times.Once()); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void PopulatedAssemblies() { var fail = new Mock(); diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs b/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs index da09149c1adbb..6a56349337166 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs @@ -93,7 +93,8 @@ public void GetDirectoryContents_ReturnsNonExistingEmptySequence_IfResourcesDoNo Assert.Empty(files); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void GetDirectoryContents_ReturnsCombinaisionOFFiles() { // Arrange @@ -121,7 +122,8 @@ public void GetDirectoryContents_ReturnsCombinaisionOFFiles() file => Assert.Same(file3, file)); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void GetDirectoryContents_ReturnsCombinaitionOFFiles_WhenSomeFileProviderRetunsNoContent() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.netcoreapp.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.netcoreapp.cs index 1e7178776e380..e178b1694eef8 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.netcoreapp.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.netcoreapp.cs @@ -12,7 +12,7 @@ namespace Microsoft.Extensions.FileProviders { public partial class PhysicalFileProviderTests : FileCleanupTestBase { - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsSymLinkSupported))] [InlineData(false)] [InlineData(true)] public async Task UsePollingFileWatcher_UseActivePolling_HasChanged_SymbolicLink(bool useWildcard) @@ -45,7 +45,7 @@ public async Task UsePollingFileWatcher_UseActivePolling_HasChanged_SymbolicLink $"Change event was not raised - current time: {DateTime.UtcNow:O}, file LastWriteTimeUtc: {File.GetLastWriteTimeUtc(filePath):O}."); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsSymLinkSupported))] [OuterLoop] [InlineData(false)] [InlineData(true)] @@ -70,7 +70,7 @@ public async Task UsePollingFileWatcher_UseActivePolling_HasChanged_SymbolicLink await Assert.ThrowsAsync(() => tcs.Task); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsSymLinkSupported))] [InlineData(false, false)] [InlineData(false, true)] [InlineData(true, false)] @@ -119,7 +119,7 @@ public async Task UsePollingFileWatcher_UseActivePolling_HasChanged_SymbolicLink catch (UnauthorizedAccessException) { } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsSymLinkSupported))] [InlineData(false)] [InlineData(true)] public async Task UsePollingFileWatcher_UseActivePolling_HasChanged_SymbolicLink_TargetDeleted(bool useWildcard) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PollingWildCardChangeTokenTest.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PollingWildCardChangeTokenTest.cs index e1994076af948..bd0bc7b82805c 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PollingWildCardChangeTokenTest.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PollingWildCardChangeTokenTest.cs @@ -14,7 +14,8 @@ namespace Microsoft.Extensions.FileProviders.Physical { public class PollingWildCardChangeTokenTest { - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void HasChanged_ReturnsFalseIfNoFilesExist() { // Arrange @@ -32,7 +33,8 @@ public void HasChanged_ReturnsFalseIfNoFilesExist() Assert.False(result); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void HasChanged_ReturnsFalseIfFilesDoNotChange() { // Arrange @@ -52,7 +54,8 @@ public void HasChanged_ReturnsFalseIfFilesDoNotChange() Assert.False(result); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void HasChanged_ReturnsTrueIfNewFilesWereAdded() { // Arrange @@ -82,7 +85,8 @@ public void HasChanged_ReturnsTrueIfNewFilesWereAdded() Assert.True(result2); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void HasChanged_ReturnsTrueIfFilesWereRemoved() { // Arrange @@ -111,7 +115,8 @@ public void HasChanged_ReturnsTrueIfFilesWereRemoved() Assert.True(result2); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void HasChanged_ReturnsTrueIfFilesWereModified() { // Arrange @@ -139,7 +144,8 @@ public void HasChanged_ReturnsTrueIfFilesWereModified() Assert.True(result2); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void HasChanged_ReturnsTrueIfFileWasModifiedButRetainedAnOlderTimestamp() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs index 72d89b17f8ab5..9a795e2f9724d 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs @@ -82,7 +82,8 @@ public void Factory_MultipleCalls_CachesHandler() Assert.NotSame(client1, client2); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Factory_DisposeClient_DoesNotDisposeHandler() { // Arrange @@ -107,7 +108,8 @@ public void Factory_DisposeClient_DoesNotDisposeHandler() // Assert (does not throw) } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Factory_DisposeHandler_DoesNotDisposeInnerHandler() { // Arrange @@ -170,7 +172,8 @@ public void Factory_CreateClient_WithName_UsesNamedOptions() Assert.Equal(1, count); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Factory_CreateClient_FiltersCanDecorateBuilder() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs index 426bf7195ebd4..47b206ac326d9 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs @@ -31,8 +31,8 @@ public void Ctor_SetsPrimaryHandler() Assert.IsType(builder.PrimaryHandler); } - - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Build_NoAdditionalHandlers_ReturnsPrimaryHandler() { // Arrange @@ -48,7 +48,8 @@ public void Build_NoAdditionalHandlers_ReturnsPrimaryHandler() Assert.Same(builder.PrimaryHandler, handler); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Build_SomeAdditionalHandlers_PutsTogetherDelegatingHandlers() { // Arrange @@ -108,7 +109,8 @@ public void Build_AdditionalHandlerIsNull_ThrowsException() Assert.Equal("The 'additionalHandlers' must not contain a null entry.", exception.Message); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/50873", TestPlatforms.Android)] public void Build_AdditionalHandlerHasNonNullInnerHandler_ThrowsException() { diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs index 9aa83a8f34dd0..1b67909daea25 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs @@ -736,7 +736,7 @@ public void AddHttpClient_WithTypedClient_AndName_AndDelegate_ConfiguresNamedCli Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void AddHttpMessageHandler_WithName_NewHandlerIsSurroundedByLogging_ForHttpClient() { // Arrange @@ -878,7 +878,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_Co Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void AddHttpMessageHandler_WithName_NewHandlerIsSurroundedByLogging_ForHttpMessageHandler() { var serviceCollection = new ServiceCollection(); @@ -1185,7 +1185,7 @@ public async Task AddHttpClient_MessageHandler_Scope_TransientDependency() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationContext_ShouldNotHangs() { // Arrange @@ -1229,7 +1229,7 @@ public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationCon } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void SuppressScope_False_CreatesNewScope() { // Arrange @@ -1257,7 +1257,7 @@ public void SuppressScope_False_CreatesNewScope() Assert.NotSame(services, capturedServices); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void SuppressScope_False_InScope_CreatesNewScope() { // Arrange @@ -1289,7 +1289,7 @@ public void SuppressScope_False_InScope_CreatesNewScope() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void SuppressScope_True_DoesNotCreateScope() { // Arrange @@ -1317,7 +1317,7 @@ public void SuppressScope_True_DoesNotCreateScope() Assert.NotSame(services, capturedServices); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void SuppressScope_True_InScope_DoesNotCreateScope() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/HttpMessageHandlerBuilderTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/HttpMessageHandlerBuilderTest.cs index 2cc55d2a38e74..cce5d8719a34b 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/HttpMessageHandlerBuilderTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/HttpMessageHandlerBuilderTest.cs @@ -10,7 +10,8 @@ namespace Microsoft.Extensions.Http.Test { public class HttpMessageHandlerBuilderTest { - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/50873", TestPlatforms.Android)] public void Build_AdditionalHandlerIsNull_ThrowsException() { @@ -29,7 +30,8 @@ public void Build_AdditionalHandlerIsNull_ThrowsException() Assert.Equal("The 'additionalHandlers' must not contain a null entry.", exception.Message); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/50873", TestPlatforms.Android)] public void Build_AdditionalHandlerHasNonNullInnerHandler_ThrowsException() { diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs index e31d7e8c26c13..7c2f39751b903 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.Logging.Test { public class LoggerFactoryTest { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void AddProvider_ThrowsAfterDisposed() { var factory = new LoggerFactory(); @@ -52,7 +52,8 @@ public void Dispose_MultipleCallsNoop() factory.Dispose(); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Dispose_ProvidersAreDisposed() { // Arrange @@ -81,8 +82,8 @@ private static ILoggerProvider CreateProvider() return disposableProvider.Object; } - - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Dispose_ThrowException_SwallowsException() { // Arrange @@ -493,7 +494,8 @@ public void BeginScope_ReturnsCompositeToken_ForMultipleLoggers() }); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void CreateDisposeDisposesInnerServiceProvider() { var disposed = false; diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs index 52632e471466c..43019c15c3387 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs @@ -58,7 +58,7 @@ public static void MultipleLoggers_IsEnabledReturnsCorrectValue(SourceLevels fir Assert.Equal(expected, logger.IsEnabled(LogLevel.Information)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(true)] [InlineData(false)] public static void Log_Shoud_Add_Exception_To_Message_Whether_Formatter_Is_Null_Or_Not(bool shouldFormatterBeNull) diff --git a/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs b/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs index 07bb99b3ffc3f..8b58e0d6b1cb2 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs @@ -42,7 +42,8 @@ public void RegisteredCallbacks_AreInvokedExactlyOnce() Assert.Equal(1, count2); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void HasChanged_IsTrue_IfAnyTokenHasChanged() { // Arrange @@ -59,7 +60,8 @@ public void HasChanged_IsTrue_IfAnyTokenHasChanged() Assert.True(compositeChangeToken.HasChanged); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void HasChanged_IsFalse_IfNoTokenHasChanged() { // Arrange @@ -73,7 +75,8 @@ public void HasChanged_IsFalse_IfNoTokenHasChanged() Assert.False(compositeChangeToken.HasChanged); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void ActiveChangeCallbacks_IsTrue_IfAnyTokenHasActiveChangeCallbacks() { // Arrange @@ -89,7 +92,8 @@ public void ActiveChangeCallbacks_IsTrue_IfAnyTokenHasActiveChangeCallbacks() Assert.True(compositeChangeToken.ActiveChangeCallbacks); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void ActiveChangeCallbacks_IsFalse_IfNoTokenHasActiveChangeCallbacks() { // Arrange diff --git a/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs b/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs index 53bc785e09dee..a5c378d58aeea 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs +++ b/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs @@ -1,6 +1,8 @@ // 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.Linq; using System.Runtime.CompilerServices; using Microsoft.Build.Evaluation; @@ -17,13 +19,23 @@ public class GenerateRuntimeGraphTests private Log _log; private TestBuildEngine _engine; + private string defaultRootPath = (PlatformDetection.IsiOS || PlatformDetection.IstvOS) ? Path.GetTempPath() : string.Empty; + private string defaultRuntimeFile = "runtime.json"; + public GenerateRuntimeGraphTests(ITestOutputHelper output) { _log = new Log(output); _engine = new TestBuildEngine(_log); + + if (PlatformDetection.IsiOS || PlatformDetection.IstvOS) + { + var runtimeJsonPath = Path.Combine(defaultRootPath, defaultRuntimeFile); + File.Copy(defaultRuntimeFile, runtimeJsonPath, true); + + defaultRuntimeFile = runtimeJsonPath; + } } - const string DefaultRuntimeFile = "runtime.json"; private static ITaskItem[] DefaultRuntimeGroupItems { get; } = GetDefaultRuntimeGroupItems(); private static ITaskItem[] GetDefaultRuntimeGroupItems() @@ -56,7 +68,7 @@ public void CanCreateRuntimeGraph() { BuildEngine = _engine, RuntimeGroups = DefaultRuntimeGroupItems, - RuntimeJson = DefaultRuntimeFile, + RuntimeJson = defaultRuntimeFile, UpdateRuntimeFiles = false }; task.Execute(); @@ -73,7 +85,7 @@ public void CanIgnoreExistingInferRids() { BuildEngine = _engine, RuntimeGroups = DefaultRuntimeGroupItems, - RuntimeJson = DefaultRuntimeFile, + RuntimeJson = defaultRuntimeFile, AdditionalRuntimeIdentifiers = new[] { "rhel.9-x64", "centos.9-arm64", "win-x64" }, UpdateRuntimeFiles = false }; @@ -93,7 +105,7 @@ public void CanIgnoreExistingInferRids() /// a unique prefix to use for the generated private void AssertRuntimeGraphAdditions(string[] additionalRIDs, RuntimeDescription[] expectedAdditions, string additionalRIDParent = null, [CallerMemberName] string runtimeFilePrefix = null) { - string runtimeFile = runtimeFilePrefix + ".runtime.json"; + string runtimeFile = Path.Combine(defaultRootPath, runtimeFilePrefix + ".runtime.json"); GenerateRuntimeGraph task = new GenerateRuntimeGraph() { @@ -110,12 +122,12 @@ private void AssertRuntimeGraphAdditions(string[] additionalRIDs, RuntimeDescrip _log.AssertNoErrorsOrWarnings(); RuntimeGraph expected = RuntimeGraph.Merge( - JsonRuntimeFormat.ReadRuntimeGraph(DefaultRuntimeFile), + JsonRuntimeFormat.ReadRuntimeGraph(defaultRuntimeFile), new RuntimeGraph(expectedAdditions)); RuntimeGraph actual = JsonRuntimeFormat.ReadRuntimeGraph(runtimeFile); - // Should this assert fail, it's helpful to diff DefaultRuntimeFile and runtimeFile to see the additions. + // Should this assert fail, it's helpful to diff defaultRuntimeFile and runtimeFile to see the additions. Assert.Equal(expected, actual); } diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs index a2f8632f98f39..16406fb3ad24c 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs @@ -484,6 +484,7 @@ public void GetDirectoryInfo_Directory() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60586", TestPlatforms.iOS | TestPlatforms.tvOS)] public void GetDriveInfo_Drive() { var Drives = System.IO.DriveInfo.GetDrives(); diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/CustomTypeDescriptorTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/CustomTypeDescriptorTests.cs index ce8d9c44eed94..80c40e50d2437 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/CustomTypeDescriptorTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/CustomTypeDescriptorTests.cs @@ -25,7 +25,8 @@ public static IEnumerable GetAttributes_TestData() yield return new object[] { new AttributeCollection(new EditorBrowsableAttribute()) }; } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetAttributes_TestData))] public void GetAttributes_InvokeWithParent_ReturnsExpected(AttributeCollection result) { @@ -53,7 +54,8 @@ public void GetClassName_InvokeWithoutParent_ReturnsNull() Assert.Null(descriptor.GetClassName()); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(null)] [InlineData("name")] public void GetClassName_InvokeWithParent_ReturnsExpected(string result) @@ -82,7 +84,8 @@ public void GetComponentName_InvokeWithoutParent_ReturnsNull() Assert.Null(descriptor.GetComponentName()); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(null)] [InlineData("name")] public void GetComponentName_InvokeWithParent_ReturnsExpected(string result) @@ -119,7 +122,8 @@ public static IEnumerable GetConverter_TestData() yield return new object[] { new Int32Converter() }; } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetConverter_TestData))] public void GetConverter_InvokeWithParent_ReturnsExpected(TypeConverter result) { @@ -153,7 +157,8 @@ public static IEnumerable GetDefaultEvent_TestData() yield return new object[] { new Mock(MockBehavior.Strict, "Event", new Attribute[0]).Object }; } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetDefaultEvent_TestData))] public void GetDefaultEvent_InvokeWithParent_ReturnsExpected(EventDescriptor result) { @@ -187,7 +192,8 @@ public static IEnumerable GetDefaultProperty_TestData() yield return new object[] { new Mock(MockBehavior.Strict, "Property", new Attribute[0]).Object }; } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetDefaultProperty_TestData))] public void GetDefaultProperty_InvokeWithParent_ReturnsExpected(PropertyDescriptor result) { @@ -226,7 +232,8 @@ public static IEnumerable GetEditor_TestData() } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetEditor_TestData))] public void GetEditor_InvokeWithParent_ReturnsExpected(Type editorBaseType, Type result) { @@ -260,7 +267,8 @@ public static IEnumerable GetEvents_WithParent_TestData() yield return new object[] { new EventDescriptorCollection(new EventDescriptor[] { null }) }; } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetEvents_WithParent_TestData))] public void GetEvents_InvokeWithParent_ReturnsExpected(EventDescriptorCollection result) { @@ -304,7 +312,8 @@ public static IEnumerable GetEvents_AttributesWithParent_TestData() } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetEvents_AttributesWithParent_TestData))] public void GetEvents_InvokeAttributesWithParent_ReturnsExpected(Attribute[] attributes, EventDescriptorCollection result) { @@ -338,7 +347,8 @@ public static IEnumerable GetProperties_WithParent_TestData() yield return new object[] { new PropertyDescriptorCollection(new PropertyDescriptor[] { null }) }; } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetProperties_WithParent_TestData))] public void GetProperties_InvokeWithParent_ReturnsExpected(PropertyDescriptorCollection result) { @@ -382,7 +392,8 @@ public static IEnumerable GetProperties_AttributesWithParent_TestData( } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetProperties_AttributesWithParent_TestData))] public void GetProperties_InvokeAttributesWithParent_ReturnsExpected(Attribute[] attributes, PropertyDescriptorCollection result) { @@ -406,7 +417,8 @@ public static IEnumerable GetPropertyOwner_WithoutParent_TestData() yield return new object[] { new Mock(MockBehavior.Strict, "Name", new Attribute[0]).Object }; } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetPropertyOwner_WithoutParent_TestData))] public void GetPropertyOwner_InvokeWithoutParent_ReturnsNull(PropertyDescriptor pd) { @@ -426,7 +438,8 @@ public static IEnumerable GetPropertyOwner_WithParent_TestData() } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetPropertyOwner_WithParent_TestData))] public void GetPropertyOwner_InvokeWithParent_ReturnsExpected(PropertyDescriptor pd, object result) { diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptionProviderTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptionProviderTests.cs index 4ebbf02a188d7..fdee5c8198424 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptionProviderTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptionProviderTests.cs @@ -17,7 +17,8 @@ public static IEnumerable CreateInstance_WithoutParent_TestData() yield return new object[] { new Mock(MockBehavior.Strict).Object }; } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(CreateInstance_WithoutParent_TestData))] public void CreateInstance_InvokeWithoutParent_ReturnsExpected(IServiceProvider serviceProvider) { @@ -37,7 +38,8 @@ public static IEnumerable CreateInstance_WithParent_TestData() } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(CreateInstance_WithParent_TestData))] public void CreateInstance_InvokeWithParent_ReturnsExpected(IServiceProvider serviceProvider, Type objectType, Type[] argTypes, object[] args, object result) { @@ -88,7 +90,8 @@ public static IEnumerable GetCache_WithParent_TestData() } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetCache_WithParent_TestData))] public void GetCache_InvokeWithParent_ReturnsExpected(object instance, IDictionary result) { @@ -134,7 +137,8 @@ public static IEnumerable GetExtendedTypeDescriptor_WithParent_TestDat } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetExtendedTypeDescriptor_WithParent_TestData))] public void GetExtendedTypeDescriptor_InvokeWithParent_ReturnsExpected(object instance, ICustomTypeDescriptor result) { @@ -171,7 +175,8 @@ public static IEnumerable GetExtenderProviders_WithParent_TestData() } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetExtenderProviders_WithParent_TestData))] public void GetExtenderProviders_InvokeWithParent_ReturnsExpected(object instance, IExtenderProvider[] result) { @@ -212,7 +217,8 @@ public static IEnumerable GetFullComponentName_WithoutParent_TestData( yield return new object[] { new Component { Site = mockSite.Object } }; } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetFullComponentName_WithoutParent_TestData))] public void GetFullComponentName_InvokeWithoutParent_ReturnsNull(object component) { @@ -241,7 +247,8 @@ public static IEnumerable GetFullComponentName_InvokeWithCustomTypeDes } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetFullComponentName_InvokeWithCustomTypeDescriptor_TestData))] public void GetFullComponentName_InvokeWithCustomTypeDescriptor_ReturnsExpected(object component, string result) { @@ -269,7 +276,8 @@ public void GetFullComponentName_InvokeWithCustomTypeDescriptor_ReturnsExpected( mockCustomTypeDescriptor.Verify(d => d.GetComponentName(), Times.Exactly(2)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetFullComponentName_WithoutParent_TestData))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework throws NullReferenceException")] public void GetFullComponentName_InvokeWithNullTypeDescriptor_ReturnsExpected(object component) @@ -300,7 +308,8 @@ public static IEnumerable GetFullComponentName_WithParent_TestData() } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetFullComponentName_WithParent_TestData))] public void GetFullComponentName_InvokeWithParent_ReturnsExpected(object component, string result) { @@ -325,7 +334,8 @@ public void GetFullComponentName_NullComponent_ReturnsNull() AssertExtensions.Throws("instance", () => provider.GetFullComponentName(null)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(null)] [InlineData(typeof(int))] public void GetReflectionType_InvokeTypeWithoutParent_ReturnsExpected(Type objectType) @@ -337,7 +347,8 @@ public void GetReflectionType_InvokeTypeWithoutParent_ReturnsExpected(Type objec Assert.Same(objectType, provider.GetReflectionType(objectType)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(null)] [InlineData(typeof(int))] public void GetReflectionType_InvokeTypeWithoutParent_CallsTypeObjectOverload_ByType(Type objectType) @@ -364,7 +375,8 @@ public static IEnumerable GetReflectionType_TypeWithParent_TestData() } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetReflectionType_TypeWithParent_TestData))] public void GetReflectionType_InvokeTypeWithParent_ReturnsExpected(Type objectType, Type result) { @@ -382,7 +394,8 @@ public void GetReflectionType_InvokeTypeWithParent_ReturnsExpected(Type objectTy mockParentProvider.Verify(p => p.GetReflectionType(objectType, null), Times.Exactly(2)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(1, typeof(int))] public void GetReflectionType_InvokeObjectWithoutParent_ReturnsExpected(object instance, Type expected) { @@ -393,7 +406,8 @@ public void GetReflectionType_InvokeObjectWithoutParent_ReturnsExpected(object i Assert.Same(expected, provider.GetReflectionType(instance)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(1, typeof(int))] public void GetReflectionType_InvokeTypeWithoutParent_CallsTypeObjectOverload_ByObjectAndType(object instance, Type expected) { @@ -410,7 +424,8 @@ public void GetReflectionType_InvokeTypeWithoutParent_CallsTypeObjectOverload_By mockProvider.Verify(p => p.GetReflectionType(instance.GetType(), instance), Times.Exactly(2)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(1, null)] [InlineData(1, typeof(object))] public void GetReflectionType_InvokeObjectWithParent_ReturnsExpected(object instance, Type result) @@ -429,7 +444,8 @@ public void GetReflectionType_InvokeObjectWithParent_ReturnsExpected(object inst mockParentProvider.Verify(p => p.GetReflectionType(instance.GetType(), instance), Times.Exactly(2)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(null, null)] [InlineData(null, 1)] [InlineData(typeof(object), null)] @@ -454,7 +470,8 @@ public static IEnumerable GetReflectionType_TypeObjectWithParent_TestD } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetReflectionType_TypeObjectWithParent_TestData))] public void GetReflectionType_InvokeTypeObjectWithParent_ReturnsExpected(Type objectType, object instance, Type result) { @@ -479,7 +496,8 @@ public void GetReflectionType_NullInstance_ThrowsArgumentNullException() AssertExtensions.Throws("instance", () => provider.GetReflectionType((object)null)); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void GetReflectionType_NullInstanceWithParent_ThrowsArgumentNullException() { var mockParentProvider = new Mock(MockBehavior.Strict); @@ -487,7 +505,8 @@ public void GetReflectionType_NullInstanceWithParent_ThrowsArgumentNullException AssertExtensions.Throws("instance", () => provider.GetReflectionType((object)null)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(typeof(int))] [InlineData(typeof(TypeDescriptionProviderTests))] public void GetRuntimeType_InvokeWithoutParentSystemDefinedType_ReturnsSame(Type reflectionType) @@ -499,7 +518,8 @@ public void GetRuntimeType_InvokeWithoutParentSystemDefinedType_ReturnsSame(Type Assert.Same(reflectionType, provider.GetRuntimeType(reflectionType)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(null)] [InlineData(typeof(int))] public void GetRuntimeType_InvokeWithoutParentWithUserDefinedType_RetunsUnderlyingSystemType(Type result) @@ -527,7 +547,8 @@ public static IEnumerable GetRuntimeType_WithParent_TestData() } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetRuntimeType_WithParent_TestData))] public void GetRuntimeType_InvokeWithParent_ReturnsExpected(Type reflectionType, Type result) { @@ -553,7 +574,8 @@ public void GetRuntimeType_NullReflectionType_ThrowsArgumentNullException() } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(null)] [InlineData(typeof(int))] public void GetTypeDescriptor_InvokeTypeWithoutParent_ReturnsExpected(Type objectType) @@ -567,7 +589,8 @@ public void GetTypeDescriptor_InvokeTypeWithoutParent_ReturnsExpected(Type objec Assert.Same(result1, result2); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(null)] [InlineData(typeof(int))] public void GetTypeDescriptor_InvokeTypeWithoutParent_CallsTypeObjectOverload_Type(Type objectType) @@ -596,7 +619,8 @@ public static IEnumerable GetTypeDescriptor_TypeWithParent_TestData() } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetTypeDescriptor_TypeWithParent_TestData))] public void GetTypeDescriptor_InvokeTypeWithParent_ReturnsExpected(Type objectType, ICustomTypeDescriptor result) { @@ -614,7 +638,8 @@ public void GetTypeDescriptor_InvokeTypeWithParent_ReturnsExpected(Type objectTy mockParentProvider.Verify(p => p.GetTypeDescriptor(objectType, null), Times.Exactly(2)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(1)] public void GetTypeDescriptor_InvokeObjectWithoutParent_ReturnsExpected(object instance) { @@ -627,7 +652,8 @@ public void GetTypeDescriptor_InvokeObjectWithoutParent_ReturnsExpected(object i Assert.Same(result1, result2); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(1)] public void GetTypeDescriptor_InvokeTypeWithoutParent_CallsTypeObjectOverload_Object(object instance) { @@ -654,7 +680,8 @@ public static IEnumerable GetTypeDescriptor_ObjectWithParent_TestData( } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetTypeDescriptor_ObjectWithParent_TestData))] public void GetTypeDescriptor_InvokeObjectWithParent_ReturnsExpected(object instance, ICustomTypeDescriptor result) { @@ -672,7 +699,8 @@ public void GetTypeDescriptor_InvokeObjectWithParent_ReturnsExpected(object inst mockParentProvider.Verify(p => p.GetTypeDescriptor(instance.GetType(), instance), Times.Exactly(2)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(null, null)] [InlineData(null, 1)] [InlineData(typeof(object), null)] @@ -699,7 +727,8 @@ public static IEnumerable GetTypeDescriptor_TypeObjectWithParent_TestD } } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(GetTypeDescriptor_TypeObjectWithParent_TestData))] public void GetTypeDescriptor_InvokeTypeObjectWithParent_ReturnsExpected(Type objectType, object instance, ICustomTypeDescriptor result) { @@ -724,7 +753,8 @@ public void GetTypeDescriptor_NullInstance_ThrowsArgumentNullException() AssertExtensions.Throws("instance", () => provider.GetTypeDescriptor((object)null)); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void GetTypeDescriptor_NullInstanceWithParent_ThrowsArgumentNullException() { var mockParentProvider = new Mock(MockBehavior.Strict); @@ -743,7 +773,8 @@ public void IsSupportedType_InvokeWithoutParent_ReturnsTrue(Type type) Assert.True(provider.IsSupportedType(type)); } - [Theory] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(typeof(int), true)] [InlineData(typeof(int), false)] public void IsSupportedType_InvokeWithParent_ReturnsExpected(Type type, bool result) @@ -769,7 +800,8 @@ public void IsSupportedType_NullType_ThrowsArgumentNullException() AssertExtensions.Throws("type", () => provider.IsSupportedType(null)); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void IsSupportedType_NullTypeWithParent_ThrowsArgumentNullException() { var mockParentProvider = new Mock(MockBehavior.Strict); diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs index a142fe5e5c7d0..d1754653b81c8 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs @@ -13,7 +13,7 @@ namespace System.ComponentModel.Tests [Collection("NoParallelTests")] // manipulates cache public class TypeDescriptorTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProvider_InvokeObject_GetProviderReturnsExpected() { var instance = new object(); @@ -47,7 +47,7 @@ public void AddProvider_InvokeObject_GetProviderReturnsExpected() mockProvider2.Verify(p => p.IsSupportedType(typeof(int)), Times.Once()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProvider_InvokeObjectMultipleTimes_Refreshes() { var instance = new object(); @@ -96,7 +96,7 @@ public void AddProvider_InvokeObjectMultipleTimes_Refreshes() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProvider_InvokeType_GetProviderReturnsExpected() { Type type = typeof(AddProvider_InvokeType_GetProviderReturnsExpectedType); @@ -133,7 +133,7 @@ public void AddProvider_InvokeType_GetProviderReturnsExpected() private class AddProvider_InvokeType_GetProviderReturnsExpectedType { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProvider_InvokeTypeMultipleTimes_Refreshes() { var type = typeof(AddProvider_InvokeTypeMultipleTimes_RefreshesType); @@ -184,28 +184,28 @@ public void AddProvider_InvokeTypeMultipleTimes_Refreshes() private class AddProvider_InvokeTypeMultipleTimes_RefreshesType { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProvider_NullProvider_ThrowsArgumentNullException() { Assert.Throws("provider", () => TypeDescriptor.AddProvider(null, new object())); Assert.Throws("provider", () => TypeDescriptor.AddProvider(null, typeof(int))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProvider_NullInstance_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); Assert.Throws("instance", () => TypeDescriptor.AddProvider(mockProvider.Object, (object)null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProvider_NullType_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); Assert.Throws("type", () => TypeDescriptor.AddProvider(mockProvider.Object, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProviderTransparent_InvokeObject_GetProviderReturnsExpected() { var instance = new object(); @@ -239,7 +239,7 @@ public void AddProviderTransparent_InvokeObject_GetProviderReturnsExpected() mockProvider2.Verify(p => p.IsSupportedType(typeof(int)), Times.Once()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProviderTransparent_InvokeObjectMultipleTimes_Refreshes() { var instance = new object(); @@ -288,7 +288,7 @@ public void AddProviderTransparent_InvokeObjectMultipleTimes_Refreshes() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProviderTransparent_InvokeType_GetProviderReturnsExpected() { Type type = typeof(AddProviderTransparent_InvokeType_GetProviderReturnsExpectedType); @@ -324,7 +324,7 @@ public void AddProviderTransparent_InvokeType_GetProviderReturnsExpected() private class AddProviderTransparent_InvokeType_GetProviderReturnsExpectedType { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProviderTransparent_InvokeTypeMultipleTimes_Refreshes() { var type = typeof(AddProviderTransparent_InvokeTypeMultipleTimes_RefreshesType); @@ -375,21 +375,21 @@ public void AddProviderTransparent_InvokeTypeMultipleTimes_Refreshes() private class AddProviderTransparent_InvokeTypeMultipleTimes_RefreshesType { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProviderTransparent_NullProvider_ThrowsArgumentNullException() { Assert.Throws("provider", () => TypeDescriptor.AddProviderTransparent(null, new object())); Assert.Throws("provider", () => TypeDescriptor.AddProviderTransparent(null, typeof(int))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProviderTransparent_NullInstance_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); Assert.Throws("instance", () => TypeDescriptor.AddProviderTransparent(mockProvider.Object, (object)null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void AddProviderTransparent_NullType_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); @@ -543,7 +543,7 @@ public void GetPropertiesFiltersByAttribute() Assert.Equal(1, properties.Count); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProvider_InvokeObject_RemovesProvider() { var instance = new object(); @@ -598,7 +598,7 @@ public void RemoveProvider_InvokeObject_RemovesProvider() mockProvider3.Verify(p => p.IsSupportedType(typeof(int)), Times.Once()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProvider_InvokeObjectWithProviders_Refreshes() { var instance = new object(); @@ -635,7 +635,7 @@ public void RemoveProvider_InvokeObjectWithProviders_Refreshes() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProvider_InvokeObjectWithoutProviders_Refreshes() { var instance = new object(); @@ -660,7 +660,7 @@ public void RemoveProvider_InvokeObjectWithoutProviders_Refreshes() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProvider_InvokeType_RemovesProvider() { Type type = typeof(RemoveProvider_InvokeType_RemovesProviderType); @@ -717,7 +717,7 @@ public void RemoveProvider_InvokeType_RemovesProvider() private class RemoveProvider_InvokeType_RemovesProviderType { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProvider_InvokeTypeWithProviders_Refreshes() { Type type = typeof(RemoveProvider_InvokeObjectWithProviders_RefreshesType); @@ -756,7 +756,7 @@ public void RemoveProvider_InvokeTypeWithProviders_Refreshes() private class RemoveProvider_InvokeObjectWithProviders_RefreshesType { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProvider_InvokeTypeWithoutProviders_Refreshes() { Type type = typeof(RemoveProvider_InvokeTypeWithoutProviders_RefreshesType); @@ -790,14 +790,14 @@ public void RemoveProvider_NullProvider_ThrowsArgumentNullException() Assert.Throws("provider", () => TypeDescriptor.RemoveProvider(null, typeof(int))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProvider_NullInstance_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); Assert.Throws("instance", () => TypeDescriptor.RemoveProvider(mockProvider.Object, (object)null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProvider_NullType_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); @@ -805,7 +805,7 @@ public void RemoveProvider_NullType_ThrowsArgumentNullException() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeObject_RemovesProvider() { var instance = new object(); @@ -860,7 +860,7 @@ public void RemoveProviderTransparent_InvokeObject_RemovesProvider() mockProvider3.Verify(p => p.IsSupportedType(typeof(int)), Times.Once()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeObjectWithProviders_Refreshes() { var instance = new object(); @@ -897,7 +897,7 @@ public void RemoveProviderTransparent_InvokeObjectWithProviders_Refreshes() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeObjectWithoutProviders_Refreshes() { var instance = new object(); @@ -922,7 +922,7 @@ public void RemoveProviderTransparent_InvokeObjectWithoutProviders_Refreshes() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeType_RemovesProvider() { Type type = typeof(RemoveProviderTransparent_InvokeType_RemovesProviderType); @@ -979,7 +979,7 @@ public void RemoveProviderTransparent_InvokeType_RemovesProvider() private class RemoveProviderTransparent_InvokeType_RemovesProviderType { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeTypeWithProviders_Refreshes() { Type type = typeof(RemoveProviderTransparent_InvokeObjectWithProviders_RefreshesType); @@ -1018,7 +1018,7 @@ public void RemoveProviderTransparent_InvokeTypeWithProviders_Refreshes() private class RemoveProviderTransparent_InvokeObjectWithProviders_RefreshesType { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProviderTransparent_InvokeTypeWithoutProviders_Refreshes() { Type type = typeof(RemoveProviderTransparent_InvokeTypeWithoutProviders_RefreshesType); @@ -1052,14 +1052,14 @@ public void RemoveProviderTransparent_NullProvider_ThrowsArgumentNullException() Assert.Throws("provider", () => TypeDescriptor.RemoveProviderTransparent(null, typeof(int))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProviderTransparent_NullInstance_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); Assert.Throws("instance", () => TypeDescriptor.RemoveProviderTransparent(mockProvider.Object, (object)null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void RemoveProviderTransparent_NullType_ThrowsArgumentNullException() { var mockProvider = new Mock(MockBehavior.Strict); @@ -1106,7 +1106,7 @@ public void RemoveSingleAssociation() Assert.NotEqual(firstAssociatedObject, firstAssociation); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT public void SortDescriptorArray_Invoke_ReturnsExpected() { var notADescriptor1 = new object(); diff --git a/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs b/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs index f981b7639f393..28412e1045ad7 100644 --- a/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs +++ b/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs @@ -468,7 +468,7 @@ private static ConstructorInfo GetSelectedConstructor(ConventionBuilder builder, return reply; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NotifyImportsSatisfied_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -484,7 +484,8 @@ public void NotifyImportsSatisfied_ShouldSucceed() Assert.Equal(1, test.OnImportsSatisfiedInvoked); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -500,7 +501,7 @@ public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() Assert.Equal(1, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -516,7 +517,7 @@ public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() Assert.Equal(1, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NotifyImportsSatisfiedAttributeAppliedToDerivedClassExportBase_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -533,7 +534,7 @@ public void NotifyImportsSatisfiedAttributeAppliedToDerivedClassExportBase_Shoul Assert.Equal(0, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NotifyImportsSatisfiedTwice_ShouldSucceed() { var builder = new ConventionBuilder(); diff --git a/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs b/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs index 966218048d112..ef0009897e986 100644 --- a/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs +++ b/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs @@ -485,8 +485,7 @@ public void InsideTheLambdaCallGetCustomAttributesShouldSucceed() Assert.NotNull(importer.MyToBeIncludedClass); } - - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -503,7 +502,7 @@ public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -520,7 +519,7 @@ public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NotifyImportsSatisfiedMultipleNotifications_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -536,7 +535,7 @@ public void NotifyImportsSatisfiedMultipleNotifications_ShouldSucceed() Assert.Equal(2, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NotifyImportsSatisfiedTwice_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -552,8 +551,7 @@ public void NotifyImportsSatisfiedTwice_ShouldSucceed() Assert.Equal(6, test.OnImportsSatisfiedInvoked); } - - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NotifyImportsSatisfiedInvalidMethod_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -569,7 +567,7 @@ public void NotifyImportsSatisfiedInvalidMethod_ShouldSucceed() Assert.Equal(0, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NotifyImportsSatisfiedPropertiesAndFields_ShouldSucceed() { var builder = new ConventionBuilder(); diff --git a/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs b/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs index a30aa0a5045be..7e1d7bf6cf78e 100644 --- a/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs +++ b/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs @@ -303,7 +303,7 @@ public EFRepository(IContainer test) { } public T Fetch() => default(T); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void CreateContainer_ImportConventionsWithInheritedProperties_Success() { var conventions = new ConventionBuilder(); @@ -351,7 +351,7 @@ public class BaseWithExport public class DerivedFromBaseWithExport : BaseWithExport { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void CreateContainer_ExportsToInheritedProperties_DontInterfereWithBase() { var conventions = new ConventionBuilder(); diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.Unix.cs b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.Unix.cs index 2d213d3a85d9b..ef0d008871e98 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.Unix.cs +++ b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.Unix.cs @@ -9,7 +9,7 @@ namespace System.Diagnostics.Tests { public partial class FileVersionInfoTest { - [PlatformSpecific(TestPlatforms.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix & ~(TestPlatforms.iOS | TestPlatforms.tvOS))] [Fact] public void NonRegularFile_Throws() { @@ -19,7 +19,7 @@ public void NonRegularFile_Throws() } [PlatformSpecific(TestPlatforms.AnyUnix)] - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsSymLinkSupported))] public void Symlink_ValidFile_Succeeds() { string filePath = Path.Combine(Directory.GetCurrentDirectory(), TestAssemblyFileName); @@ -62,7 +62,7 @@ public void Symlink_ValidFile_Succeeds() } [PlatformSpecific(TestPlatforms.AnyUnix)] - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsSymLinkSupported))] public void Symlink_InvalidFile_Throws() { string sourcePath = Path.Combine(Directory.GetCurrentDirectory(), TestAssemblyFileName); diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs index 2756c46e86fd0..d9f865d1d4a5e 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs +++ b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs @@ -107,18 +107,21 @@ public void FileVersionInfo_NonExistentFile_FileNotFound() [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "NetFX throws ArgumentException in this case")] public void FileVersionInfo_RelativePath_CorrectFilePath() { + string rootPath = (PlatformDetection.IsiOS || PlatformDetection.IstvOS) ? Path.GetTempPath() : string.Empty; + string kernelBasePath = Path.Combine(rootPath, "kernelbase.dll"); + try { - File.WriteAllText("kernelbase.dll", "bogus kernelbase.dll"); - FileVersionInfo fvi = FileVersionInfo.GetVersionInfo("kernelbase.dll"); + File.WriteAllText(kernelBasePath, "bogus kernelbase.dll"); + FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(kernelBasePath); // File name should be the full path to the local kernelbase.dll, not the relative path or the path to the system .dll - Assert.Equal(Path.GetFullPath("kernelbase.dll"), fvi.FileName); + Assert.Equal(Path.GetFullPath(kernelBasePath), fvi.FileName); // FileDescription should be null in the local kernelbase.dll Assert.Null(fvi.FileDescription); } finally { - File.Delete("kernelbase.dll"); + File.Delete(kernelBasePath); } } diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs index cdfa25c184c78..8845803d08086 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs @@ -1105,6 +1105,7 @@ public void TestGetProcessById() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60588", TestPlatforms.iOS | TestPlatforms.tvOS)] public void TestGetProcesses() { Process currentProcess = Process.GetCurrentProcess(); @@ -1170,6 +1171,7 @@ public void GetProcesses_RemoteMachinePath_ReturnsExpected() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60588", TestPlatforms.iOS | TestPlatforms.tvOS)] public void GetProcessesByName_ProcessName_ReturnsExpected() { // Get the current process using its name @@ -1229,6 +1231,7 @@ public static IEnumerable MachineName_Remote_TestData() [Theory] [MemberData(nameof(MachineName_TestData))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60588", TestPlatforms.iOS | TestPlatforms.tvOS)] public void GetProcessesByName_ProcessNameMachineName_ReturnsExpected(string machineName) { Process currentProcess = Process.GetCurrentProcess(); @@ -1255,6 +1258,7 @@ public void GetProcessesByName_RemoteMachineNameWindows_ReturnsExpected(string m } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60588", TestPlatforms.iOS | TestPlatforms.tvOS)] public void GetProcessesByName_NoSuchProcess_ReturnsEmpty() { string processName = Guid.NewGuid().ToString("N"); @@ -2214,7 +2218,7 @@ public void StartProcessWithArgumentList() } } - [Fact] + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] public void ArgumentListArgumentNullThrowsOnStart() { ProcessStartInfo psi = new ProcessStartInfo(GetCurrentProcessName()); diff --git a/src/libraries/System.Drawing.Primitives/tests/RectangleTests.cs b/src/libraries/System.Drawing.Primitives/tests/RectangleTests.cs index 46859d13f44b5..2220d6af0858d 100644 --- a/src/libraries/System.Drawing.Primitives/tests/RectangleTests.cs +++ b/src/libraries/System.Drawing.Primitives/tests/RectangleTests.cs @@ -164,6 +164,7 @@ public static void GetHashCodeTest() [InlineData(float.MaxValue, float.MinValue, float.MaxValue, float.MinValue)] [InlineData(float.MinValue, float.MaxValue, float.MinValue, float.MaxValue)] [InlineData(0, 0, 0, 0)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60585", TestPlatforms.iOS | TestPlatforms.tvOS)] public void RectangleFConversionTest(float x, float y, float width, float height) { RectangleF rect = new RectangleF(x, y, width, height); diff --git a/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Extract.cs b/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Extract.cs index e859959c07b05..36dafcd259fe3 100644 --- a/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Extract.cs +++ b/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Extract.cs @@ -34,6 +34,7 @@ public void ExtractToDirectoryNull() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60582", TestPlatforms.iOS | TestPlatforms.tvOS)] public void ExtractToDirectoryUnicode() { string zipFileName = zfile("unicode.zip"); diff --git a/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs b/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs index ab61ae92443d5..0d349b5fce848 100644 --- a/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs +++ b/src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs @@ -9,6 +9,7 @@ namespace System.IO.Compression.Tests public class ZipFile_Unix : ZipFileTestBase { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60581", TestPlatforms.iOS | TestPlatforms.tvOS)] public void UnixCreateSetsPermissionsInExternalAttributes() { // '7600' tests that S_ISUID, S_ISGID, and S_ISVTX bits get preserved in ExternalAttributes diff --git a/src/libraries/System.IO.Compression.ZipFile/tests/ZipFileExtensions.ZipArchive.Extract.cs b/src/libraries/System.IO.Compression.ZipFile/tests/ZipFileExtensions.ZipArchive.Extract.cs index e0dfc37788d93..6bab31ba942f7 100644 --- a/src/libraries/System.IO.Compression.ZipFile/tests/ZipFileExtensions.ZipArchive.Extract.cs +++ b/src/libraries/System.IO.Compression.ZipFile/tests/ZipFileExtensions.ZipArchive.Extract.cs @@ -22,6 +22,7 @@ public void ExtractToDirectoryExtension() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60582", TestPlatforms.iOS | TestPlatforms.tvOS)] public void ExtractToDirectoryExtension_Unicode() { using (ZipArchive archive = ZipFile.OpenRead(zfile("unicode.zip"))) diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs index d1475e38bbadb..11c6f45cab9a7 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs @@ -24,6 +24,7 @@ public void TestConstructor() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60586", TestPlatforms.iOS | TestPlatforms.tvOS)] public void TestGetDrives() { var drives = DriveInfo.GetDrives(); diff --git a/src/libraries/System.IO.Packaging/tests/Tests.cs b/src/libraries/System.IO.Packaging/tests/Tests.cs index 8dd92b410ba20..c2120ecfbff63 100644 --- a/src/libraries/System.IO.Packaging/tests/Tests.cs +++ b/src/libraries/System.IO.Packaging/tests/Tests.cs @@ -3660,6 +3660,7 @@ public void SetEmptyPropertyToNull() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60582", TestPlatforms.iOS | TestPlatforms.tvOS)] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Desktop doesn't support Package.Open with FileAccess.Write")] public void CreateWithFileAccessWrite() { @@ -3695,6 +3696,7 @@ public void CreateWithFileAccessWrite() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60582", TestPlatforms.iOS | TestPlatforms.tvOS)] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Desktop doesn't support Package.Open with FileAccess.Write")] public void ZipPackage_CreateWithFileAccessWrite() { diff --git a/src/libraries/System.Linq.Queryable/tests/QueryFromExpressionTests.cs b/src/libraries/System.Linq.Queryable/tests/QueryFromExpressionTests.cs index 7bbc130822f0f..314646de5e676 100644 --- a/src/libraries/System.Linq.Queryable/tests/QueryFromExpressionTests.cs +++ b/src/libraries/System.Linq.Queryable/tests/QueryFromExpressionTests.cs @@ -239,7 +239,7 @@ public void ConvertsNewArrayAndArrayLength() Assert.Equal(Enumerable.Range(0, 2), q); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void CoalesceShifts() { Expression list = Expression.ListInit( diff --git a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/IPGlobalPropertiesTest.cs b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/IPGlobalPropertiesTest.cs index 0f4903b01f848..f9438935ffabd 100644 --- a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/IPGlobalPropertiesTest.cs +++ b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/IPGlobalPropertiesTest.cs @@ -76,6 +76,7 @@ public void IPGlobalProperties_TcpListeners_Succeed(IPAddress address) [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [PlatformSpecific(~(TestPlatforms.iOS | TestPlatforms.tvOS))] [MemberData(nameof(Loopbacks))] public async Task IPGlobalProperties_TcpActiveConnections_Succeed(IPAddress address) { diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs index b12703d60936c..cb50258f7fa27 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs @@ -2844,6 +2844,7 @@ public static void Xml_NookTypes() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DerivedTypeWithDifferentOverrides() { DerivedTypeWithDifferentOverrides value = new DerivedTypeWithDifferentOverrides() { Name1 = "Name1", Name2 = "Name2", Name3 = "Name3", Name4 = "Name4", Name5 = "Name5" }; @@ -2856,6 +2857,7 @@ public static void DerivedTypeWithDifferentOverrides() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DerivedTypeWithDifferentOverrides2() { DerivedTypeWithDifferentOverrides2 value = new DerivedTypeWithDifferentOverrides2() { Name1 = "Name1", Name2 = "Name2", Name3 = "Name3", Name4 = "Name4", Name5 = "Name5", Name6 = "Name6", Name7 = "Name7" }; diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs index c918520a19c8f..93b93da69f5eb 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs @@ -363,7 +363,7 @@ public static void Xml_EnumFlags() Assert.StrictEqual(value1, value2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void Xml_SerializeClassThatImplementsInteface() { ClassImplementsInterface value = new ClassImplementsInterface() { ClassID = "ClassID", DisplayName = "DisplayName", Id = "Id", IsLoaded = true }; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransform.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransform.cs index 141c830925b1b..9f561b2554e00 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransform.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransform.cs @@ -477,7 +477,7 @@ public void TC_AbsolutePath_Transform(InputType inputType, ReaderType readerType { TestUsingTemporaryCopyOfResolverDocument(() => { - LoadXSL("xmlResolver_document_function_absolute_uri_replaced.xsl", inputType, readerType); + LoadXSL(absoluteUriXslFile, inputType, readerType); xslt.XmlResolver = new XmlUrlResolver(); Transform("fruits.xml", transformType, docType); VerifyResult(@"123"); @@ -2128,7 +2128,7 @@ public void TC_AbsolutePath_Transform(InputType inputType, ReaderType readerType { TestUsingTemporaryCopyOfResolverDocument(() => { - LoadXSL("xmlResolver_document_function_absolute_uri_replaced.xsl", inputType, readerType); + LoadXSL(absoluteUriXslFile, inputType, readerType); TransformResolver("fruits.xml", transformType, docType, new XmlUrlResolver()); VerifyResult(@"123"); }); diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs index a0bac0cd72b7e..aa8cd89614aed 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs @@ -45,7 +45,8 @@ public class XsltApiTestCaseBase : FileCleanupTestBase private const string XmlResolverDocumentName = "xmlResolver_document_function.xml"; private static readonly string s_temporaryResolverDocumentFullName = Path.Combine(Path.GetTempPath(), typeof(XsltApiTestCaseBase) + "_" + Path.GetRandomFileName()); private static readonly object s_temporaryResolverDocumentLock = new object(); - + protected static string absoluteUriXslFile = "xmlResolver_document_function_absolute_uri_replaced.xsl"; + // Generic data for all derived test cases public string szXslNS = "http://www.w3.org/1999/XSL/Transform"; @@ -81,17 +82,20 @@ static XsltApiTestCaseBase() // In AppContainer access is denied to full path and the code below and related tests cannot run if (!PlatformDetection.IsInAppContainer) { + string testDirPath = Path.Combine(FilePathUtil.GetWriteableTestRootPath(), "TestFiles", FilePathUtil.GetTestDataPath(), "XsltApi"); + Directory.CreateDirectory(Path.GetDirectoryName(s_temporaryResolverDocumentFullName)); + Directory.CreateDirectory(testDirPath); // Replace absolute URI in xmlResolver_document_function.xml based on the environment, and store it under a different name string xslFile = Path.Combine("TestFiles", FilePathUtil.GetTestDataPath(), "XsltApi", "xmlResolver_document_function_absolute_uri.xsl"); - string replacedXslFile = Path.Combine("TestFiles", FilePathUtil.GetTestDataPath(), "XsltApi", "xmlResolver_document_function_absolute_uri_replaced.xsl"); - File.Copy(xslFile, replacedXslFile, true); + absoluteUriXslFile = Path.Combine(testDirPath, "xmlResolver_document_function_absolute_uri_replaced.xsl"); + File.Copy(xslFile, absoluteUriXslFile, true); XmlDocument doc = new XmlDocument(); - doc.Load(replacedXslFile); + doc.Load(absoluteUriXslFile); string xslString = doc.OuterXml.Replace("ABSOLUTE_URI", s_temporaryResolverDocumentFullName); doc.LoadXml(xslString); - doc.Save(replacedXslFile); + doc.Save(absoluteUriXslFile); } } @@ -217,8 +221,10 @@ public string FullFilePath(string szFile) // Returns the full, lower-cased path of a file, based on LTM parameters public string FullFilePath(string szFile, bool normalizeToLower) { - if (szFile == null || szFile == string.Empty) + if (szFile == null || szFile == string.Empty || szFile == absoluteUriXslFile) + { return szFile; + } // why is this check here? if (szFile.Length > 5) { diff --git a/src/libraries/System.Reflection.Emit/tests/AssemblyBuilderTests.cs b/src/libraries/System.Reflection.Emit/tests/AssemblyBuilderTests.cs index 7b9050df231dd..1a005f42e1fca 100644 --- a/src/libraries/System.Reflection.Emit/tests/AssemblyBuilderTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/AssemblyBuilderTests.cs @@ -355,7 +355,7 @@ internal static void SampleInternalMethod () { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] void Invoke_Private_CrossAssembly_ThrowsMethodAccessException() { TypeBuilder tb = Helpers.DynamicType(TypeAttributes.Public); @@ -377,7 +377,7 @@ void Invoke_Private_CrossAssembly_ThrowsMethodAccessException() Assert.Throws(() => d ()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] void Invoke_Internal_CrossAssembly_ThrowsMethodAccessException() { TypeBuilder tb = Helpers.DynamicType(TypeAttributes.Public); @@ -399,7 +399,7 @@ void Invoke_Internal_CrossAssembly_ThrowsMethodAccessException() Assert.Throws(() => d ()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] void Invoke_Private_SameAssembly_ThrowsMethodAccessException() { ModuleBuilder modb = Helpers.DynamicModule(); diff --git a/src/libraries/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderDefineParameter.cs b/src/libraries/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderDefineParameter.cs index 23d36f9f838d1..a36dffc44be58 100644 --- a/src/libraries/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderDefineParameter.cs +++ b/src/libraries/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderDefineParameter.cs @@ -10,7 +10,7 @@ public class MethodBuilderDefineParameter { private const MethodAttributes TestMethodAttributes = MethodAttributes.Public | MethodAttributes.Abstract | MethodAttributes.Virtual; - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void DefineParameter_TwoParameters() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); diff --git a/src/libraries/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderGetILGenerator.cs b/src/libraries/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderGetILGenerator.cs index 9085a34cadbc6..3d1c4ad2e806b 100644 --- a/src/libraries/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderGetILGenerator.cs +++ b/src/libraries/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderGetILGenerator.cs @@ -7,7 +7,7 @@ namespace System.Reflection.Emit.Tests { public class MethodBuilderGetILGenerator { - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(20)] [InlineData(-10)] public void GetILGenerator_Int(int size) diff --git a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineDefaultConstructor.cs b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineDefaultConstructor.cs index bd5bb96baeb3e..95e3bb5876b6a 100644 --- a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineDefaultConstructor.cs +++ b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineDefaultConstructor.cs @@ -34,7 +34,7 @@ public void DefineDefaultConstructor(MethodAttributes attributes) public static bool s_ranConstructor = false; - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void DefineDefaultConstructor_GenericParentCreated_Works() { ModuleBuilder module = Helpers.DynamicModule(); diff --git a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineMethodOverride.cs b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineMethodOverride.cs index e08e4c6be08bf..029b3808a1eb9 100644 --- a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineMethodOverride.cs +++ b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineMethodOverride.cs @@ -18,7 +18,7 @@ public class DefineMethodOverrideClass : DefineMethodOverrideInterface public class MethodBuilderDefineMethodOverride { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void DefineMethodOverride_InterfaceMethod() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); @@ -37,7 +37,7 @@ public void DefineMethodOverride_InterfaceMethod() Assert.Equal(2, createdMethod.Invoke(Activator.CreateInstance(createdType), null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void DefineMethodOverride_InterfaceMethodWithConflictingName() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); @@ -60,7 +60,7 @@ public void DefineMethodOverride_InterfaceMethodWithConflictingName() Assert.Equal(1, createdMethod.Invoke(Activator.CreateInstance(typeof(DefineMethodOverrideClass)), null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void DefineMethodOverride_GenericInterface_Succeeds() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); @@ -78,7 +78,7 @@ public void DefineMethodOverride_GenericInterface_Succeeds() Assert.Equal("Hello World", interfaceMethod.Invoke(Activator.CreateInstance(createdType), null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void DefineMethodOverride_CalledTwiceWithSameBodies_Works() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); diff --git a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineProperty.cs b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineProperty.cs index 82d70c2c34dcc..064d39d6f62bf 100644 --- a/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineProperty.cs +++ b/src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderDefineProperty.cs @@ -60,7 +60,7 @@ public void DefineProperty_NullCustomModifiers() Assert.Equal(typeof(int), property.PropertyType); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void DefineProperty_GetAccessor_NoCustomModifiers() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public | TypeAttributes.AutoClass | TypeAttributes.AnsiClass | TypeAttributes.BeforeFieldInit); @@ -82,7 +82,7 @@ public void DefineProperty_GetAccessor_NoCustomModifiers() Assert.Equal(5, createdType.GetProperty("Property").GetGetMethod().Invoke(obj, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void DefineProperty_GetAccessor_NullCustomModifiers() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public | TypeAttributes.AutoClass | TypeAttributes.AnsiClass | TypeAttributes.BeforeFieldInit); diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs index d0ee2a07074f0..60fee1d24e979 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs @@ -13,6 +13,7 @@ namespace System.Reflection.Metadata.Decoding.Tests public class CustomAttributeDecoderTests { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60579", TestPlatforms.iOS | TestPlatforms.tvOS)] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Type assembly name is different on .NET Framework.")] public void TestCustomAttributeDecoder() { diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/CustomAttributes/CustomAttributeTests.cs b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/CustomAttributes/CustomAttributeTests.cs index b80d81ccdebfb..15d1fa8d2fc00 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/CustomAttributes/CustomAttributeTests.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/CustomAttributes/CustomAttributeTests.cs @@ -14,6 +14,7 @@ namespace System.Reflection.Tests public static partial class CustomAttributeTests { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60579", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void CustomAttributeTest1() { Type t = typeof(AttributeHolder1); // Intentionally not projected. We're reflecting on this (and Invoking it) to get the validation baseline data. diff --git a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs index e9fe758b834f7..2b8160cfa953e 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs @@ -763,14 +763,30 @@ public void SetThreadPrincipal() private void CopyTestAssemblies() { - string destTestAssemblyPath = Path.Combine(Environment.CurrentDirectory, "AssemblyResolveTestApp", "AssemblyResolveTestApp.dll"); + string rootPath; + string assemblyResolvePath = "AssemblyResolveTestApp"; + string appOutsideTPAPath = "TestAppOutsideOfTPA"; + + if (PlatformDetection.IsiOS || PlatformDetection.IstvOS) + { + rootPath = Path.GetTempPath(); + } + else + { + rootPath = Environment.CurrentDirectory; + } + + assemblyResolvePath = Path.Combine(rootPath, assemblyResolvePath); + appOutsideTPAPath = Path.Combine(rootPath, appOutsideTPAPath); + + string destTestAssemblyPath = Path.Combine(assemblyResolvePath, "AssemblyResolveTestApp.dll"); if (!File.Exists(destTestAssemblyPath) && File.Exists("AssemblyResolveTestApp.dll")) { Directory.CreateDirectory(Path.GetDirectoryName(destTestAssemblyPath)); File.Copy("AssemblyResolveTestApp.dll", destTestAssemblyPath, false); } - destTestAssemblyPath = Path.Combine(Environment.CurrentDirectory, "TestAppOutsideOfTPA", "TestAppOutsideOfTPA.exe"); + destTestAssemblyPath = Path.Combine(appOutsideTPAPath, "TestAppOutsideOfTPA.exe"); if (!File.Exists(destTestAssemblyPath) && File.Exists("TestAppOutsideOfTPA.exe")) { Directory.CreateDirectory(Path.GetDirectoryName(destTestAssemblyPath)); diff --git a/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs b/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs index 364f3304fc57c..82097bf4a6f21 100644 --- a/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs @@ -69,6 +69,7 @@ public static void LoadFromNativeImagePath_PartiallyQualifiedPath_ThrowsArgument } [Fact] + [PlatformSpecific(~(TestPlatforms.iOS | TestPlatforms.tvOS))] [ActiveIssue("https://github.com/dotnet/runtime/issues/51893", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] public static void LoadAssemblyByPath_ValidUserAssembly() { @@ -84,6 +85,7 @@ public static void LoadAssemblyByPath_ValidUserAssembly() } [Fact] + [PlatformSpecific(~(TestPlatforms.iOS | TestPlatforms.tvOS))] [ActiveIssue("https://github.com/dotnet/runtime/issues/51893", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] public static void LoadAssemblyByStream_ValidUserAssembly() { @@ -143,6 +145,7 @@ public static void LoadFromAssemblyName_FallbackToDefaultContext() } [Fact] + [PlatformSpecific(~(TestPlatforms.iOS | TestPlatforms.tvOS))] public static void GetLoadContextTest_ValidUserAssembly() { var asmName = new AssemblyName(TestAssembly); diff --git a/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj b/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj index 8b946a20828d2..19e5d6bc5069b 100644 --- a/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj +++ b/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj @@ -25,9 +25,13 @@ - - - + + + + + + + diff --git a/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs b/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs index b8d386a5b71e4..3cbae8430c207 100644 --- a/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs +++ b/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs @@ -1390,6 +1390,7 @@ public static void DCJS_EmptyString_Throws() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCJS_ClassWithDatetimeOffsetTypeProperty() { var value = new TypeWithDateTimeOffsetTypeProperty() { ModifiedTime = new DateTimeOffset(new DateTime(2013, 1, 2, 3, 4, 5, 6, DateTimeKind.Utc)) }; @@ -1458,6 +1459,7 @@ public static void DCJS_TypeWithGenericDictionaryAsKnownType() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCJS_TypeWithKnownTypeAttributeAndInterfaceMember() { TypeWithKnownTypeAttributeAndInterfaceMember value = new TypeWithKnownTypeAttributeAndInterfaceMember(); @@ -1469,6 +1471,7 @@ public static void DCJS_TypeWithKnownTypeAttributeAndInterfaceMember() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCJS_TypeWithKnownTypeAttributeAndListOfInterfaceMember() { TypeWithKnownTypeAttributeAndListOfInterfaceMember value = new TypeWithKnownTypeAttributeAndListOfInterfaceMember(); @@ -2592,6 +2595,7 @@ public static void DCJS_VerifyDateTimeForFormatStringDCJsonSerSetting() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCJS_VerifyDateTimeForFormatStringDCJsonSerSettings() { var jsonTypes = new JsonTypes(); diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs index 038b9130d4dc8..5899cd61ed1ad 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs @@ -34,6 +34,7 @@ static DataContractSerializerTests() } #endif [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_DateTimeOffsetAsRoot() { // Assume that UTC offset doesn't change more often than once in the day 2013-01-02 @@ -1081,6 +1082,7 @@ public static void DCS_WithListOfXElement() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/51679", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_DerivedTypeWithDifferentOverrides() { var x = new DerivedTypeWithDifferentOverrides() { Name1 = "Name1", Name2 = "Name2", Name3 = "Name3", Name4 = "Name4", Name5 = "Name5" }; @@ -1278,6 +1280,7 @@ public static void DCS_EnumFlags() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_SerializeClassThatImplementsInteface() { ClassImplementsInterface value = new ClassImplementsInterface() { ClassID = "ClassID", DisplayName = "DisplayName", Id = "Id", IsLoaded = true }; @@ -1432,6 +1435,7 @@ public static void DCS_KnownTypesThroughConstructor() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_DuplicatedKnownTypesWithAdapterThroughConstructor() { //Constructor# 5 @@ -1559,6 +1563,7 @@ public static void DCS_TypeWithUriTypeProperty() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_TypeWithDatetimeOffsetTypeProperty() { var value = new TypeWithDateTimeOffsetTypeProperty() { ModifiedTime = new DateTimeOffset(new DateTime(2013, 1, 2, 3, 4, 5, 6, DateTimeKind.Utc)) }; @@ -1777,6 +1782,7 @@ public static void DCS_TypeWithGenericDictionaryAsKnownType() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_TypeWithKnownTypeAttributeAndInterfaceMember() { TypeWithKnownTypeAttributeAndInterfaceMember value = new TypeWithKnownTypeAttributeAndInterfaceMember(); @@ -1788,6 +1794,7 @@ public static void DCS_TypeWithKnownTypeAttributeAndInterfaceMember() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_TypeWithKnownTypeAttributeAndListOfInterfaceMember() { TypeWithKnownTypeAttributeAndListOfInterfaceMember value = new TypeWithKnownTypeAttributeAndListOfInterfaceMember(); @@ -1886,6 +1893,7 @@ public static void DCS_GenericTypeWithNestedGenerics() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_DuplicatedKeyDateTimeOffset() { DateTimeOffset value = new DateTimeOffset(new DateTime(2013, 1, 2, 3, 4, 5, 6, DateTimeKind.Utc).AddMinutes(7)); @@ -2633,6 +2641,7 @@ public static void DCS_NonGenericDictionaryOfStringInt32() #endregion [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_BasicRoundTripResolveDTOTypes() { ObjectContainer instance = new ObjectContainer(new DTOContainer()); @@ -2876,6 +2885,7 @@ private static void DCS_BasicRoundTripResolvePrimitiveTypes(string baseline) /// Resolver is plugged in and resolves the primitive types. Verify resolver called during ser and deser /// [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_BasicRoundTripResolvePrimitiveTypes_NotNetFramework() { string baseline = @"<_data i:type=""a:PrimitiveContainer_foo"" xmlns:a=""http://www.default.com"">false25506553579228162514264337593543950335-19999-12-31T23:59:59.9999999-792281625142643375935439503354bc848b1-a541-40bf-8aa9-dd6ccb6d0e5610005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaN-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150AQIDBA==<_data2 i:type=""a:PrimitiveContainer_foo"" xmlns:a=""http://www.default.com"">false25506553579228162514264337593543950335-19999-12-31T23:59:59.9999999-792281625142643375935439503354bc848b1-a541-40bf-8aa9-dd6ccb6d0e5610005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaN-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150AQIDBA==
"; @@ -3121,6 +3131,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_IObjectRef() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_BasicPerSerializerRoundTripAndCompare_SampleTypes() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3762,6 +3773,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_SelfRefCycles() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3845,6 +3857,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct_NotNetFramework() { TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.AllTypes(), "<_data i:type=\"a:SerializationTestTypes.AllTypes***\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.AllTypes***\">false25506553579228162514264337593543950335redred-10001-01-01T00:00:00-792281625142643375935439503355642b5d2-87c3-a724-2390-997062f3f7a210005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaNData-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150<_data2 i:type=\"a:SerializationTestTypes.AllTypes***\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.AllTypes***\">false25506553579228162514264337593543950335redred-10001-01-01T00:00:00-792281625142643375935439503355642b5d2-87c3-a724-2390-997062f3f7a210005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaNData-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150
"); @@ -3856,6 +3869,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct_NotNetFr #endregion [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_TypeWithVirtualGenericProperty() { var value1 = new TypeWithVirtualGenericProperty() { Value = 1 }; @@ -4170,6 +4184,7 @@ public static void DCS_ValidateExceptionOnUnspecifiedRootSerializationType() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_TypeWithCollectionAndDateTimeOffset() { // Adding offsetMinutes so the DateTime component in serialized strings are time-zone independent @@ -4185,6 +4200,7 @@ public static void DCS_TypeWithCollectionAndDateTimeOffset() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60462", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void DCS_TypeWithCollectionAndDateTimeOffset_ListIsNull() { // Adding offsetMinutes so the DateTime component in serialized strings are time-zone independent diff --git a/src/libraries/System.Runtime/tests/System/ByteTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/ByteTests.GenericMath.cs index 140279d54f2d6..eb59a4f5df4a8 100644 --- a/src/libraries/System.Runtime/tests/System/ByteTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/ByteTests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class ByteTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/CharTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/CharTests.GenericMath.cs index 7dd512f9871ed..400d389f963b3 100644 --- a/src/libraries/System.Runtime/tests/System/CharTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/CharTests.GenericMath.cs @@ -6,7 +6,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class CharTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/DoubleTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/DoubleTests.GenericMath.cs index 60a20053823ec..3758dc7acbb86 100644 --- a/src/libraries/System.Runtime/tests/System/DoubleTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/DoubleTests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class DoubleTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/DoubleTests.cs b/src/libraries/System.Runtime/tests/System/DoubleTests.cs index a2946823756b5..5aec864fd38e8 100644 --- a/src/libraries/System.Runtime/tests/System/DoubleTests.cs +++ b/src/libraries/System.Runtime/tests/System/DoubleTests.cs @@ -378,7 +378,7 @@ internal static string Reverse(string s) public static void ParsePatterns() { string path = Directory.GetCurrentDirectory(); - using (FileStream file = new FileStream(Path.Combine(path, "ibm-fpgen.txt"), FileMode.Open)) + using (FileStream file = new FileStream(Path.Combine(path, "ibm-fpgen.txt"), FileMode.Open, FileAccess.Read)) { using (var streamReader = new StreamReader(file)) { diff --git a/src/libraries/System.Runtime/tests/System/HalfTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/HalfTests.GenericMath.cs index c9fe77c9154a9..e9679fb0a21f8 100644 --- a/src/libraries/System.Runtime/tests/System/HalfTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/HalfTests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class HalfTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/Int16Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/Int16Tests.GenericMath.cs index 667a5f55ac22f..023b2650ed169 100644 --- a/src/libraries/System.Runtime/tests/System/Int16Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/Int16Tests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class Int16Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/Int32Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/Int32Tests.GenericMath.cs index 28f3c06c40393..269b2cd7795c4 100644 --- a/src/libraries/System.Runtime/tests/System/Int32Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/Int32Tests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class Int32Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/Int64Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/Int64Tests.GenericMath.cs index ddc380cc36e22..4bf4e37391995 100644 --- a/src/libraries/System.Runtime/tests/System/Int64Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/Int64Tests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class Int64Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/IntPtrTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/IntPtrTests.GenericMath.cs index 1f5b4144f94ca..fea36bfffe18b 100644 --- a/src/libraries/System.Runtime/tests/System/IntPtrTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/IntPtrTests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class IntPtrTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/Reflection/InvokeWithRefLikeArgs.cs b/src/libraries/System.Runtime/tests/System/Reflection/InvokeWithRefLikeArgs.cs index 4f2e4d2da1b0f..0e15a3ce9b9b9 100644 --- a/src/libraries/System.Runtime/tests/System/Reflection/InvokeWithRefLikeArgs.cs +++ b/src/libraries/System.Runtime/tests/System/Reflection/InvokeWithRefLikeArgs.cs @@ -38,7 +38,8 @@ public static void MethodTakesRefStructAsArgWithDefaultValue_DoesNotCopyValueBac Assert.Null(args[0]); // no value should have been copied back } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Moq uses Reflection.Emit + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [SkipOnMono("https://github.com/dotnet/runtime/issues/40738")] public static void MethodTakesRefToRefStructAsArg_ThrowsNSE() { diff --git a/src/libraries/System.Runtime/tests/System/Reflection/MethodBaseTests.cs b/src/libraries/System.Runtime/tests/System/Reflection/MethodBaseTests.cs index a6edc449ec816..f3d82f82396aa 100644 --- a/src/libraries/System.Runtime/tests/System/Reflection/MethodBaseTests.cs +++ b/src/libraries/System.Runtime/tests/System/Reflection/MethodBaseTests.cs @@ -22,6 +22,7 @@ public static void Test_GetCurrentMethod() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60334", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void Test_GetCurrentMethod_Inlineable() { // Verify that the result is not affected by inlining optimizations diff --git a/src/libraries/System.Runtime/tests/System/Runtime/JitInfoTests.cs b/src/libraries/System.Runtime/tests/System/Runtime/JitInfoTests.cs index f44266ebc1897..a4fbb789f5e51 100644 --- a/src/libraries/System.Runtime/tests/System/Runtime/JitInfoTests.cs +++ b/src/libraries/System.Runtime/tests/System/Runtime/JitInfoTests.cs @@ -76,7 +76,7 @@ public void JitInfoIsPopulated() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] // JitInfo metrics will be 0 in AOT scenarios + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT), nameof(PlatformDetection.IsReflectionEmitSupported))] // JitInfo metrics will be 0 in AOT scenarios public void JitInfoIsNotPopulated() { TimeSpan beforeCompilationTime = System.Runtime.JitInfo.GetCompilationTime(); diff --git a/src/libraries/System.Runtime/tests/System/SByteTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/SByteTests.GenericMath.cs index 82877a1e2d609..cdeddf1938ca5 100644 --- a/src/libraries/System.Runtime/tests/System/SByteTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/SByteTests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class SByteTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/SingleTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/SingleTests.GenericMath.cs index 8e7c3e8a1c690..22715a26f53d9 100644 --- a/src/libraries/System.Runtime/tests/System/SingleTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/SingleTests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class SingleTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/Type/TypeTests.cs b/src/libraries/System.Runtime/tests/System/Type/TypeTests.cs index a749e939d226e..c125b558b7c60 100644 --- a/src/libraries/System.Runtime/tests/System/Type/TypeTests.cs +++ b/src/libraries/System.Runtime/tests/System/Type/TypeTests.cs @@ -923,7 +923,7 @@ public void IsContextful() Assert.True(!typeof(ContextBoundClass).IsContextful); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void MakeGenericType_NonRuntimeType() { foreach (Type nonRuntimeType in Helpers.NonRuntimeTypes) diff --git a/src/libraries/System.Runtime/tests/System/UInt16Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/UInt16Tests.GenericMath.cs index 982740495bb9b..fd996ac3a1821 100644 --- a/src/libraries/System.Runtime/tests/System/UInt16Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/UInt16Tests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class UInt16Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/UInt32Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/UInt32Tests.GenericMath.cs index ab6a6e02471ed..4d867c8fa6486 100644 --- a/src/libraries/System.Runtime/tests/System/UInt32Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/UInt32Tests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class UInt32Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/UInt64Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/UInt64Tests.GenericMath.cs index 1b7ee209a9f4b..b80585f45cff0 100644 --- a/src/libraries/System.Runtime/tests/System/UInt64Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/UInt64Tests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class UInt64Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/UIntPtrTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/UIntPtrTests.GenericMath.cs index 8e0c92c2a82c1..1d9a435012ca5 100644 --- a/src/libraries/System.Runtime/tests/System/UIntPtrTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/UIntPtrTests.GenericMath.cs @@ -7,7 +7,7 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class UIntPtrTests_GenericMath { diff --git a/src/libraries/System.Security.Cryptography.Xml/tests/XmlDsigXsltTransformTest.cs b/src/libraries/System.Security.Cryptography.Xml/tests/XmlDsigXsltTransformTest.cs index 1fa91a3c912fb..5081f26d03895 100644 --- a/src/libraries/System.Security.Cryptography.Xml/tests/XmlDsigXsltTransformTest.cs +++ b/src/libraries/System.Security.Cryptography.Xml/tests/XmlDsigXsltTransformTest.cs @@ -132,7 +132,7 @@ public void EmptyXslt() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] // Note that this is _valid_ as an "embedded stylesheet". // (see XSLT spec 2.7) public void EmbeddedStylesheet() @@ -174,7 +174,7 @@ public void InvalidXslt() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void OnlyInner() { string test = ""; @@ -207,7 +207,7 @@ private XmlDocument GetXslDoc() return doc; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void LoadInputAsXmlDocument() { XmlDocument doc = GetXslDoc(); @@ -220,7 +220,7 @@ public void LoadInputAsXmlDocument() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void LoadInputAsXmlNodeList() { XmlDocument doc = GetXslDoc(); @@ -233,7 +233,7 @@ public void LoadInputAsXmlNodeList() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void LoadInputAsStream() { XmlDocument doc = GetXslDoc(); @@ -276,7 +276,7 @@ void AssertNodeListEqual(XmlNodeList nl1, XmlNodeList nl2, string label) Assert.False(e2.MoveNext(), label + " : nl2 has extras"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Load2() { XmlDocument doc = GetXslDoc(); diff --git a/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs b/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs index ffb9f86903c57..6f1dbd29b0c08 100644 --- a/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs +++ b/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs @@ -39,7 +39,8 @@ public static IEnumerable ReadWriteTestBufferLengths } } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void AsyncMethods_ReturnCanceledTaskIfCancellationTokenTripped() { // Arrange @@ -77,7 +78,7 @@ public void CreateTranscodingStream_InvalidArgs() Assert.Throws("outerStreamEncoding", () => Encoding.CreateTranscodingStream(Stream.Null, Encoding.UTF8, null)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(true)] [InlineData(false)] public void CanRead_DelegatesToInnerStream(bool expectedCanRead) @@ -100,7 +101,7 @@ public void CanRead_DelegatesToInnerStream(bool expectedCanRead) Assert.False(actualCanReadAfterDispose); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(true)] [InlineData(false)] public void CanWrite_DelegatesToInnerStream(bool expectedCanWrite) @@ -198,7 +199,8 @@ public void Dispose_WithLeaveOpenTrue_DoesNotDisposeInnerStream() innerStream.Read(Span.Empty); // shouldn't throw } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Flush_FlushesInnerStreamButNotDecodedState() { // Arrange @@ -391,7 +393,7 @@ void RunOneTestIteration(int stringLength) } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public Task ReadApm() { // Tests TranscodingStream.BeginRead / EndRead @@ -432,7 +434,7 @@ public Task ReadApm() suppressExpectedCancellationTokenAsserts: true); // APM pattern doesn't allow flowing CancellationToken } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(ReadWriteTestBufferLengths))] public Task ReadAsync_ByteArray(int bufferLength) { @@ -451,7 +453,7 @@ public Task ReadAsync_ByteArray(int bufferLength) }); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(ReadWriteTestBufferLengths))] public async Task ReadAsync_Memory(int bufferLength) { @@ -717,7 +719,7 @@ public void Write() Assert.Equal(0, innerStream.Position); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Write_WithPartialData() { MemoryStream innerStream = new MemoryStream(); @@ -765,7 +767,8 @@ public void Write_WithInvalidArgs_Throws() Assert.Throws(() => transcodingStream.Write(new byte[5], 6, 0)); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task WriteAsync_WithFullData() { MemoryStream sink = new MemoryStream(); @@ -824,7 +827,8 @@ public async Task WriteAsync_WithFullData() Assert.Equal(0, sink.Position); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task WriteAsync_WithPartialData() { MemoryStream sink = new MemoryStream(); @@ -879,7 +883,8 @@ public void WriteAsync_WithInvalidArgs_Throws() Assert.Throws(() => (object)transcodingStream.WriteAsync(new byte[5], 6, 0)); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void WriteApm() { // Arrange diff --git a/src/libraries/System.Text.RegularExpressions/tests/RegexCultureTests.cs b/src/libraries/System.Text.RegularExpressions/tests/RegexCultureTests.cs index 9155e9a947688..ac0bc82bff7a7 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/RegexCultureTests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/RegexCultureTests.cs @@ -327,6 +327,7 @@ public static IEnumerable Match_In_Different_Cultures_CriticalCases_Te [Theory] [MemberData(nameof(Match_In_Different_Cultures_TestData))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60697", TestPlatforms.iOS | TestPlatforms.tvOS)] public void Match_In_Different_Cultures(string pattern, RegexOptions options, CultureInfo culture, string input, string match_expected) { Regex r = RegexHelpers.CreateRegexInCulture(pattern, options, culture); diff --git a/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs b/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs index fb12696415f7b..958d062011461 100644 --- a/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs +++ b/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs @@ -145,6 +145,7 @@ public void Count_ThrowsIfUnsupported() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public void SingleProducerConsumer_ConcurrentReadWrite_Success() { Channel c = CreateChannel(); @@ -168,6 +169,7 @@ public void SingleProducerConsumer_ConcurrentReadWrite_Success() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public void SingleProducerConsumer_PingPong_Success() { Channel c1 = CreateChannel(); @@ -597,6 +599,7 @@ public async Task WaitToReadAsync_NoDataWritten_Canceled_CompletesAsCanceled() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public async Task ReadAsync_ThenWriteAsync_Succeeds() { Channel c = CreateChannel(); @@ -639,6 +642,7 @@ public void Precancellation_ReadAsync_ReturnsImmediately(bool dataAvailable) } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public async Task ReadAsync_Canceled_CanceledAsynchronously() { Channel c = CreateChannel(); @@ -746,6 +750,7 @@ public async Task ReadAsync_AfterCanceledChannel_Throws() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public async Task ReadAsync_Canceled_WriteAsyncCompletesNextReader() { Channel c = CreateChannel(); @@ -767,6 +772,7 @@ public async Task ReadAsync_Canceled_WriteAsyncCompletesNextReader() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public async Task ReadAsync_ConsecutiveReadsSucceed() { Channel c = CreateChannel(); @@ -877,6 +883,7 @@ public void ReadAsync_MultipleContinuations_Throws(bool onCompleted, bool? conti } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public async Task WaitToReadAsync_AwaitThenGetResult_Throws() { Channel c = CreateChannel(); @@ -890,6 +897,7 @@ public async Task WaitToReadAsync_AwaitThenGetResult_Throws() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public async Task ReadAsync_AwaitThenGetResult_Throws() { Channel c = CreateChannel(); diff --git a/src/libraries/sendtohelix.proj b/src/libraries/sendtohelix.proj index 170aa4964c1fb..f5fd1292fed26 100644 --- a/src/libraries/sendtohelix.proj +++ b/src/libraries/sendtohelix.proj @@ -70,7 +70,7 @@ <_Scenarios Include="$(_Scenarios.Split(','))" /> - <_BaseProjectsToBuild Include="$(PerScenarioProjectFile)" Condition="'%(_Scenarios.Identity)' != 'buildwasmapps'"> + <_BaseProjectsToBuild Include="$(PerScenarioProjectFile)" Condition="'%(_Scenarios.Identity)' != 'buildwasmapps' and '%(_Scenarios.Identity)' != 'buildiosapps'"> $(_PropertiesToPass);Scenario=%(_Scenarios.Identity);TestArchiveRuntimeFile=$(TestArchiveRuntimeFile) %(_BaseProjectsToBuild.AdditionalProperties);NeedsToBuildWasmAppsOnHelix=$(NeedsToBuildWasmAppsOnHelix) @@ -86,8 +86,18 @@
+ + + <_TestUsingWorkloadsValues Include="false" /> + + <_BuildiOSAppsProjectsToBuild Include="$(PerScenarioProjectFile)"> + $(_PropertiesToPass);Scenario=BuildiOSApps;TestArchiveRuntimeFile=$(TestArchiveRuntimeFile);TestUsingWorkloads=%(_TestUsingWorkloadsValues.Identity) + %(_BuildiOSAppsProjectsToBuild.AdditionalProperties);NeedsToBuildAppsOnHelix=$(NeedsToBuildAppsOnHelix) + + + - <_ProjectsToBuild Include="@(_BuildWasmAppsProjectsToBuild);@(_BaseProjectsToBuild)" /> + <_ProjectsToBuild Include="@(_BuildWasmAppsProjectsToBuild);@(_BuildiOSAppsProjectsToBuild);@(_BaseProjectsToBuild)" /> @@ -122,7 +132,7 @@
- + diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 5eda5fb86a2ae..3eac0bacd9245 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -26,7 +26,8 @@ '$(Scenario)' == 'gcstress0xc_jitstress1' or '$(Scenario)' == 'gcstress0xc_jitstress2' or '$(Scenario)' == 'gcstress0xc_jitminopts_heapverify1'">01:30:00 - <_workItemTimeout Condition="'$(_workItemTimeout)' == '' and ('$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator' or '$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'Android')">00:30:00 + <_workItemTimeout Condition="'$(_workItemTimeout)' == '' and ('$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOSSimulator' or '$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'Android')">00:30:00 + <_workItemTimeout Condition="'$(_workItemTimeout)' == '' and ('$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS')">00:45:00 <_workItemTimeout Condition="'$(Scenario)' == '' and '$(_workItemTimeout)' == '' and ('$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm')">00:45:00 <_workItemTimeout Condition="'$(Scenario)' != '' and '$(_workItemTimeout)' == '' and ('$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm')">01:00:00 <_workItemTimeout Condition="'$(Scenario)' == 'BuildWasmApps' and '$(_workItemTimeout)' == ''">01:30:00 @@ -56,6 +57,10 @@ $(RepositoryEngineeringDir)\testing\scenarios\BuildWasmAppsJobsList.txt $(WaitForWorkItemCompletion) + true + + true + $(RepoRoot)src\mono\wasm\emsdk\ true @@ -87,6 +92,11 @@
+ + + + + @@ -137,6 +147,13 @@ true
+ + + true + true + true + + $(AppleTestTarget) + $(_workItemTimeout) + $(_XHarnessAppleCustomCommand) + + + + + $(AppleTestTarget) + $(_workItemTimeout) + $(_XHarnessAppleCustomCommand) - + + + false + + 42 + $(AppleTestTarget) + + + + false @@ -382,6 +411,16 @@ + + + + + + + + + + @@ -403,7 +442,7 @@ @@ -470,6 +509,15 @@ + + <_TestPath Condition="'%(XHarnessAppBundleToTest.CustomCommands)' != ''">$([System.IO.Path]::GetDirectoryName('%(XHarnessAppBundleToTest.Identity)')) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -204,6 +243,9 @@ + + + @@ -242,7 +284,9 @@ + + @@ -318,37 +362,37 @@ - - - - - + + - + - - - - - - + + + + + + + + + + + $(NetCoreAppCurrent) + false + false + true + link + false + + diff --git a/src/mono/msbuild/apple/build/AppleApp.InTree.targets b/src/mono/msbuild/apple/build/AppleApp.InTree.targets new file mode 100644 index 0000000000000..a26c706971f0e --- /dev/null +++ b/src/mono/msbuild/apple/build/AppleApp.InTree.targets @@ -0,0 +1,40 @@ + + + + + + + + + + + + + <_LocalMicrosoftNetCoreAppRuntimePackDir>$(MicrosoftNetCoreAppRuntimePackDir) + + + + + + + + + + $(MSBuildProjectName) + + + $(TargetOS).AnyCPU.$(Configuration) + $([MSBuild]::NormalizeDirectory($(ArtifactsDir), 'helix')) + $([MSBuild]::NormalizeDirectory($(HelixArchiveRoot), 'runonly')) + $([MSBuild]::NormalizeDirectory($(HelixArchiveRunOnlyRoot), $(OSPlatformConfig), $(WasmHelixTestAppRelativeDir))) + $(OutputPath)$(AssemblyName).zip + + + + + diff --git a/src/mono/msbuild/apple/build/AppleApp.LocalBuild.props b/src/mono/msbuild/apple/build/AppleApp.LocalBuild.props new file mode 100644 index 0000000000000..5d1d76f585da5 --- /dev/null +++ b/src/mono/msbuild/apple/build/AppleApp.LocalBuild.props @@ -0,0 +1,73 @@ + + + + + + <_NetCoreAppCurrent>net7.0 + <_NetCoreAppToolCurrent>net6.0 + false + + + + $(RuntimeSrcDir)\artifacts\bin\ + $([MSBuild]::NormalizeDirectory($(ArtifactsBinDir), 'microsoft.netcore.app.runtime.$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())', $(RuntimeConfig))) + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackLocationToUse), 'runtimes', '$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())', 'lib', '$(_NetCoreAppCurrent)')) + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackLocationToUse), 'runtimes', '$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())', 'native')) + + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AppleAppBuilder', 'Debug', '$(_NetCoreAppToolCurrent)')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'MonoAOTCompiler', 'Debug', '$(_NetCoreAppToolCurrent)')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'MonoTargetsTasks', 'Debug', '$(_NetCoreAppToolCurrent)')) + + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'mono', '$(TargetOS).$(TargetArchitecture).$(RuntimeConfig)')) + $([MSBuild]::NormalizePath($(MonoArtifactsPath), 'cross', '$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())')) + <_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross')) + <_MonoAotCrossCompilerPath Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">$(_MonoAotCrossCompilerPath).exe + + + + $(AppleBuildSupportDir)\ + + $([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'microsoft.netcore.app.runtime.$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())')) + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackLocationToUse), 'runtimes', '$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())', 'lib', '$(_NetCoreAppCurrent)')) + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackLocationToUse), 'runtimes', '$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())', 'native')) + $([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'MonoAOTCompiler')) + $([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'MonoTargetsTasks')) + $([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'AppleAppBuilder')) + + $([MSBuild]::NormalizePath($(BuildBaseDir), 'cross')) + <_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross')) + <_MonoAotCrossCompilerPath Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">$(_MonoAotCrossCompilerPath).exe + + + + + + + + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackLocationToUse))) + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackDir), 'runtimes', '$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())')) + $([MSBuild]::NormalizePath('$(AppleAppBuilderDir)', 'AppleAppBuilder.dll')) + $([MSBuild]::NormalizePath('$(MonoAOTCompilerDir)', 'MonoAOTCompiler.dll')) + $([MSBuild]::NormalizePath('$(MonoTargetsTasksDir)', 'MonoTargetsTasks.dll')) + + + diff --git a/src/mono/msbuild/apple/build/AppleApp.LocalBuild.targets b/src/mono/msbuild/apple/build/AppleApp.LocalBuild.targets new file mode 100644 index 0000000000000..524f71be9ff14 --- /dev/null +++ b/src/mono/msbuild/apple/build/AppleApp.LocalBuild.targets @@ -0,0 +1,81 @@ + + + + + + + + true + link + + + + true + false + + + + + + + + + + + + + + + + + + + + + + + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackLocationToUse))) + $([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackDir), 'runtimes', '$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())')) + $([MSBuild]::NormalizePath('$(AppleAppBuilderDir)', 'AppleAppBuilder.dll')) + $([MSBuild]::NormalizePath('$(MonoAOTCompilerDir)', 'MonoAOTCompiler.dll')) + $([MSBuild]::NormalizePath('$(MonoTargetsTasksDir)', 'RuntimeConfigParser.dll')) + + + + + diff --git a/src/mono/msbuild/apple/build/AppleApp.props b/src/mono/msbuild/apple/build/AppleApp.props new file mode 100644 index 0000000000000..9943c4ee7c2e3 --- /dev/null +++ b/src/mono/msbuild/apple/build/AppleApp.props @@ -0,0 +1,19 @@ + + + $(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant()) + true + true + + + + Publish + + _InitializeCommonProperties; + _BeforeAppleBuildApp; + _AppleResolveReferences; + _AppleAotCompileApp; + _AppleGenerateAppBundle; + _AfterAppleBuildApp + + + \ No newline at end of file diff --git a/src/mono/msbuild/apple/build/AppleApp.targets b/src/mono/msbuild/apple/build/AppleApp.targets new file mode 100644 index 0000000000000..cb388d01b750b --- /dev/null +++ b/src/mono/msbuild/apple/build/AppleApp.targets @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + <_MobileIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'mobile')) + + + + + + <_AppleRuntimeConfigFilePath Condition="'$(_AppleRuntimeConfigFilePath)' == ''">$([MSBuild]::NormalizePath($(AppleAppDir), '$(AssemblyName).runtimeconfig.json')) + <_ParsedRuntimeConfigFilePath Condition="'$(_ParsedRuntimeConfigFilePath)' == ''">$([MSBuild]::NormalizePath($(AppleAppDir), 'runtimeconfig.bin')) + + + + + + + + <_AppleAssembliesInternal Remove="@(_AppleAssembliesInternal)" /> + <_AppleAssembliesInternal Include="@(AppleAssembliesToBundle)"> + <_InternalForceInterpret>%(AppleAssembliesToBundle._InternalForceInterpret) + <_IsNative>%(AppleAssembliesToBundle._IsNative) + + + + + + + + <_AOTMode Condition="'$(UseMonoJustInterp)' != 'true'">Full + <_AOTMode Condition="'$(UseMonoJustInterp)' == 'true'">JustInterp + + + + + + + + + + + + + + + + + + + + + + + + + + @(MonoAOTCompilerDefaultAotArguments, ';') + @(MonoAOTCompilerDefaultProcessArguments, ';') + + + + <_AotExcludeAssemblies Include="*System.Runtime.WindowsRuntime.dll" /> + + + <_InternalForceInterpret>%(_AppleAssembliesInternal._InternalForceInterpret) + <_IsNative>%(_AppleAssembliesInternal._IsNative) + + + <_AotInputAssemblies Include="@(_AppleAssembliesInternal)" + Condition="'%(_AppleAssembliesInternal._InternalForceInterpret)' != 'true'"> + $(AotArguments) + $(ProcessArguments) + + + <_AOT_InternalForceInterpretAssemblies Include="@(_AppleAssembliesInternal->WithMetadataValue('_InternalForceInterpret', 'true'))" /> + <_AppleAssembliesInternal Remove="@(_AppleAssembliesInternal)" /> + + + + + + + + + + + + <_AppleAssembliesInternal Include="@(_AOT_InternalForceInterpretAssemblies)" /> + + + + + + + + + + + + + + + + + + + + + <_RuntimeConfigReservedProperties Include="RUNTIME_IDENTIFIER"/> + <_RuntimeConfigReservedProperties Include="APP_CONTEXT_BASE_DIRECTORY"/> + + + + + + \ No newline at end of file diff --git a/src/mono/msbuild/apple/data/Directory.Build.props b/src/mono/msbuild/apple/data/Directory.Build.props new file mode 100644 index 0000000000000..51a42316d05ee --- /dev/null +++ b/src/mono/msbuild/apple/data/Directory.Build.props @@ -0,0 +1,16 @@ + + + $(HELIX_CORRELATION_PAYLOAD)\build\ + <_AppleTargetsDir>$(AppleBuildSupportDir)\apple\ + + + + <_AppleTargetsDir Condition="'$(_AppleTargetsDir)' == '' and '$(RuntimeSrcDir)' != ''">$(RuntimeSrcDir)\src\mono\msbuild\apple\build\ + <_AppleTargetsDir Condition="'$(_AppleTargetsDir)' != ''">$([MSBuild]::EnsureTrailingSlash($(_AppleTargetsDir))) + + + + + PrepareForAppleBuild;$(AppleBuildAppDependsOn) + + diff --git a/src/mono/msbuild/apple/data/Directory.Build.targets b/src/mono/msbuild/apple/data/Directory.Build.targets new file mode 100644 index 0000000000000..1cf9e918b3702 --- /dev/null +++ b/src/mono/msbuild/apple/data/Directory.Build.targets @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj new file mode 100644 index 0000000000000..658cde62ce6c5 --- /dev/null +++ b/src/mono/msbuild/apple/data/ProxyProjectForAOTOnHelix.proj @@ -0,0 +1,77 @@ + + + + $(HELIX_WORKITEM_ROOT)\apple_build\ + $(MSBuildThisFileDirectory)..\apple_build\ + + true + $(TestRootDir)..\publish\ + $(OriginalPublishDir)..\extraFiles\ + $(TestRootDir)\obj\ + + _PrepareForAppleBuildAppOnHelix;$(AppleBuildAppDependsOn);_AfterAppleBuildAppOnHelix + + <_PropsFile>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).props + + + + + + + + + + + $(OriginalPublishDir) + $(TestRootDir)AppBundle\ + + $(OriginalPublishDir)AppleTestRunner.dll + true + + + + + + + + <_ExtraFiles Include="$(ExtraFilesPath)**\*" /> + + + + + + + + + + <_RuntimePackFiles Condition="%(_AppleUsedRuntimePackFiles.Extension) == '.dll' and %(_AppleUsedRuntimePackFiles.FileName) != 'System.Private.CoreLib'" Include="@(_AppleUsedRuntimePackFiles->'$(MicrosoftNetCoreAppRuntimePackLibDir)%(FileName)%(Extension)')" /> + <_RuntimePackFiles Condition="%(_AppleUsedRuntimePackFiles.Extension) != '.dll' or %(_AppleUsedRuntimePackFiles.FileName) == 'System.Private.CoreLib'" Include="@(_AppleUsedRuntimePackFiles->'$(MicrosoftNetCoreAppRuntimePackNativeDir)%(FileName)%(Extension)')" /> + + + + + + + + + <_TestProjectName>$([System.IO.Path]::GetFileName('$(AppBundlePath)')) + <_XHarnessAppPath>$([MSBuild]::NormalizeDirectory($(XHARNESS_EXECUTION_DIR), $(_TestProjectName))) + + + <_AppBundleFiles Include="$(AppBundlePath)\**\*" /> + <_AppBundleFiles Include="$(XHARNESS_EXECUTION_DIR)\*.mobileprovision" /> + + + + + + + + + + + diff --git a/src/tasks/AppleAppBuilder/Templates/runtime.m b/src/tasks/AppleAppBuilder/Templates/runtime.m index b885afb56db27..5a76abd589195 100644 --- a/src/tasks/AppleAppBuilder/Templates/runtime.m +++ b/src/tasks/AppleAppBuilder/Templates/runtime.m @@ -330,6 +330,8 @@ mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP); #else mono_jit_set_aot_mode (MONO_AOT_MODE_FULL); + // it's for PlatformDetection.IsMonoAOT on iOS/tvOS + setenv ("MONO_AOT_MODE", "aot", TRUE); #endif #endif