Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions eng/testing/tests.ioslike.targets
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<DirectPInvoke Include="__Internal" />
</ItemGroup>

<ItemGroup Condition="'$(UseMonoRuntime)' != 'true' and '$(UseNativeAOTRuntime)' != 'true' and '$(PublishReadyToRun)' == 'true'">
<EnvironmentVariables Include="TEST_READY_TO_RUN_MODE=1" />
</ItemGroup>

<PropertyGroup>
<BuildTestsOn Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(Scenario)' == 'BuildAppleApps'">helix</BuildTestsOn>
<BuildTestsOn Condition="'$(BuildTestsOnHelix)' == 'true'">helix</BuildTestsOn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void GetEntryAssembly()
{
correct = assembly.IndexOf("WasmTestRunner", StringComparison.OrdinalIgnoreCase) != -1;
}
else if (PlatformDetection.IsNativeAot || PlatformDetection.IsReadyToRunCompiled)
else if (PlatformDetection.IsNativeAot || (PlatformDetection.IsReadyToRunCompiled && !PlatformDetection.IsAppleMobile))
{
// The single file test runner is not 'xunit.console'.
correct = assembly.IndexOf("System.Reflection.Tests", StringComparison.OrdinalIgnoreCase) != -1;
Expand Down
11 changes: 5 additions & 6 deletions src/tasks/AndroidAppBuilder/Templates/monodroid-coreclr.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,27 +277,26 @@ Java_net_dot_MonoRunner_execEntryPoint (JNIEnv* env, jobject thiz, jstring j_ent
}

int args_len = (*env)->GetArrayLength (env, j_args);
int managed_argc = args_len + 1;
const char** managed_argv = (const char**)malloc (managed_argc * sizeof(char*));
// Managed Main receives only the app arguments, not the bundle path.
const char** managed_argv = (const char**)malloc ((args_len > 0 ? args_len : 1) * sizeof(char*));
if (managed_argv == NULL)
{
LOG_ERROR("Failed to allocate memory for managed_argv");
return -1;
}

managed_argv[0] = g_bundle_path;
for (int i = 0; i < args_len; ++i)
{
jstring j_arg = (*env)->GetObjectArrayElement(env, j_args, i);
managed_argv[i + 1] = (char*)((*env)->GetStringUTFChars(env, j_arg, NULL));
managed_argv[i] = (char*)((*env)->GetStringUTFChars(env, j_arg, NULL));
}

int rv = mono_droid_execute_assembly (g_executable_path, g_coreclr_handle, g_coreclr_domainId, managed_argc, managed_argv);
int rv = mono_droid_execute_assembly (g_executable_path, g_coreclr_handle, g_coreclr_domainId, args_len, managed_argv);

for (int i = 0; i < args_len; ++i)
{
jstring j_arg = (*env)->GetObjectArrayElement(env, j_args, i);
(*env)->ReleaseStringUTFChars(env, j_arg, managed_argv[i + 1]);
(*env)->ReleaseStringUTFChars(env, j_arg, managed_argv[i]);
}

free(managed_argv);
Expand Down
3 changes: 2 additions & 1 deletion src/tasks/AppleAppBuilder/Templates/runtime-coreclr.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ bool get_native_code_data(const struct host_runtime_contract_native_code_context
&coreclr_handle, &coreclr_domainId);
assert (res == 0);

coreclr_execute_assembly (coreclr_handle, coreclr_domainId, argi, managed_argv, path, &res);
// managed_argv[0] is the executable path; managed Main expects only the arguments after it.
coreclr_execute_assembly (coreclr_handle, coreclr_domainId, argi - 1, managed_argv + 1, path, &res);
// Print this so apps parsing logs can detect when we exited
os_log_info (OS_LOG_DEFAULT, EXIT_CODE_TAG ": %d", res);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
Expand All @@ -27,8 +28,8 @@ public static bool IsCoreClrInterpreter
{
get
{
// WASM-TODO: update when codegen is in place
if (PlatformDetection.IsWasm)
// Without a JIT (e.g. WebAssembly, Apple mobile), code that isn't precompiled runs in the interpreter.
if (RuntimeFeature.IsDynamicCodeSupported && !RuntimeFeature.IsDynamicCodeCompiled)
return true;
if (!string.IsNullOrWhiteSpace(GetEnvironmentVariableValue("Interpreter", "")))
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Common/XUnitWrapperGenerator/RuntimeTestModes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ public enum RuntimeTestModes

HeapVerify = 1 << 9, // DOTNET_HeapVerify (or COMPlus_HeapVerify) is set.

InterpreterActive = 1 << 10, // DOTNET_Interpreter != "" or DOTNET_InterpMode != 0
InterpreterActive = 1 << 10, // DOTNET_Interpreter != "", DOTNET_InterpMode != 0, or no JIT (some code may be interpreted)
}
}
14 changes: 14 additions & 0 deletions src/tests/Common/mergedrunnermobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@
<RuntimePackAsset Include="$(TargetingPackPath)/*.dll" AssetType="runtime" />
</ItemGroup>

<!-- F# tests load FSharp.Core from CORE_ROOT elsewhere; the app bundle has to carry it. -->
<Target Name="_AddFSharpCoreToMobileRunner"
AfterTargets="ResolveAssemblyReferences"
Condition="'@(ProjectReference->AnyHaveMetadataValue('Extension', '.fsproj'))' == 'true'">
<MSBuild Projects="$(RepoRoot)src/tests/Common/test_dependencies_fs/test_dependencies.fsproj"
Targets="GetFSharpCoreRuntimeAssets"
Properties="Language=C#;RuntimeIdentifier=$(TargetRid)">
<Output TaskParameter="TargetOutputs" ItemName="_FSharpCoreRuntimeAsset" />
</MSBuild>
<ItemGroup>
<ReferenceCopyLocalPaths Include="@(_FSharpCoreRuntimeAsset)" DestinationSubDirectory="" />
</ItemGroup>
</Target>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)/src/tests/Common/XHarnessRunnerLibrary/XHarnessRunnerLibrary.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@
<RuntimeCopyLocalItems Include="@(LibrariesRuntimeFiles)" />
</ItemGroup>
</Target>

<!-- Mobile test apps bundle their own dependencies instead of loading them from CORE_ROOT. -->
<Target Name="GetFSharpCoreRuntimeAssets" DependsOnTargets="ResolvePackageAssets" Returns="@(FSharpCoreRuntimeAsset)">
<ItemGroup>
<FSharpCoreRuntimeAsset Include="@(RuntimeCopyLocalItems)" Condition="'%(RuntimeCopyLocalItems.NuGetPackageId)' == 'FSharp.Core'" />
</ItemGroup>
</Target>
</Project>
7 changes: 5 additions & 2 deletions src/tests/GC/API/GC/GetGeneration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,13 @@ public bool RunTests()



// Interpreted frames report their locals as pinned, causing generation demotion that this test does not expect.
public static bool IsTestCodeCompiled => !Utilities.IsCoreClrInterpreter || PlatformDetection.IsReadyToRunCompiled;

[ActiveIssue("needs triage", TestRuntimes.Mono)]
[SkipOnCoreClr("This test is not compatible with GC stress.", RuntimeTestModes.AnyGCStress)]
[SkipOnCoreClr("Interpreter reports locals as pinned, causing generation demotion that this test does not expect.", RuntimeTestModes.InterpreterActive)]
[Fact]
[SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.Wasi, "WebAssembly reports stack roots as pinned, causing generation demotion that this test does not expect. See https://github.com/dotnet/runtime/issues/134803.")]
[ConditionalFact(typeof(GetGenerationTest), nameof(IsTestCodeCompiled))]
public static int TestEntryPoint()
{
GetGenerationTest t = new GetGenerationTest();
Expand Down
1 change: 1 addition & 0 deletions src/tests/JIT/Directed/tailcall/mutual_recursion.fs
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ type Driver() =
[<SkipOnCoreClr("Unstable under JIT stress", RuntimeTestModes.AnyJitStress ||| RuntimeTestModes.AnyGCStress)>]
[<SkipOnMono("Not supported on Mono runtime")>]
[<ActiveIssue("https://github.com/dotnet/runtime/issues/133464", typeof<PlatformDetection>, [| "IsWasmReadyToRun" |])>]
[<ActiveIssue("https://github.com/dotnet/runtime/issues/134775", typeof<PlatformDetection>, [| "IsAppleMobile"; "IsCoreCLR" |])>]
[<ConditionalFact(typeof<Utilities>, [| "IsNotNativeAot" |])>]
let main () =
let driver = Driver()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ internal static void RecordFailure(Exception ex)

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/134770", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))]
[SkipOnCoreClr("This test takes too long and internally times out under GCStress/heap verify. It is not fundamentally incompatible if stress testing is fast enough.", RuntimeTestModes.AnyGCStress | RuntimeTestModes.HeapVerify)]
public static int TestEntryPoint()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@
string('This test is too slow under GCStress=3. See https://github.com/dotnet/runtime/issues/50615.')
int32(0xC0) // AnyGCStress
}
.custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [System.Runtime]System.Type, string[]) = {
string('https://github.com/dotnet/runtime/issues/134770')
type([TestLibrary]TestLibrary.PlatformDetection)
string[2] ('IsAppleMobile' 'IsCoreCLR')
}
.entrypoint
.maxstack 5
.locals init (class cs1 V_0,
Expand Down
3 changes: 1 addition & 2 deletions src/tests/JIT/Regression_o_3/Runtime_90219.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ public class Runtime_90219
public static byte Result;

[ActiveIssue("https://github.com/dotnet/runtimelab/issues/155: Assembly.Load", typeof(Utilities), nameof(Utilities.IsNativeAot))]
[Fact]
[ConditionalFact(typeof(Utilities), nameof(Utilities.HasAssemblyFiles))]
[ActiveIssue("https://github.com/dotnet/runtimelab/issues/155: Assembly.Load", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/90374", TestRuntimes.Mono)]
[SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.Wasi | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Loads assembly from file.")]
public static int TestEntryPoint()
{
CollectibleALC alc = new CollectibleALC();
Expand Down
Loading