diff --git a/eng/pipelines/coreclr/templates/helix-queues-setup.yml b/eng/pipelines/coreclr/templates/helix-queues-setup.yml index 9ac1307961dea..272bd4282c982 100644 --- a/eng/pipelines/coreclr/templates/helix-queues-setup.yml +++ b/eng/pipelines/coreclr/templates/helix-queues-setup.yml @@ -32,9 +32,13 @@ jobs: dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }} helixQueues: - # iOS/tvOS simulator x64/x86 - - ${{ if in(parameters.platform, 'iossimulator_x64', 'tvossimulator_x64') }}: - - OSX.1015.Amd64.Open + # iOS Simulator/Mac Catalyst arm64 + - ${{ if in(parameters.platform, 'maccatalyst_arm64', 'iossimulator_arm64') }}: + - OSX.1200.Arm64.Open + + # iOS/tvOS Simulator x64 & MacCatalyst x64 + - ${{ if in(parameters.platform, 'iossimulator_x64', 'tvossimulator_x64', 'maccatalyst_x64') }}: + - OSX.1200.Amd64.Open # Android arm64 - ${{ if in(parameters.platform, 'android_arm64') }}: @@ -48,6 +52,18 @@ jobs: - ${{ if eq(parameters.platform, 'browser_wasm') }}: - (Ubuntu.1804.Amd64)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-webassembly + # iOS devices + - ${{ if in(parameters.platform, 'ios_arm64') }}: + # split traffic for runtime-extra-platforms (which mostly runs on rolling builds) + - ${{ if ne(parameters.jobParameters.isExtraPlatforms, true) }}: + - OSX.1015.Amd64.Iphone.Open + - ${{ if eq(parameters.jobParameters.isExtraPlatforms, true) }}: + - OSX.1200.Amd64.Iphone.Open + + # tvOS devices + - ${{ if in(parameters.platform, 'tvos_arm64') }}: + - OSX.13.Amd64.AppleTV.Open + # Linux arm - ${{ if eq(parameters.platform, 'linux_arm') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml index 86b62963de640..f856d6211df25 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml @@ -43,3 +43,45 @@ jobs: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true + +# +# Build the whole product using Mono for iOS/tvOS and run runtime tests with iOS/tvOS devices +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} + platforms: + - ios_arm64 + - tvos_arm64 + variables: + - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: pr/dotnet/runtime/$(Build.SourceBranch) + - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: ci/dotnet/runtime/$(Build.SourceBranch) + - name: timeoutPerTestInMinutes + value: 60 + - name: timeoutPerTestCollectionInMinutes + value: 180 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono_RuntimeTests + buildArgs: -s mono+libs -c $(_BuildConfig) + timeoutInMinutes: 240 + # extra steps, run tests + extraVariablesTemplates: + - template: /eng/pipelines/common/templates/runtimes/test-variables.yml + parameters: + testGroup: innerloop + extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml + extraStepsParameters: + creator: dotnet-bot + # FIXME: Currently, tracing/eventpipe tests are only enabled on iOS platforms. It should be expanded to include all runtime tests. Tracking issue: https://github.com/dotnet/runtime/issues/84254 + testBuildArgs: tree tracing/eventpipe + testRunNamePrefixSuffix: Mono_$(_BuildConfig) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml index b1514af8023c4..308fbd384e943 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml @@ -45,3 +45,46 @@ jobs: creator: dotnet-bot interpreter: true testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Build the whole product using Mono for iOSSimulator/tvOSSimulator and run runtime tests with iOS/tvOS simulators +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }} + platforms: + - iossimulator_x64 + - tvossimulator_x64 + - iossimulator_arm64 + variables: + - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: pr/dotnet/runtime/$(Build.SourceBranch) + - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: ci/dotnet/runtime/$(Build.SourceBranch) + - name: timeoutPerTestInMinutes + value: 60 + - name: timeoutPerTestCollectionInMinutes + value: 180 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono_RuntimeTests + buildArgs: -s mono+libs -c $(_BuildConfig) + timeoutInMinutes: 240 + # extra steps, run tests + extraVariablesTemplates: + - template: /eng/pipelines/common/templates/runtimes/test-variables.yml + parameters: + testGroup: innerloop + extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml + extraStepsParameters: + creator: dotnet-bot + # FIXME: Currently, tracing/eventpipe tests are only enabled on iOS platforms. It should be expanded to include all runtime tests. Tracking issue: https://github.com/dotnet/runtime/issues/84254 + testBuildArgs: tree tracing/eventpipe + testRunNamePrefixSuffix: Mono_$(_BuildConfig) diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 6c6837a74938a..acfb67eaf7952 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -125,11 +125,7 @@ jobs: # tvOS devices - ${{ if in(parameters.platform, 'tvos_arm64') }}: - # if necessary, you can split traffic between queues this way for PR's and rolling builds - - ${{ if ne(parameters.jobParameters.isExtraPlatforms, true) }}: - - OSX.13.Amd64.AppleTV.Open - - ${{ if eq(parameters.jobParameters.isExtraPlatforms, true) }}: - - OSX.13.Amd64.AppleTV.Open + - OSX.13.Amd64.AppleTV.Open # windows x64 - ${{ if eq(parameters.platform, 'windows_x64') }}: diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index dbe3a058c8a21..14ee0e97d7269 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -60,6 +60,10 @@ WARNING: When setting properties based on their current state (for example: 0 @(RuntimeHostConfigurationOption -> '-p "%(Identity)=%(Value)"', ' ') + ios-simulator-64 + ios-device + tvos-simulator + tvos-device - + - <_PropertiesToPass Condition="'$(TargetOS)' == 'browser' Or '$(TargetsAndroid)' == 'true'"> + <_PropertiesToPass Condition="'$(TargetOS)' == 'browser' Or '$(TargetsAndroid)' == 'true' Or '$(TargetsiOS)' == 'true' Or '$(TargetsiOSSimulator)' == 'true' Or '$(TargetstvOS)' == 'true' Or '$(TargetstvOSSimulator)' == 'true'"> $(_PropertiesToPass); IncludeDotNetCli=$(IncludeDotNetCli); DotNetCliRuntime=$(DotNetCliRuntime); @@ -161,6 +161,9 @@ browser-wasm android-$(TargetArchitecture) iossimulator-$(TargetArchitecture) + ios-$(TargetArchitecture) + tvossimulator-$(TargetArchitecture) + tvos-$(TargetArchitecture) @@ -507,6 +510,7 @@ Condition="'$(TargetsAppleMobile)' == 'true'" Outputs="%(_MergedWrapperMarker.FileName)" DependsOnTargets="DiscoverMergedTestWrappers;GetTestExclusionList"> + <_MergedWrapperDirectory>%(_MergedWrapperMarker.RootDir)%(Directory) <_MergedWrapperName>%(_MergedWrapperMarker.FileName) @@ -593,7 +597,7 @@ $([System.TimeSpan]::FromMinutes($(TimeoutPerTestInMinutes)).TotalMilliseconds) true <_XUnitParallelMode>collections - <_XUnitParallelMode Condition=" '$(TargetsAndroid)' == 'true' or '$(TargetsiOSSimulator)' == 'true'">none + <_XUnitParallelMode Condition=" '$(TargetsAndroid)' == 'true' or '$(TargetsiOSSimulator)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOSSimulator)' == 'true' or '$(TargetstvOS)' == 'true'">none <_XUnitParallelMode Condition=" '$(LongRunningGCTests)' == 'true' ">none <_XUnitParallelMode Condition=" '$(GcSimulatorTests)' == 'true' ">none -parallel $(_XUnitParallelMode) -nocolor -noshadow -xml testResults.xml @@ -735,8 +739,8 @@ - - + + sos https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/flat2/dotnet-sos/$(DotnetSosVersion)/dotnet-sos.$(DotnetSosVersion).nupkg @@ -836,6 +840,21 @@ + + + + + + + + ios-simulator-64 + tvos-simulator + ios-device + tvos-device + maccatalyst + + %(PayloadDirectory) @@ -859,17 +878,15 @@ - ios-simulator-64 - ios-simulator-64 + $(AppleTestTarget) $([System.TimeSpan]::FromMinutes($(TimeoutPerTestCollectionInMinutes))) - dotnet $(XUnitRunnerDll) %(XUnitWrapperDlls) $(XUnitRunnerArgs) - dotnet $(XUnitRunnerDll) %(XUnitWrapperDlls) $(XUnitRunnerArgs) -trait TestGroup=%(TestGroup) + $(SigningCommand) dotnet $(XUnitRunnerDll) %(XUnitWrapperDlls) $(XUnitRunnerArgs) + $(SigningCommand) dotnet $(XUnitRunnerDll) %(XUnitWrapperDlls) $(XUnitRunnerArgs) -trait TestGroup=%(TestGroup) --set-env=TestExclusionListPath=TestExclusionList.txt - ios-simulator-64 - ios-simulator-64 + $(AppleTestTarget) $([System.TimeSpan]::FromMinutes($(TimeoutPerTestCollectionInMinutes))) diff --git a/src/tests/Directory.Build.props b/src/tests/Directory.Build.props index a4ab1e95933de..427fb95e0b420 100644 --- a/src/tests/Directory.Build.props +++ b/src/tests/Directory.Build.props @@ -80,6 +80,9 @@ false true + false + true + false true llvmaot @@ -202,6 +205,12 @@ false + + true + true + true + + diff --git a/src/tests/build.proj b/src/tests/build.proj index 953dfd1d36db2..d9df2372171cb 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -277,13 +277,24 @@ $(IntermediateOutputPath)\iOSApps\$(Category) $(XUnitTestBinBase)$(CategoryWithSlash)\$(Category).app diagnostics_tracing;marshal-ilgen + 127.0.0.1:9000,nosuspend,listen + True $(Category) - $(ArtifactsBinDir)microsoft.netcore.app.runtime.iossimulator-$(TargetArchitecture)/$(Configuration)/runtimes/iossimulator-$(TargetArchitecture) + iossimulator + ios + tvossimulator + tvos + $(ArtifactsBinDir)microsoft.netcore.app.runtime.$(RuntimePackOSSuffix)-$(TargetArchitecture)/$(Configuration)/runtimes/$(RuntimePackOSSuffix)-$(TargetArchitecture) $(MicrosoftNetCoreAppRuntimePackDir)/native + + + + True + @@ -331,24 +342,115 @@ SourceFiles="%(ExtraDlls.Identity)" DestinationFolder="$(BuildDir)/testdir-%(ExtraDlls.TestDllFilename)" /> + + + + + + + + + + + + + + + + + + + + + + + + <_AOTMode Condition="'$(MonoForceInterpreter)' != 'true'">Full + <_AOTMode Condition="'$(MonoForceInterpreter)' == 'true'">JustInterp + @(MonoAOTCompilerDefaultAotArguments, ';') + @(MonoAOTCompilerDefaultProcessArguments, ';') + <_MobileIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'mobile')) + + + + <_AppleAssembliesInternal Include="$(BuildDir)/**/*.dll" /> + + <_AppleAssembliesInternal> + <_InternalForceInterpret Condition="'$(MonoForceInterpreter)' == 'true' and '%(FileName)%(Extension)' != 'System.Private.CoreLib.dll'">true + <_IsNative>false + + + <_AotInputAssemblies Include="@(_AppleAssembliesInternal)" + Condition="'%(_AppleAssembliesInternal._InternalForceInterpret)' != 'true'"> + $(AotArguments) + $(ProcessArguments) + + + <_AOT_InternalForceInterpretAssemblies Include="@(_AppleAssembliesInternal->WithMetadataValue('_InternalForceInterpret', 'true'))" /> + <_AppleAssembliesInternal Remove="@(_AppleAssembliesInternal)" /> + + + + + + <_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross')) + <_MonoAotCrossCompilerPath Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">$(_MonoAotCrossCompilerPath).exe + - + + + + + + + + + + + + + + + <_AppleAssembliesInternal Include="@(_AOT_InternalForceInterpretAssemblies)" /> + + + + + + + ForceInterpreter="$(MonoForceInterpreter)" + EnableAppSandbox="$(EnableAppSandbox)"> @@ -485,6 +587,7 @@ $(GroupBuildCmd) "/p:__SkipRestorePackages=1" $(GroupBuildCmd) /nodeReuse:false $(GroupBuildCmd) /maxcpucount + $(GroupBuildCmd) "/p:DevTeamProvisioning=-" $(GroupBuildCmd) /bl:$(ArtifactsDir)/log/$(Configuration)/InnerManagedTestBuild.$(__TestGroupToBuild).binlog $(GroupBuildCmd) "/p:CrossBuild=true" $(GroupBuildCmd) "/p:DefaultBuildAllTarget=BuildNativeAot" @@ -571,7 +674,7 @@ + Condition="'$(__BuildTestWrappersOnly)' != '1' and '$(__GenerateLayoutOnly)' != '1' and '$(__CopyNativeTestBinaries)' != '1' and '$(RunWithiOS)' == 'true'" /> - + needs triage @@ -2833,7 +2833,7 @@ - + expected failure: overlapped structs fail at AOT compile time, not runtime @@ -3193,7 +3193,7 @@ - + https://github.com/dotnet/runtime/issues/48914 @@ -3212,48 +3212,33 @@ https://github.com/dotnet/runtime/issues/75767 - + needs triage - + needs triage - + needs triage - + needs triage - + needs triage needs triage - - needs triage - needs triage needs triage - - needs triage - - - needs triage - - - needs triage - needs triage - - needs triage - needs triage @@ -3277,8 +3262,8 @@ - - + + https://github.com/dotnet/runtime/issues/57350 @@ -4135,7 +4120,7 @@ - + missing assembly @@ -4323,30 +4308,12 @@ missing assembly - - https://github.com/dotnet/runtime/issues/74891 - - - https://github.com/dotnet/runtime/issues/74891 - - - https://github.com/dotnet/runtime/issues/74891 - https://github.com/dotnet/runtime/issues/74891 - - https://github.com/dotnet/runtime/issues/74891 - https://github.com/dotnet/runtime/issues/74891 - - https://github.com/dotnet/runtime/issues/74891 - - - https://github.com/dotnet/runtime/issues/74891 - https://github.com/dotnet/runtime/issues/74891 @@ -4356,9 +4323,6 @@ https://github.com/dotnet/runtime/issues/74891 - - https://github.com/dotnet/runtime/issues/74891 - needs triage @@ -4391,7 +4355,16 @@ - + + + needs triage + + + needs triage + + + + mobile and wasm don't support tests with native libraries. wasm also needs static linking diff --git a/src/tests/tracing/eventpipe/common/IpcTraceTest.cs b/src/tests/tracing/eventpipe/common/IpcTraceTest.cs index 9cfd3c86e8fa3..3f107c511d891 100644 --- a/src/tests/tracing/eventpipe/common/IpcTraceTest.cs +++ b/src/tests/tracing/eventpipe/common/IpcTraceTest.cs @@ -204,7 +204,7 @@ private int Validate(bool enableRundownProvider = true) Func optionalTraceValidationCallback = null; DiagnosticsClient client = new DiagnosticsClient(processId); #if DIAGNOSTICS_RUNTIME - if (OperatingSystem.IsAndroid()) + if (OperatingSystem.IsAndroid() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS()) client = new DiagnosticsClient(new IpcEndpointConfig("127.0.0.1:9000", IpcEndpointConfig.TransportType.TcpSocket, IpcEndpointConfig.PortType.Listen)); #endif var readerTask = new Task(() => @@ -344,7 +344,7 @@ private int Validate(bool enableRundownProvider = true) // the process that created them, so we don't need to check on that platform. static public bool EnsureCleanEnvironment() { - if (!OperatingSystem.IsWindows() && !OperatingSystem.IsBrowser()) + if (!OperatingSystem.IsWindows() && !OperatingSystem.IsBrowser() && !OperatingSystem.IsIOS() && !OperatingSystem.IsTvOS()) { Func<(IEnumerable>, List)> getPidsAndSockets = () => { diff --git a/src/tests/tracing/eventpipe/common/IpcUtils.cs b/src/tests/tracing/eventpipe/common/IpcUtils.cs index 1b0bebbcfdc94..e2130f4525fe8 100644 --- a/src/tests/tracing/eventpipe/common/IpcUtils.cs +++ b/src/tests/tracing/eventpipe/common/IpcUtils.cs @@ -446,7 +446,7 @@ public static Stream GetStandardTransport(int processId) namedPipe.Connect(3); return namedPipe; } - else if (OperatingSystem.IsAndroid()) + else if (OperatingSystem.IsAndroid() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS()) { TcpClient client = new TcpClient("127.0.0.1", 9000); return client.GetStream(); diff --git a/src/tests/tracing/eventpipe/processinfo/processinfo.cs b/src/tests/tracing/eventpipe/processinfo/processinfo.cs index 0461d869205e2..a62865bf2dff8 100644 --- a/src/tests/tracing/eventpipe/processinfo/processinfo.cs +++ b/src/tests/tracing/eventpipe/processinfo/processinfo.cs @@ -142,16 +142,17 @@ public static int Main() string commandLine = System.Text.Encoding.Unicode.GetString(response.Payload[start..end]).TrimEnd('\0'); Logger.logger.Log($"commandLine: \"{commandLine}\""); - // The following logic is tailored to this specific test where the cmdline _should_ look like the following: - // /path/to/corerun /path/to/processinfo.dll - // or - // "C:\path\to\CoreRun.exe" C:\path\to\processinfo.dll - string currentProcessCommandLine = $"{currentProcess.MainModule.FileName} {System.Reflection.Assembly.GetExecutingAssembly().Location}"; - string receivedCommandLine = NormalizeCommandLine(commandLine); - // ActiveIssue https://github.com/dotnet/runtime/issues/62729 - if (!OperatingSystem.IsAndroid()) + if (!OperatingSystem.IsAndroid() && !OperatingSystem.IsIOS() && !OperatingSystem.IsTvOS()) + { + // The following logic is tailored to this specific test where the cmdline _should_ look like the following: + // /path/to/corerun /path/to/processinfo.dll + // or + // "C:\path\to\CoreRun.exe" C:\path\to\processinfo.dll + string currentProcessCommandLine = $"{currentProcess.MainModule.FileName} {System.Reflection.Assembly.GetExecutingAssembly().Location}"; + string receivedCommandLine = NormalizeCommandLine(commandLine); Utils.Assert(currentProcessCommandLine.Equals(receivedCommandLine, StringComparison.OrdinalIgnoreCase), $"CommandLine must match current process. Expected: {currentProcessCommandLine}, Received: {receivedCommandLine} (original: {commandLine})"); + } // VALIDATE OS start = end; @@ -184,6 +185,10 @@ public static int Main() { expectedOSValue = "Android"; } + else if (OperatingSystem.IsIOS() || OperatingSystem.IsTvOS()) + { + expectedOSValue = "iOS"; + } else { expectedOSValue = "Unknown"; diff --git a/src/tests/tracing/eventpipe/processinfo2/processinfo2.cs b/src/tests/tracing/eventpipe/processinfo2/processinfo2.cs index 94ae0fa712462..0c04dd3caef87 100644 --- a/src/tests/tracing/eventpipe/processinfo2/processinfo2.cs +++ b/src/tests/tracing/eventpipe/processinfo2/processinfo2.cs @@ -143,16 +143,17 @@ public static int Main() string commandLine = System.Text.Encoding.Unicode.GetString(response.Payload[start..end]).TrimEnd('\0'); Logger.logger.Log($"commandLine: \"{commandLine}\""); - // The following logic is tailored to this specific test where the cmdline _should_ look like the following: - // /path/to/corerun /path/to/processinfo.dll - // or - // "C:\path\to\CoreRun.exe" C:\path\to\processinfo.dll - string currentProcessCommandLine = $"{currentProcess.MainModule.FileName} {System.Reflection.Assembly.GetExecutingAssembly().Location}"; - string receivedCommandLine = NormalizeCommandLine(commandLine); - // ActiveIssue https://github.com/dotnet/runtime/issues/62729 - if (!OperatingSystem.IsAndroid()) + if (!OperatingSystem.IsAndroid() && !OperatingSystem.IsIOS() && !OperatingSystem.IsTvOS()) + { + // The following logic is tailored to this specific test where the cmdline _should_ look like the following: + // /path/to/corerun /path/to/processinfo.dll + // or + // "C:\path\to\CoreRun.exe" C:\path\to\processinfo.dll + string currentProcessCommandLine = $"{currentProcess.MainModule.FileName} {System.Reflection.Assembly.GetExecutingAssembly().Location}"; + string receivedCommandLine = NormalizeCommandLine(commandLine); Utils.Assert(currentProcessCommandLine.Equals(receivedCommandLine, StringComparison.OrdinalIgnoreCase), $"CommandLine must match current process. Expected: {currentProcessCommandLine}, Received: {receivedCommandLine} (original: {commandLine})"); + } // VALIDATE OS start = end; @@ -185,6 +186,10 @@ public static int Main() { expectedOSValue = "Android"; } + else if (OperatingSystem.IsIOS() || OperatingSystem.IsTvOS()) + { + expectedOSValue = "iOS"; + } else { expectedOSValue = "Unknown"; diff --git a/src/tests/xunit-wrappers.targets b/src/tests/xunit-wrappers.targets index 222e6e4c4f53f..6f61f30dec57b 100644 --- a/src/tests/xunit-wrappers.targets +++ b/src/tests/xunit-wrappers.targets @@ -105,9 +105,9 @@ $(_XunitEpilog) $(Category).XUnitWrapper $(XunitWrapperGeneratedCSDirBase)$(Category) android - apple + apple false - true + true @@ -219,14 +219,14 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). string operatingSystem = Environment.GetEnvironmentVariable("OS")%3B runningInWindows = (operatingSystem != null && operatingSystem.StartsWith("Windows"))%3B - retCode = handler.InstallMobileApp(%22$(MobilePlatform)%22, category, testBinaryBase, reportBase)%3B + retCode = handler.InstallMobileApp(%22$(MobilePlatform)%22, category, testBinaryBase, reportBase, %22$(TargetOS)%22.ToLowerInvariant())%3B Assert.True(retCode == 0, "Failed to install mobile app.")%3B } public void Dispose() { int retCode = -100%3B - retCode = handler.UninstallMobileApp(%22$(MobilePlatform)%22, category, testBinaryBase, reportBase)%3B + retCode = handler.UninstallMobileApp(%22$(MobilePlatform)%22, category, testBinaryBase, reportBase, %22$(TargetOS)%22.ToLowerInvariant())%3B Assert.True(retCode == 0, "Failed to uninstall mobile app.")%3B } }