Skip to content

Pass dart defines when -c kernel #2272

Open
@davidmorgan

Description

@davidmorgan

Testing code that uses bool.fromEnvironment, it looks like

dart -Dfoo=true test

never picks up the true value with the default -c kernel, but with -c source it does.

This took me a while to figure out, maybe it could be supported?

It looks like "flutter test" does support it via --dart-define, although I didn't try it.

Maybe just a note in the docs that it works with flutter test but there's no full equivalent in dart test?

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions