Commit Graph

143 Commits

Author SHA1 Message Date
Jens Johansen d93e62b550 [CFE/testing] Faster listing of testcases, especially for spelling_test_not_src_suite
pkg/front_end/test/spelling_test_not_src_suite.dart:
Before: Returning 5503 results after 0:00:30.424831
Now: Returning 5503 results after 0:00:00.642866

pkg/front_end/test/textual_outline_suite.dart:
Before: Returning 3335 results after 0:00:01.340791
Now: Returning 3335 results after 0:00:00.950186

pkg/front_end/test/outline_suite.dart:
Before: Returning 3328 results after 0:00:01.698578
Now: Returning 3328 results after 0:00:00.908465

pkg/front_end/test/strong_suite.dart:
Before: Returning 3335 results after 0:00:01.719944
Now: Returning 3335 results after 0:00:00.819222

pkg/front_end/test/modular_suite.dart:
Before: Returning 3328 results after 0:00:01.777826
Now: Returning 3328 results after 0:00:00.887345

pkg/front_end/test/lint_suite.dart:
Before: Returning 600 results after 0:00:00.035862
Now: Returning 600 results after 0:00:00.016070

pkg/front_end/test/spelling_test_src_suite.dart:

Before: Returning 605 results after 0:00:00.027379
Now: Got list of size 605 in 0:00:00.019704
Change-Id: I422b6bd0a4aac6da3d94d500349c3d84bf88cffe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/498880
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2026-04-28 06:00:01 -07:00
Jens Johansen 12c1186899 [CFE] Instrumenter: Add tests and --countCalls
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>
2026-02-19 00:14:14 -08:00
Paul Berry 38644510bf [messages] Remove codes_generated.dart files.
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>
2026-01-28 13:40:52 -08:00
Paul Berry 20ce2bda28 [messages] Begin transitioning CFE and _fe_analyzer_shared diagnostic logic.
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>
2026-01-27 11:28:53 -08:00
Paul Berry b32ef34b9a [messages] Prepare to add shared messages.yaml file.
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>
2025-09-15 06:17:03 -07:00
Jens Johansen 82fd32779b [CFE] Tests for the coverage tests
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>
2025-08-06 04:50:21 -07:00
Johnni Winther 060e154eed [cfe] Remove weak suite
Change-Id: Ic2598e408c0ca0d0f8cd1e07a0354f9e7fefd321
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411242
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-02-26 03:46:32 -08:00
Chloe Stefantsova 5d70261afd [cfe] Enable setter/getter pairs with mismatching types
The new functionality is guided by the flag 'getter-setter-error'.

Part of https://github.com/dart-lang/sdk/issues/58579

Change-Id: I540e1ac67d1a4fb244e57981311c0b56155050fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396821
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-11-22 09:51:07 +00:00
Johnni Winther eb8156415c [cfe] Remove use of 'fasta' in (file)names
Change-Id: Iac3850696fb5e48dff847d17f7110644e8b8bd03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395920
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-11-20 14:22:56 +00:00
Johnni Winther 808fa4ca8b [cfe] Move tool/_fasta/ to tool/
Change-Id: I5b7348fb4adb4e7f4039c91d54d712c1eb131ecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395002
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-11-18 07:49:01 +00:00
Johnni Winther 14097a1aba [cfe] Move suites from test/fasta/ to test/
Change-Id: Ida60cd9bc95c783df6e3a7819560b3836660c10f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394486
Reviewed-by: Jens Johansen <jensj@google.com>
2024-11-14 07:32:21 +00:00
Johnni Winther 717c52383b [cfe] Move test/fasta/ subfolders to test/
Change-Id: Ie65105f3d68e6545ccf2c4cde3b2523014083a40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394445
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-11-12 14:16:01 +00:00
Chloe Stefantsova f6fe5615c4 [analyzer][cfe] Generate constraints based on type variable bounds
In response to https://github.com/dart-lang/language/issues/3009

Change-Id: I918d392e422f1997736bf2543c8107cb44d3d6f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364721
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2024-09-25 10:59:51 +00:00
Jens Johansen 47dc4663d8 [CFE] Increase test coverage 01
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>
2024-08-05 08:26:09 +00:00
Chloe Stefantsova 2f3bca71f8 [cfe] Implement type inference for NullAwareElement
Part of https://github.com/dart-lang/sdk/issues/55955

Change-Id: Idbede4120a95ead2502779d271e8f6dc96059ab6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377648
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-07-29 14:17:27 +00:00
Johnni Winther e40cad30a3 [cfe] Move fasta/codes/ to src/ and rename to cfe_codes*
Part of removing uses of 'fasta'.

TEST=existing

Change-Id: Ibf144a126d8ff4ba15b6cfd2c4fb898e9a499362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371685
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-06-20 09:36:39 +00:00
Kallen Tu 76c0e85789 [cfe][wildcard-variables] Remove local _ from scope.
Local variables named `_` are no longer in scope and can't be used when the wildcard variables experiment is enabled.

Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: I13a7a9fcfb92e4b64bd51b5ccfe657f5a0633233
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369507
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-06-06 21:39:03 +00:00
Johnni Winther 30e4861d9b [cfe] Run weak suite only on dart2js
Change-Id: I96aa868dd9ac5cf8c7c5592607c0d87e3f2d9bc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366620
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-05-15 11:33:06 +00:00
Jens Johansen 2bd74882e2 [package:testing] Various updates
* 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>
2024-03-21 06:58:32 +00:00
David Morgan 897c89e8bc [CFE] Split files needed by package:vm/modular/... into codes folder.
Fix "no exports" exclude for `api_unstable` to actually work: it was mixing up
the path root.

Tested: no code changes, only moves.
Change-Id: If06a96f0de8fb8b92f331978d457c72deda07cec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354301
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-02-27 15:04:27 +00:00
Jens Johansen 9985bad4ea [CFE] Remove unused fasta/sdk_test.dart
Also remove 'onlyCrashes' option which was only used there.

Change-Id: Iba1486058d561284d71aabf13431f302e7c5b9b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346520
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-16 13:18:57 +00:00
Jens Johansen bf96a722bc [frontend_server] CFE team takes ownership of package:frontend_server
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>
2023-12-19 10:38:28 +00:00
Alexander Thomas a9cb6fbb0d [cleanup] Remove references to _2 tests from pkg/front_end
Bug: b/310114753
Change-Id: If8ffa9e6132d058e63608213d606056197c15e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336962
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-11-27 09:10:34 +00:00
Johnni Winther 56a86e599e [cfe,ddc] Add tests for scopes in extensions, extension types and mixins
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>
2023-11-16 09:37:31 +00:00
Alexander Thomas 9394b30b77 Fix incorrect file reference in license headers
Bug: b/286184681
Change-Id: I903528c4adfbc576644aec7541903df6b9633e26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325523
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-09-18 06:44:08 +00:00
Johnni Winther e42bb83d32 [cfe] Add test folder for dart2wasm
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>
2023-01-02 15:43:58 +00:00
Johnni Winther 323d5bf05e [cfe] Run all but nnbd_mixed tests in strong mode
Change-Id: I96947e3b2790067add9b956904af375a222bb640
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276081
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-19 12:44:47 +00:00
Johnni Winther c0a577a8db [cfe] Remove language version from inference testcases
Change-Id: I796eab1fe2d8f771d5caabfae06e78bb11f367ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250846
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-07-08 12:52:19 +00:00
Chloe Stefantsova 95d8a5d41a [cfe] Remove Kernel round-trip text serialization
Change-Id: Ifdf0df0b93773f95eb1646a313c15e0a578b5a8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249181
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-06-21 10:28:24 +00:00
Johnni Winther 31f7a48baf [cfe] Remove language version from expectation tests
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>
2022-05-30 15:14:43 +00:00
Johnni Winther 9ff6a58790 [cfe] Add initial support for macro precompilation in incremental compiler
Change-Id: I340694cb6aac2ac8305f71caf7897eef09ebfa5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235460
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-09 22:14:05 +00:00
Johnni Winther 7d115ed0ad [cfe] Move macro tests to common subfolder
Change-Id: I3c327744e6e76d99efa7fc44644542ea92e5a0d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235225
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-08 14:17:23 +00:00
Johnni Winther cae6c75023 [cfe] Remove unused scanner/parser suites
Change-Id: I9051f449dec5773b47a489d260275cbecce9a31e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234281
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-01 14:40:39 +00:00
Jens Johansen 1044d83ab7 [kernel] Spell check kernel/bin
Change-Id: I1433d7940f9a20b70793c8e0ea801d16aa3f9eb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231201
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-02-02 12:20:46 +00:00
Johnni Winther 9b7be8d117 [cfe] Call MacroExecutor for phase 3 macros
This CL adds capability for calling MacroExecutor to apply phase 3
macros to function declarations.

