-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Testing shared options #3168
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
Comments
I think I misunderstood - I thought that options would be a command-line option for the test.dart (test.py) program: Or are you suggesting that both features be added? |
I do not want a command line option to test.py/test.dart. |
Added this to the Later milestone. |
Marked this as blocking #3170. |
Do we always want the options specified by an Options= line to go to the "dart" part of the component, so to the dart or DRT executable if compiler=none, and to the compiler otherwise? I think the name /// Options= would be as good as DartOptions. |
Removed this from the 1.6 milestone. |
Removed Oldschool-Milestone-1.6 label. |
Most of these options no longer exist in Dart2. |
Changes: ``` > git log --format="%C(auto) %h %s" 37d0592..0764437 https://dart.googlesource.com/pub.git/+/07644370 Make gitignore validator use gitignores from repo-root and down. (#3169) https://dart.googlesource.com/pub.git/+/205ea58c Handle build-versions when reformatting ranges (#3170) https://dart.googlesource.com/pub.git/+/8f7bfb8c migrate 3 leaf files to null-safety (#3168) https://dart.googlesource.com/pub.git/+/df5db1f1 Extract some parts of pubspec parsing to a null-safe library. (#3160) ``` Diff: https://dart.googlesource.com/pub.git/+/37d05928939b3100e7e55c3dff922651db1de1e1~..0764437088fd58eb7af779ecef66bab40dfcf2e9/ Change-Id: I8d938dbf6c3fba3c3f4d98bbaa5835acfaf132a7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216020 Reviewed-by: Sarah Zakarias <[email protected]> Commit-Queue: Sigurd Meldgaard <[email protected]>
There is a number of options that should be supported by most of our Dart implementations:
* setting the package root.
* turning on checked mode (aka developer mode).
* turning on assertions.
We need to be able to test these options, and we need to agree on the "command line syntax" for these options. This bug is about testing the options, not the concrete command line syntax.
Bill and I discussed this and we think it could be implemented by adding a tag similar to VMOptions, but unlike VMOptions, these options would be expected to be understood by all implementations, and it would be a test failure to reject an option (so this is not compatible with --ignore-unrecognized-options).
For example, to test an option for setting the package root, lets assume --package-root=<path> could look like this:
my_test.dart:
// DartOptions=--package-root=my_test_package_root
import('package:foo.dart', prefix: 'foo');
main() {
Expect.equals(42, foo.x);
}
my_test_package_root/foo.dart
var x = 42;
And a negative test could look like this:
my_negative_test.dart
// DartOptions=--package-root=no_such_directory
main() {}
The text was updated successfully, but these errors were encountered: