Adds `--countCalls` - used for instance as
```
out/ReleaseX64/dart pkg/front_end/tool/flame/instrumenter.dart pkg/analyzer/tool/stable_analysis.dart --countCalls --onlySome
```
Where "normal" `--count` calls the number of times we enter the
function, `--countCalls` will count the number of times certain methods
(hard-coded ones with `--onlySome` or user-specified via `--onlySome=`)
are actually executed. For instance if it's inside a loop it might be
much higher than the number of times we enter the function, and if it's
behind lots of `if`s it might be much lower.
Change-Id: I35b0620aa395cc920d3ea6a33eeef2d24618b74c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481421
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Removes the files
`pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart` and
`pkg/front_end/lib/src/codes/cfe_codes_generated.dart`, as well as the
logic that code generates them (and validates that code generation is
up to date). These files are no longer needed, since the front_end and
related packages have all been transitioned to use the new
`diagnostic.g.dart` files.
Change-Id: I6a6a69640f4a712c21fc830fb9f7943dbbfedd16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476081
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Creates new code generated files (`diagnostic.g.dart`) in
`pkg/front_end` and `pkg/_fe_analyzer_shared`. These new files use the
same naming conventions as those used by the analyzer and related
packages, paving the way for eventually unifying the error reporting
logic between the platforms.
Eventually, these files will replace the existing
`codes_generated.dart` and `cfe_codes_generated.dart`. But for now,
these files just reference (or re-export) the declarations in the new
`diagnostic.g.dart` files, to reduce the effect on code that depends
on them.
In follow-up CLs I will transition all the code that depends on
`codes_generated.dart` and `cfe_codes_generated.dart` to use the new
`diagnostic.g.dart` files, and then I'll remove the old generated
files.
Change-Id: I6a6a696407aa74f6e3c61805a7772a51f03aa9d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475782
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Updates the code in `pkg/analyzer_utilities/lib/messages.dart` to
attempt to read CFE messages from both
`pkg/_fe_analyzer_shared/messages.yaml` and
`pkg/front_end/messages.yaml`, and updates clients accordingly.
Also updates the `messages_suite.dart` test and the presubmit rules to
ensure that the contents of `pkg/_fe_analyzer_shared/messages.yaml`
will be appropriately tested.
Since the file `pkg/_fe_analyzer_shared/messages.yaml` doesn't exist
yet, temporaryhacks have been added to pretend the file is empty if it
can't be found.
In a follow-up CL, I will move messages that are shared between the
analyzer and the CFE to `pkg/_fe_analyzer_shared/messages.yaml`.
Change-Id: I6a6a6964c1c02f20df9ae8e34f23e734bbe88c22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448605
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
More specifically, tests for the coverage merger tool, i.e. allowing us
to write tests for missing coverage being reported in a certain way, and
for the automatic update of comments working like we want it to.
As this testing is added after-the-fact the (initial at least) testing
is very sparse.
Change-Id: I5ae372b4ad56511859ad6f616c99835d1ccd140f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443960
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Increase test coverage --- body_builder.dart was the target.
Process: Replaced all `coverage-ignore-block(suite):` comments with
throws and ran `python3 tools/test.py -n cfe-strong-linux language/`,
copying (and modifying) representative tests from `langauge` that
covered new stuff (i.e. threw in the modified version). Then undid the
throw changes, and redid the coverage marking.
Change-Id: Ie08dc6fcd70cd3722b68c38bf2a152d03aae7885
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378705
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
* Delete unused stuff
* rename 'path' to 'root'
* accept 'includeEndsWith' as a plain text string so we often can avoid
using regexp
* accept 'subRoots' to filter to directories faster and more precisly
than when using regexps in 'pattern'
* make 'list' async instead of async* (no more yield stuff which we
promptly turn into a list when actually using it)
Note that some changes in testing.json is not 100% semantic-preserving,
e.g. the "parser_all" suite previously had a pattern "/tests/.*\\.dart$"
which was probably meant to include all dart files in the "tests" folder
in the root, but in fact included all dart files in a "tests" folder
anywhere. The updated version does not.
Change-Id: Idd014274f86bf6214dee0753a7738ec80bc6a49e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358442
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
First of we apply the wanted lints etc we prefer.
This includes but isn't limited to using types (i.e. no "var") and
being explicit about creation (i.e. no missing "new").
Change-Id: I516bccdac9760221ea5311af4567466bb4a65c77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341960
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This adds support using experimental features in id testing in DDC and
uses it to add tests for scopes in extensions, extension types and
mixins.
The tests show that the DartScopeBuilder and DartScopeBuilder2 differ
on the scope on instance members in extensions and extension types for
the synthetic #this variable.
Change-Id: Iec0f3b938da567578b1245ada885370fb2a8b33f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335824
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This adds support for testing how the dart2wasm target implementation
integrates with the CFE. The added tests show the current state of
the for-in and yield transformations performed by wasm.
Change-Id: I7fc1efab22311667dcf4357ba54fa45321581074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278000
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This removes unneeded language version from expectation tests in the
implicit_getter_calls/, rasta/, regress/, runtime_checks/,
runtime_checks_new/, set_literals/, and unified_collections/ folders.
Change-Id: I39a04fe7797d20ffae0814809f550431b1184810
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245371
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This adds a new expectation test suite which mimics the modular
compilation strategy used by dartdevc; the test code is fully compiled
but the linked dependencies are only compiled as outlines.
Change-Id: I4b8a68087997c025eb39aec414ee1706ddf7f847
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222762
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This test mimics the macro builder system currently in development
and tests declared and applied macros can be recognized through the
generated AST.
Change-Id: Ide47def2b6044d74051a090879f49ba4a3c8d201
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220763
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
* Remove all uses of `--dart2js-batch`.
* Enable batch mode for dart2js by default.
* Rename `--noBatch` to `--no-batch`.
* Make `--no-batch` affect dart2js configurations.
Change-Id: I33bdb5cfe8a82ccfc6ce9e43843f1b7a34ff1fbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217006
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Most of these arguments are flowing through to a `--packages` argument
which allows passing the `package_config.json` file. In the long term we
should remove the `.packages` file entirely.
TEST=None, the change should have no visible impact.
Change-Id: I60a8b175d5e217a85588bbcb91cc5095514066b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211503
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This is a first pass at running inlined tests
(seemingly called doctests in for instance python) on internal CFE code.
This is not useful for testing the entire compiler for instance, but
could be useful for utility methods that take simple inputs and provide
simple outputs.
I've added tests to a few tings to try it out.
The syntax for it here is probably overly verbose but we could iterate
on that if need be.
The way it's done is that the test-code is extracted from the comments
and (virtually) "injected" in a weirdly named top level method of the
same file, which is then called from a "fake" main; the whole thing is
compiled to dill and run in an isolate.
(This is an application where making advanced invalidation support
adding top level methods would be great).
Change-Id: I7927822bca0ba68780458c40fe585882330e3b60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203242
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This CL creates a new test suite running through *.equivalence_info
(yaml) files where one specifies a number of files that are supposed to
parse 'the same' in the sense that it gives 'the same' listener events
modulo whatever the yaml file specifies is ok is not the same.
This could for instance - and is in the tests added here - be to not
include data after the parenthesis (as it often includes tokens),
ignoring `handleParenthesizedExpression` (as for instance `a < b` and
`(a < b)` should probably parse the same and ignoring
`handleRecoverableError`.
This might be a bit basic, but as future needs come up we can make this
fit our needs.
Change-Id: I4f5dfde9e916a95742f49e104fb5c751a8a9b921
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197381
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
The folder 'general' now tests the same. Two tests unique to
general_nnbd_opt_out have been copied over to general.
Change-Id: Ibd02dc236cdddff0730fb99bf10504dd16329cab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185545
Reviewed-by: Jens Johansen <jensj@google.com>