Change-Id: I1ab5bf33c8d9c6ce0c6706fe2bcafe2298ff292b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227720
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-01-17 16:24:55 +00:00
Johnni Winther 078d407f40 [cfe] Add modular_suite
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>
2021-12-10 14:02:30 +00:00
Jens Johansen ad6ffaab95 [CFE] First stab at prototype for textually extracting outlines
Change-Id: Ib84b47f0acb553cee6d891d7bbcf865f4a57a65a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221080
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-11-26 06:14:44 +00:00
Johnni Winther 6f59892b82 [cfe] Add initial test for macros
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>
2021-11-22 11:17:53 +00:00
Johnni Winther d906c6de26 Reland "[cfe] Move createLibraryBuilder methods to loaders"
This is a reland of 0e7d0f5205

Original change's description:
> [cfe] Move createLibraryBuilder methods to loaders
>
> Change-Id: I912ab0494cc91a4a2b665a24a7d55362402542ff
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216940
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Jens Johansen <jensj@google.com>

Change-Id: Ibb25413423a9bbd67c8788f9adce95c201ac8ebf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217603
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-10-21 14:24:06 +00:00
Johnni Winther 3006908d7e Revert "[cfe] Encapsulate Dill/SourceLoader.builders" and "[cfe] Move createLibraryBuilder methods to loaders"
This reverts commits 2bbb5dc907 and 0e7d0f5205.

Change-Id: I140ae6eab70102d39b1bec665bedd3a3dbfb02bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217300
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-10-19 23:14:11 +00:00
Alexander Thomas 056afdac39 [testing] Merge dart2js-batch into the global batch option
* 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>
2021-10-19 13:49:02 +00:00
Johnni Winther 0e7d0f5205 [cfe] Move createLibraryBuilder methods to loaders
Change-Id: I912ab0494cc91a4a2b665a24a7d55362402542ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216940
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-10-15 06:13:07 +00:00
Nate Bosch f9c68a5679 Replace a bunch of references to .packages
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>
2021-10-12 20:16:15 +00:00
Jens Johansen 5b5956bd4e [CFE] First pass at internal test utility
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>
2021-06-22 08:12:58 +00:00
Jens Johansen 8a03e9e75f [parser] Create parser equivalence test suite for ensuring that files parse 'the same'
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>
2021-05-05 10:17:22 +00:00
Jens Johansen 20cfdeffe5 [CFE] Include .crash_dart in weak tests; better handling of erroneous -D parameters and expectationFileMismatchSerialized on -DupdateExpectations=true
Change-Id: I00da3e4cf8859c65a8d93600804c7dbc56ec0bca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192180
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-19 13:34:17 +00:00
Johnni Winther 03ac05b146 [kernel] Migrate package:kernel/text_serializer.dart
Change-Id: I0b084911fa4ba35593a70ba8c214e818dbf7c219
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190440
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-10 13:26:58 +00:00
Johnni Winther 357e83e44d [cfe] Rename incremental_load/initialize_from_dill(_suite) to incremental(_suite)
Change-Id: I747151249330ed3c9c1026289be52d5ca0dca891
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185600
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-19 08:41:07 +00:00
Johnni Winther 045a40d2e6 [cfe] Rename incremental_suite to incremental_dartino_suite
- to prepare for renaming incremental_load/initialize_from_dill to
  incremental

Change-Id: Ie47f8e46c90b61de0838a83dcc9a5be6d866aa19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185547
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-19 08:41:07 +00:00
Johnni Winther 821536f7a3 [cfe] Remove general_nnbd_opt_out
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>
2021-02-19 08:41:07 +00:00