Skip to content

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

Closed
peter-ahe-google opened this issue May 22, 2012 · 14 comments
Closed

Testing shared options #3168

peter-ahe-google opened this issue May 22, 2012 · 14 comments
Assignees
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@peter-ahe-google
Copy link
Contributor

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() {}

@whesse
Copy link
Contributor

whesse commented May 22, 2012

I think I misunderstood - I thought that options would be a command-line option for the test.dart (test.py) program:
test.py --compiler=dart2js --runtime=d8 --options="--package-root=my_test_package_root"

Or are you suggesting that both features be added?

@peter-ahe-google
Copy link
Contributor Author

I do not want a command line option to test.py/test.dart.

@whesse
Copy link
Contributor

whesse commented Jun 14, 2012

Added this to the Later milestone.

@peter-ahe-google
Copy link
Contributor Author

I think we need to test this for M1.


Removed this from the Later milestone.
Added this to the M1 milestone.

@peter-ahe-google
Copy link
Contributor Author

Marked this as blocking #3170.

@whesse
Copy link
Contributor

whesse commented Aug 24, 2012

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.

@dgrove
Copy link
Contributor

dgrove commented Oct 15, 2012

Removed this from the M1 milestone.
Added this to the M2 milestone.

@peter-ahe-google
Copy link
Contributor Author

Removed this from the M2 milestone.
Added this to the M3 milestone.

@peter-ahe-google
Copy link
Contributor Author

Removed this from the M3 milestone.
Added this to the M4 milestone.

@larsbak
Copy link

larsbak commented May 28, 2013

Removed this from the M4 milestone.
Added this to the M5 milestone.

@kasperl
Copy link

kasperl commented Jun 4, 2014

Removed this from the M5 milestone.
Added this to the 1.6 milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the 1.6 milestone.
Added Oldschool-Milestone-1.6 label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-1.6 label.

@peter-ahe-google peter-ahe-google added Type-Defect area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). labels Aug 4, 2014
@peter-ahe-google peter-ahe-google self-assigned this Aug 4, 2014
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed accepted labels Feb 29, 2016
@matanlurey
Copy link
Contributor

Most of these options no longer exist in Dart2.

@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 22, 2018
copybara-service bot pushed a commit that referenced this issue Oct 8, 2021
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants