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

JNI coverage doesn't include JNIgen tests #1010

Open
HosseinYousefi opened this issue Mar 14, 2024 · 3 comments
Open

JNI coverage doesn't include JNIgen tests #1010

HosseinYousefi opened this issue Mar 14, 2024 · 3 comments
Labels
type-infra A repository infrastructure change or enhancement

Comments

@HosseinYousefi
Copy link
Member

The coverage seems to be low since it's not adding the tests in package:jnigen that also cover key functionalities of package:jni.

Originally posted by @HosseinYousefi in #998 (comment)

@dcharkes dcharkes added the type-infra A repository infrastructure change or enhancement label Mar 15, 2024
@dcharkes
Copy link
Collaborator

dart pub global run coverage:test_with_coverage is run for both package:jni and package:jnigen separately. I don't know if package:coverage has any support for running for mono_repos.

packages package:native_* have the same issue. (There I end up writing tests in the packages themselves to increase coverage.) So they would benefit from the same improvement.

@liamappelbe
Copy link
Contributor

The test_with_coverage script only handles very simple use cases. Internally it runs the test, then calls collect_coverage and format_coverage. You might need to manually run those steps like we do in ffigen.

All of package:objective_c's functionality is covered by ffigen tests, so I just had to update ffigen's coverage script to allow objective_c through the filter: https://github.com/dart-lang/native/pull/1061/files#diff-11be0910e38d60287f7b12288096c1421f3e8f3912daccf0de351c46abb6f48a

You'll probably need something similar for jni.

@dcharkes
Copy link
Collaborator

dcharkes commented Apr 9, 2024

Thanks for diving into this @liamappelbe!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-infra A repository infrastructure change or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants