Skip to content

[record_use] Dart API: Testing record use #2648

@dcharkes

Description

@dcharkes

dart test runs in JIT mode, which means package authors can't use it to test that their link hooks and record-use annotations do the right thing.

To make the tests useful, every test should AOT compile its own entry point. However, that would not enable testing that something got tree-shaken out.

It would be better to have something similar to:

Future<void> testBuildHook({

testLinkHook.

However, then the user would need to provide the recorded uses file manually. So we need an API that compiles an entry point and provides the recorded uses so that we can pass it in to the test.

Thanks @simolus3 for the suggestion!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions