Skip to content

JNI coverage doesn't include JNIgen tests #1010

Open

Description

@HosseinYousefi

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)

Activity

  1. added
    type-infraA repository infrastructure change or enhancement
    on Mar 15, 2024
  2. dcharkes commented on Mar 15, 2024

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

  3. liamappelbe commented on Apr 9, 2024

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

  4. dcharkes commented on Apr 9, 2024

    @dcharkes
    Collaborator

    Thanks for diving into this @liamappelbe!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-infraA repository infrastructure change or enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions