Skip to content

Commit

Permalink
Adding a test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpovazan committed Jun 8, 2023
1 parent bbdc984 commit 682a3c0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Threading;
using System.Threading.Tasks;
using System.Runtime.InteropServices;

public static class Program
{
[DllImport("__Internal")]
public static extern void mono_ios_set_summary (string value);

public static async Task<int> Main(string[] args)
{
mono_ios_set_summary($"Starting functional test");
Console.WriteLine("Done!");
await Task.Delay(5000);

var runtimeFeatureType = typeof(object).Assembly.GetType("System.Runtime.CompilerServices.RuntimeFeature");
var isDynamicCodeSupportedGetter = runtimeFeatureType?.GetMethod("get_IsDynamicCodeSupported");

// get_IsDynamicCodeSupported should have been trimmed-out (substituted by false)
return isDynamicCodeSupportedGetter is null ? 42 : -1;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk" TreatAsLocalProperty="MonoForceInterpreter">

<PropertyGroup>
<OutputType>Exe</OutputType>
<MonoForceInterpreter>false</MonoForceInterpreter>
<RunAOTCompilation>true</RunAOTCompilation>
<TestRuntime>true</TestRuntime>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<TargetOS Condition="'$(TargetOS)' == ''">ios</TargetOS>
<MainLibraryFileName>iOS.Device.IsDynamicCodeSupported.Test.dll</MainLibraryFileName>
<IncludesTestRunner>false</IncludesTestRunner>
<ExpectedExitCode>42</ExpectedExitCode>
<EnableAggressiveTrimming Condition="'$(EnableAggressiveTrimming)' == ''">true</EnableAggressiveTrimming>
<MonoEnableLLVM>true</MonoEnableLLVM>
</PropertyGroup>

<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
</Project>

0 comments on commit 682a3c0

Please sign in to comment.