Skip to content

Commit 34547f7

Browse files
Fix running native aot testing locally (#125354)
Fixes #125317
1 parent 83573d2 commit 34547f7

9 files changed

Lines changed: 54 additions & 24 deletions

eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ jobs:
163163
- template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
164164
parameters:
165165
creator: dotnet-bot
166-
testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true
166+
testBuildArgs: tree nativeaot/MobileSmokeTest /p:BuildNativeAOTRuntimePack=true
167167
testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig)
168168
buildAllTestsAsStandalone: true
169169

eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
- template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
131131
parameters:
132132
creator: dotnet-bot
133-
testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true
133+
testBuildArgs: tree nativeaot/MobileSmokeTest /p:BuildNativeAOTRuntimePack=true
134134
testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig)
135135
buildAllTestsAsStandalone: true
136136

eng/pipelines/extra-platforms/runtime-extra-platforms-maccatalyst.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
parameters:
163163
creator: dotnet-bot
164164
buildAllTestsAsStandalone: true
165-
testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true
165+
testBuildArgs: tree nativeaot/MobileSmokeTest /p:BuildNativeAOTRuntimePack=true
166166
testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig)
167167

168168
#
@@ -201,7 +201,7 @@ jobs:
201201
parameters:
202202
creator: dotnet-bot
203203
buildAllTestsAsStandalone: true
204-
testBuildArgs: tree nativeaot/SmokeTests /p:BuildNativeAOTRuntimePack=true /p:DevTeamProvisioning=adhoc /p:EnableAppSandbox=true
204+
testBuildArgs: tree nativeaot/MobileSmokeTest /p:BuildNativeAOTRuntimePack=true /p:DevTeamProvisioning=adhoc /p:EnableAppSandbox=true
205205
testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig)
206206

207207
#

src/tests/nativeaot/Directory.Build.props

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,5 @@
55
<PropertyGroup>
66
<!-- We expect trimming to be fully enabled in these tests -->
77
<EnableAggressiveTrimming>true</EnableAggressiveTrimming>
8-
9-
<!--
10-
Each of these tests is considered its own "merged runner" that contains merged-in tests.
11-
This allows the tests to run on mobile platforms where process isolation is not supported.
12-
-->
13-
<HasMergedInTests>true</HasMergedInTests>
148
</PropertyGroup>
159
</Project>

src/tests/nativeaot/Directory.Build.targets

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System;
5+
using System.Runtime.CompilerServices;
6+
7+
unsafe class Program
8+
{
9+
[MethodImpl(MethodImplOptions.NoInlining)]
10+
static int ReadPointer(int* pVal)
11+
{
12+
return *pVal;
13+
}
14+
15+
static int Main()
16+
{
17+
try
18+
{
19+
ReadPointer(null);
20+
}
21+
catch (Exception)
22+
{
23+
return 100;
24+
}
25+
26+
return 1;
27+
}
28+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<ReferenceXUnitWrapperGenerator>false</ReferenceXUnitWrapperGenerator>
5+
<HasMergedInTests>true</HasMergedInTests>
6+
<CLRTestTargetUnsupported Condition="'$(TargetsAppleMobile)' != 'true'">true</CLRTestTargetUnsupported>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<Compile Include="MobileSmokeTest.cs" />
11+
</ItemGroup>
12+
13+
<Import Project="$(TestSourceDir)MergedTestRunner.targets" />
14+
</Project>

src/tests/nativeaot/StartupHook/StartupHook.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
66
<StartupHookSupport>true</StartupHookSupport>
77
<NoWarn>$(NoWarn);IL2026</NoWarn>
8+
<RequiresProcessIsolation>true</RequiresProcessIsolation>
89
<ReferenceXUnitWrapperGenerator>false</ReferenceXUnitWrapperGenerator>
9-
<HasMergedInTests>true</HasMergedInTests>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<Compile Include="StartupHook.cs" />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<ItemGroup>
3+
<MergedWrapperProjectReference Include="*/**/*.??proj" Exclude="*/**/Library.csproj;MobileSmokeTest/MobileSmokeTest.csproj" />
4+
</ItemGroup>
5+
6+
<Import Project="$(TestSourceDir)MergedTestRunner.targets" />
7+
</Project>

0 commit comments

Comments
 (0)