-
Notifications
You must be signed in to change notification settings - Fork 214
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
Pass dart defines when -c kernel #2272
Comments
I think we probably would want to support it like |
cc @natebosch this could be one answer to people asking for command line arguments to tests. |
I don't think we have any way to read these values within the Dart code of the test runner. This would require a change in the Dart CLI to specially forward these to the test runner. @bkonyi does that seem feasible? |
We should be able to support passing these as our own args though right? I am suggesting we add a Although, I don't think we could support it if running from source the way we currently do. |
We want the actual test to have access to this code, right? If so, it needs to be provided at kernel compile time so However, if we're running from source these defines need to be set at runtime (e.g., what |
Right, I don't see how we could support this uniformly for all modes (running via Isolate.spawnUri as well as separately compiled and executed programs), because with the tools currently available the argument would have to be passed in a different location for each. I think @natebosch was suggesting though that if the Dart CLI forwarded the This also would only work for the |
Testing code that uses
bool.fromEnvironment
, it looks likenever 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 indart test
?Thanks :)
The text was updated successfully, but these errors were encountered: