Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests] Add MonoApi runtime tests #65221

Merged
merged 42 commits into from
Mar 4, 2022

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented Feb 11, 2022

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.

@ghost ghost assigned lambdageek Feb 11, 2022
@lambdageek lambdageek 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 lambdageek force-pushed the add-monoapi-runtime-tests branch 7 times, most recently from 00af384 to 7bbc8db Compare February 16, 2022 16:26
@lambdageek lambdageek force-pushed the add-monoapi-runtime-tests branch 3 times, most recently from 2d5c50e to 9cb521d Compare February 24, 2022 03:55
@lambdageek lambdageek marked this pull request as ready for review March 1, 2022 20:29
@lambdageek lambdageek 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 vargaz March 1, 2022 20:31
@lambdageek
Copy link
Member Author

lambdageek commented Mar 1, 2022

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

@lambdageek lambdageek changed the title [DRAFT] Add MonoApi runtime tests [tests] Add MonoApi runtime tests Mar 1, 2022
@lambdageek
Copy link
Member Author

@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.

@@ -0,0 +1,6 @@
// This file intentionally doesn't have header guards
Copy link
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
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
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
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
Member

Choose a reason for hiding this comment

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

Missing MIT banner.

@@ -102,3 +102,5 @@ if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
add_subdirectory(ObjectiveC/AutoReleaseTest)
add_subdirectory(ObjectiveC/ObjectiveCMarshalAPI)
endif()

add_subdirectory(MonoAPI/Native)
Copy link
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
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
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
Member Author

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

@lambdageek
Copy link
Member Author

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 lambdageek merged commit 483b8f2 into dotnet:main Mar 4, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 3, 2022
Sign up for free to 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.

None yet

5 participants