Skip to content

[tests] Add MonoApi runtime tests - #65221

Merged
lambdageek merged 42 commits into
dotnet:mainfrom
lambdageek:add-monoapi-runtime-tests
Mar 4, 2022
Merged

[tests] Add MonoApi runtime tests#65221
lambdageek merged 42 commits into
dotnet:mainfrom
lambdageek:add-monoapi-runtime-tests

Conversation

@lambdageek

@lambdageeklambdageek commented Feb 11, 2022

Copy link
Copy Markdown
Member

Contributes to #64456

Create a new directory src/tests/Interop/MonoAPI for tests that use the mono embedding API.

Move the mono libtest.c native library along with managed tests: InstallEHCallback.cs, PInvokeDetach.cs and Thunks.cs to src/tests/Interop/MonoAPI/...

The native library (now called mono-embedding-api-test.c) builds on all platforms where we build native support libraries for the runtime tests.

The managed tests only run on desktop mono configurations for now.

@ghostghost assigned lambdageekFeb 11, 2022
@ghostghost added the area-Build-mono label Feb 11, 2022
@lambdageeklambdageek added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) and removed area-Build-mono labels Feb 11, 2022
@lambdageek
lambdageekforce-pushed the add-monoapi-runtime-tests branch 7 times, most recently from 00af384 to 7bbc8dbCompareFebruary 16, 2022 16:26
@lambdageek
lambdageekforce-pushed the add-monoapi-runtime-tests branch 3 times, most recently from 2d5c50e to 9cb521dCompareFebruary 24, 2022 03:55
@lambdageek
lambdageekforce-pushed the add-monoapi-runtime-tests branch from 18e46d4 to 4d063eaCompareMarch 1, 2022 20:01
@lambdageek
lambdageek marked this pull request as ready for review March 1, 2022 20:29
@lambdageeklambdageek added area-Interop-mono and removed NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) labels Mar 1, 2022
@lambdageek
lambdageek requested a review from vargazMarch 1, 2022 20:31
@lambdageek

lambdageek commented Mar 1, 2022

Copy link
Copy Markdown
MemberAuthor

/cc @dotnet/interop-contrib @trylek I'd love some feedback on the overall setup for these tests

@lambdageeklambdageek changed the title [DRAFT] Add MonoApi runtime tests[tests] Add MonoApi runtime testsMar 1, 2022
@lambdageek

Copy link
Copy Markdown
MemberAuthor

@lateralusX I kept most of the win32 code from libtest.c, and I believe the native library is building as part of the coreclr win32 tests build, but I haven't tried running the tests on Windows Mono.

Comment threadsrc/tests/issues.targets Outdated
@@ -0,0 +1,6 @@
// This file intentionally doesn't have header guards

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing MIT banner.

@@ -2,9 +2,11 @@
using System.Reflection;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing MIT banner.

@@ -7,14 +7,33 @@
using System.Threading;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing MIT banner.

@@ -2,19 +2,21 @@
using System.Runtime.InteropServices;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing MIT banner.

@@ -0,0 +1,32 @@
using System;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing MIT banner.

Comment threadsrc/tests/Interop/CMakeLists.txt Outdated
add_subdirectory(ObjectiveC/ObjectiveCMarshalAPI)
endif()

add_subdirectory(MonoAPI/Native)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this up to before the first if branch since it should be always done and with that "group".

@@ -0,0 +1,1088 @@

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing MIT banner.

@lateralusX

Copy link
Copy Markdown
Member

@lateralusX I kept most of the win32 code from libtest.c, and I believe the native library is building as part of the coreclr win32 tests build, but I haven't tried running the tests on Windows Mono.

OK, I can look at that once the PR has been merged.

@lambdageek

Copy link
Copy Markdown
MemberAuthor

Interesting, thunks test failure on llvmaot is relevant. need to check if that test ran with aot in mono/mono

@lambdageek
lambdageekforce-pushed the add-monoapi-runtime-tests branch from a7439ac to e2a4933CompareMarch 3, 2022 15:16
@lambdageek

Copy link
Copy Markdown
MemberAuthor

Interesting, thunks test failure on llvmaot is relevant. need to check if that test ran with aot in mono/mono

Yea, we skipped that test on AOT configurations in mono/mono

In the mono/mono repo that test was not expected to work with AOT
@lambdageek
lambdageekforce-pushed the add-monoapi-runtime-tests branch from e2a4933 to 8e3aa5eCompareMarch 4, 2022 01:25
@lambdageek
lambdageek merged commit 483b8f2 into dotnet:mainMar 4, 2022
@ghostghost locked as resolved and limited conversation to collaborators Apr 3, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@lambdageek@lateralusX@vargaz@jkoritzinsky@AaronRobinsonMSFT