Commit Graph

55 Commits

Author SHA1 Message Date
Sam Rawlins 8a17ad9f05 analyzer: Deprecate AnalysisError in favor of Diagnostic
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: If9bbc96beed95129b099588c5bd9728afda8e392
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426902
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-08 14:02:16 -07:00
Johnni Winther 8d77908227 [test_runner] Support update_static_error_tests on Windows
A previous change inadvertently broke the support for Windows. This fixes this and adds an end-to-end test to avoid this.

Change-Id: I6f8563665038a7ecb0b30b5dfb7051b606d90620
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420660
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2025-04-07 07:30:12 -07:00
Johnni Winther 0060b0f665 [cfe] Remove nnbd mode
TEST=existing

Change-Id: I30bbadb74e81c7f4aaa444d1e2f6f5ffc2005d4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412881
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-03-04 01:46:51 -08:00
Robert Nystrom 955e351fad Batch files when running CFE to update static error tests.
The static error test updater needs to ask analyzer, CFE, and dart2js
for the errors for each updated test file. Previously, it would invoke
each of those as a separate process, one at a time, for each test file.

This was comically slow.

I recently updated it to invoke analyzer as a library and analyze all
the files at once, which made that part >100x faster.

This CL does essentially the same thing for CFE. It's still invoking CFE
as a process, but it does so with a batch of files. It's not as fast as
analyzer is, but it's much better.

It's still calling dart2js once per file but, strangely, that isn't too
slow. Also, web static error tests aren't very common, so this isn't as
important.

Change-Id: I6756901bb761579dc90f8af4d9774014b04bb009
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399885
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2024-12-11 03:05:35 +00:00
Robert Nystrom 9d3f7c52bd Make the static error test updater run the analyzer as a library.
Prior to this change, the static error test updater would spawn a new
analyzer CLI for each updated test file. This was incredibly slow, like
5-10 seconds for each file.

This change instead uses the analyzer as a library. It creates a single
analysis context collection for all of the files to be updated and then
gets the errors from that.

On my machine, it's about 100x faster. It's fast enough to routinely
update *all* of the test expectations in a batch. (Or, at least, it will
be if we can make a similar change for CFE.)

Change-Id: I39059489e966abf040e9f995505c7013b18d4930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396574
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2024-11-26 19:07:38 +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
Robert Nystrom ea8b520599 Add support to update_static_error_tests.dart to skip non-error files.
I'm slowly going through and reformatting the tests. That also means
regenerating the static error expectations because of #57042. But I
don't need to generate static error markers for files that don't already
have them.

So this adds a flag to the test updater to let it skip over any test
file that isn't already known to be a static error test.

Change-Id: I61f10d29924f1f9d2dabf61bb604e53a6622017f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394940
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2024-11-13 19:10:29 +00:00
Konstantin Shcheglov 726fc33e0a API. Deprecate 'ContextLocator' and 'ContextBuilder'.
Bug: https://github.com/dart-lang/sdk/issues/56102
Change-Id: Ia55b978571e412ea7b6b7c4b6cc482f731ecdc1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375760
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-07-15 20:31:19 +00:00
Devon Carew 2837647bea [wiki] move the https://github.com/dart-lang/sdk/wiki to the docs/ dir
Change-Id: I28db796fadcc111d97d3589bf3988ea0bbb8e18a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366682
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-05-16 18:19:40 +00:00
David Morgan 980cf725ff [test] Check all local files for error strings.
Based on abandoned change #264261.

Changes to that PR: compare and show file paths, improve part parsing, include analyzer expectations from other files as well as CFE expectations, update unit tests.

Add end to end tests. The simplest case "library_failure_test.dart" passes before this PR, all others require the change in this PR to pick up expectations in other files.
Change-Id: Ia71b78a8f0dced83f603309877132f261b47c5a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345541
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-02-20 09:31:21 +00:00
Devon Carew e2fe203adc [deps] roll package:lints to the latest
Change-Id: I582f956cd4b712203c2f6dd630b4e1384040446d
Tested: analysis clean (this is a lint only related change)
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329400
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-10-05 03:36:59 +00:00
Robert Nystrom b985fc961a Make the static error updater gracefully skip multitests.
Multitests aren't valid Dart files that can be processed by a Dart
implementation so the updater generally does a poor job if it tries to
update one.

It's probably not worth supporting because, in practice, a test should
either be a multitest or a static error test, but not both.

Change the tool to skip over any multitests it encounters. If this
results in it doing nothing at all, it reports that as an error.
Otherwise, it just lists the multitests it didn't process.

Close #37721.

Change-Id: Icfb1ff9fe63f2c249b3ccfba65166b97654a9918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296760
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-04-21 04:17:27 +00:00
Devon Carew 85cf783fe8 [pkg/test_runner] analyze with package:lints/recommended.yaml
Change-Id: Iab61ff9f67b40157657fde2d732e970d67c9fcac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290607
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-23 15:23:17 +00:00
Paul Berry b326d00e96 Fix update_static_error_tests.dart after recent binary removals.
We no longer build separate binaries for `dartanalyzer` and `dart2js`,
so we need to do something different.

For `dartanalyzer`, we just run the `dartanalyzer` script directly
(because the features we need for testing aren't available directly
from `dart analyze`).  For `dart2js`, we run in the new way (`dart
compile js`).

Change-Id: I7e34052a9e6ad62596279ca32604e32291a45953
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251842
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2022-07-19 16:35:54 +00:00
Alexander Thomas a2d2d693dc [infra] Migrate test_runner to null safety
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm64c-try
Fixes: b/232495224
Change-Id: I0338db48c0cc89ec35d52bff2f508105e80c3538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248008
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2022-06-15 15:51:58 +00:00
Devon Carew 0e8eece6b6 [pkg/test_runner] remove an explicit reference to package:file
Change-Id: I553161706c96413493fd525bbee17498b991f4f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246001
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2022-05-26 00:09:38 +00:00
Alexander Thomas 526d85ad79 [testing] Remove vendored args package
The vendored package was just used in some tooling that should be easy
to update to any breaking changes in args. Language versioning ensures
we can handle changes in the language as well.

Bug: b/232495224
Change-Id: I15223187f19b6fe2229dd4ac05e51fd794cbfbd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244627
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2022-05-13 17:15:46 +00:00
Konstantin Shcheglov 3d69c3c0c4 Restore sync file methods in AnalysisSession.
There are clients, like `built_value` that cannot be updated.

Change-Id: I27371018039f22cd7ca2cb82b30ec33469aa6e4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238002
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-21 23:27:57 +00:00
Konstantin Shcheglov 0b7b70b758 Deprecate synchronous methods in AnalysisSession.
Change-Id: I9bd3bf2d3d6dbc74ffefde1c06f83e9200b0f552
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2022-03-07 18:17:41 +00:00
Johnni Winther 184fd50728 [test_runner] Support multiple arguments in update_static_error_tests.dart
This improves usability of the tool when a multiple tests needs updating.

Change-Id: I034e3da7381ae79b2149429e5271904e0dfcae59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210862
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-24 08:02:38 +00:00
Konstantin Shcheglov cac96f7f8d Rename AnalysisSession.getXyz2() into getXyz().
Change-Id: Ia76aafc6a1190dcdca026097c364270389f2860a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206565
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-07-12 22:42:58 +00:00
Devon Carew 6b4f2a7aae [dartanalyzer] have the dartanalyzer command emit json output to stdout
Change-Id: I2044771cc28a3b04a2b8bd3bd79b5261b4d20467
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-06-17 23:39:51 +00:00
Robert Nystrom 8efd49860f Add a tool to detect orphaned Dart files in "test/".
Change-Id: I20322067f2cb65c858adfbfef5f785322b8a7a6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198060
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2021-05-11 01:23:03 +00:00
Robert Nystrom 7363505cfb Remove support for ancient multitest marker syntax.
TEST=fixing tests

Change-Id: I0857ff9275b4b915e0b79824c7e16f4d07c8a239
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198445
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2021-05-06 22:36:04 +00:00
Paul Berry c82c2f9948 Modify test runner to use the new dartanalyzer --format=json feature.
This allows the test runner to support context messages, for example
the context error messages associated with the new "why not promoted"
feature.

Bug: https://github.com/dart-lang/sdk/issues/44905
Change-Id: Ie342bde21c43641eafc5d117f328e9fde23c49bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193740
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-05 14:12:56 +00:00
Robert Nystrom fdb6ca6d01 Add support for context messages to static error tests.
Currently only CFE ("Fasta") tests have their context message output
parsed. It should be easy to extend that to dart2js and DDC if that's
useful. Analyzer might be more work.

This also adds support to the test updater for inserting context
messages when updating tests. By default, that flag is off, so the
existing behavior is preserved where context messages are ignnored. If
you want them, pass "-c" when updating a test.

When validating test output, if the test file contains context messages,
then they are validated. Otherwise, any context messages in the CFE
output are ignored. This way existing tests still pass.


Change StaticError to represent a single error for a single front end.

Before, the data model collapsed errors for different front-ends at the
same location into a single StaticError object which tracked different
messages for each front end. The idea was to move towards a world where
they really are the "same" error with eventually the same message.

But this adds a lot of complexity with things like merging errors and
doesn't reflect the reality that each error from each front end is
basically its own thing. Also, critically, it makes it much harder to
attach context messages to a specific front end's error object.

This changes it so that an instance of StaticError represents a single
error for a single front end. The test file syntax is unchanged and the
updated tool behaves the same. In a static error test, multiple
expectations can still share the same "//   ^^^" marker line. They are
just expanded to multiple StaticError objects at parse time.

This eliminates all of the complexity around merging and simplifying
errors.

Change-Id: Ida1736bfcde436fc2d1ce2963d91fa9cb154afa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193281
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2021-03-30 18:41:21 +00:00
Robert Nystrom 073eb9b806 Change StaticError to represent a single error for a single front end.
Before, the data model collapsed errors for different front-ends at the
same location into a single StaticError object which tracked different
messages for each front end. The idea was to move towards a world where
they really are the "same" error with eventually the same message.

But this adds a lot of complexity with things like merging errors and
doesn't reflect the reality that each error from each front end is
basically its own thing. Also, critically, it makes it much harder to
attach context messages to a specific front end's error object.

This changes it so that an instance of StaticError represents a single
error for a single front end. The test file syntax is unchanged and the
updated tool behaves the same. In a static error test, multiple
expectations can still share the same "//   ^^^" marker line. They are
just expanded to multiple StaticError objects at parse time.

This eliminates all of the complexity around merging and simplifying
errors.

Change-Id: I1d55a6e885e12cc9c438f928297fc0db7dd5ce85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193280
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2021-03-30 16:30:21 +00:00
Leaf Petersen 1a03d262d4 Set CFE weak/strong nnbd flag in the static error updater
Change-Id: Icfe7c5d41e5851fe9aadbf16daca2e753c65e86e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183361
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2021-02-09 02:25:44 +00:00
Karl Klose e776054596 [pkg/test_runner] Support 'enable-experiments' in multi-test converter
This change adds support for the 'enable-experiments' option to control
the experiments used in the analyzer and CFE.

It also adds support for multiple input files.

Change-Id: I15b9082e96f276249165efc66734ac9506b93ca1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178560
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2021-01-13 06:50:54 +00:00
Jake Macdonald bf24df2671 Reland "Reland "update Glob in the sdk, also adds package:file to the sdk""
This reverts commit 85174e4d8c.

Reason for revert: CL was OK, it looks like we just need a manual roll in order to add deps, only the HHH bots apply patches.

EDIT: Landing file dep ahead of time in flutter/engine to avoid manual roll + patch.

Original change's description:
> Revert "Reland "update Glob in the sdk, also adds package:file to the sdk""
>
> This reverts commit c62709e87b.
>
> Reason for revert: Still breaking flutter HHH bots
>
> Original change's description:
> > Reland "update Glob in the sdk, also adds package:file to the sdk"
> >
> > This reverts commit ce614d33c4.
> >
> > Original change's description:
> > > Revert "update Glob in the sdk, also adds package:file to the sdk"
> > >
> > > This reverts commit 18b19db300.
> > >
> > > Reason for revert: Breaks Flutter 3H/Golem. Tried making an appropriate patch for 3H that would pull file into its dependencies (see https://dart-review.googlesource.com/c/sdk/+/173960/), but that still failed, so reverting.
> > >
> > > Original change's description:
> > > > update Glob in the sdk, also adds package:file to the sdk
> > > >
> > > > Change-Id: Ia8628c28bfaf6343c19eecfef391339968cd57e9
> > > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172063
> > > > Commit-Queue: Jake Macdonald <jakemac@google.com>
> > > > Reviewed-by: Nate Bosch <nbosch@google.com>
> > >
> > > TBR=jakemac@google.com,nbosch@google.com
> > >
> > > Change-Id: I0616e3df7505f348edeefee40cbaf4adc59487cd
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173963
> > > Reviewed-by: Tess Strickland <sstrickl@google.com>
> > > Commit-Queue: Tess Strickland <sstrickl@google.com>
> >
> > TBR=jakemac@google.com,nbosch@google.com,sstrickl@google.com
> >
> > # Not skipping CQ checks because this is a reland.
> >
> > Change-Id: Ia85fe3b81214ca4ef2bed8e08ecc1b617927a579
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173981
> > Reviewed-by: Nate Bosch <nbosch@google.com>
> > Commit-Queue: Jake Macdonald <jakemac@google.com>
>
> TBR=jakemac@google.com,nbosch@google.com,sstrickl@google.com
>
> Change-Id: Iaff06dcbc3ef813ee9edb5ca8de163fdcc2041e2
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174060
> Reviewed-by: Jake Macdonald <jakemac@google.com>
> Commit-Queue: Jake Macdonald <jakemac@google.com>

TBR=jakemac@google.com,nbosch@google.com,sstrickl@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: If2181a9d5ec6b96d6a61cd5cf8857bddd937e59f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174382
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-11-30 21:58:44 +00:00
Jake Macdonald 85174e4d8c Revert "Reland "update Glob in the sdk, also adds package:file to the sdk""
This reverts commit c62709e87b.

Reason for revert: Still breaking flutter HHH bots

Original change's description:
> Reland "update Glob in the sdk, also adds package:file to the sdk"
>
> This reverts commit ce614d33c4.
>
> Original change's description:
> > Revert "update Glob in the sdk, also adds package:file to the sdk"
> >
> > This reverts commit 18b19db300.
> >
> > Reason for revert: Breaks Flutter 3H/Golem. Tried making an appropriate patch for 3H that would pull file into its dependencies (see https://dart-review.googlesource.com/c/sdk/+/173960/), but that still failed, so reverting.
> >
> > Original change's description:
> > > update Glob in the sdk, also adds package:file to the sdk
> > >
> > > Change-Id: Ia8628c28bfaf6343c19eecfef391339968cd57e9
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172063
> > > Commit-Queue: Jake Macdonald <jakemac@google.com>
> > > Reviewed-by: Nate Bosch <nbosch@google.com>
> >
> > TBR=jakemac@google.com,nbosch@google.com
> >
> > Change-Id: I0616e3df7505f348edeefee40cbaf4adc59487cd
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173963
> > Reviewed-by: Tess Strickland <sstrickl@google.com>
> > Commit-Queue: Tess Strickland <sstrickl@google.com>
>
> TBR=jakemac@google.com,nbosch@google.com,sstrickl@google.com
>
> # Not skipping CQ checks because this is a reland.
>
> Change-Id: Ia85fe3b81214ca4ef2bed8e08ecc1b617927a579
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173981
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Commit-Queue: Jake Macdonald <jakemac@google.com>

TBR=jakemac@google.com,nbosch@google.com,sstrickl@google.com

Change-Id: Iaff06dcbc3ef813ee9edb5ca8de163fdcc2041e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174060
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-11-26 00:11:11 +00:00
Jake Macdonald c62709e87b Reland "update Glob in the sdk, also adds package:file to the sdk"
This reverts commit ce614d33c4.

Original change's description:
> Revert "update Glob in the sdk, also adds package:file to the sdk"
>
> This reverts commit 18b19db300.
>
> Reason for revert: Breaks Flutter 3H/Golem. Tried making an appropriate patch for 3H that would pull file into its dependencies (see https://dart-review.googlesource.com/c/sdk/+/173960/), but that still failed, so reverting.
>
> Original change's description:
> > update Glob in the sdk, also adds package:file to the sdk
> >
> > Change-Id: Ia8628c28bfaf6343c19eecfef391339968cd57e9
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172063
> > Commit-Queue: Jake Macdonald <jakemac@google.com>
> > Reviewed-by: Nate Bosch <nbosch@google.com>
>
> TBR=jakemac@google.com,nbosch@google.com
>
> Change-Id: I0616e3df7505f348edeefee40cbaf4adc59487cd
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173963
> Reviewed-by: Tess Strickland <sstrickl@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

TBR=jakemac@google.com,nbosch@google.com,sstrickl@google.com

# Not skipping CQ checks because this is a reland.

Change-Id: Ia85fe3b81214ca4ef2bed8e08ecc1b617927a579
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173981
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-11-25 19:52:08 +00:00
Tess Strickland ce614d33c4 Revert "update Glob in the sdk, also adds package:file to the sdk"
This reverts commit 18b19db300.

Reason for revert: Breaks Flutter 3H/Golem. Tried making an appropriate patch for 3H that would pull file into its dependencies (see https://dart-review.googlesource.com/c/sdk/+/173960/), but that still failed, so reverting.

Original change's description:
> update Glob in the sdk, also adds package:file to the sdk
>
> Change-Id: Ia8628c28bfaf6343c19eecfef391339968cd57e9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172063
> Commit-Queue: Jake Macdonald <jakemac@google.com>
> Reviewed-by: Nate Bosch <nbosch@google.com>

TBR=jakemac@google.com,nbosch@google.com

Change-Id: I0616e3df7505f348edeefee40cbaf4adc59487cd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173963
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-11-25 10:46:27 +00:00
Jacob MacDonald 18b19db300 update Glob in the sdk, also adds package:file to the sdk
Change-Id: Ia8628c28bfaf6343c19eecfef391339968cd57e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172063
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-11-25 01:47:49 +00:00
Devon Carew cdbfe0af68 [test_matrix.json] perform additional analysis validation on the bots
Change-Id: Ia09c8734533e2ef5b59dad96861d3ecec29db8bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172029
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-11-16 16:36:48 +00:00
Robert Nystrom 30d13109e7 Error on all ignored command line arguments with a named config.
Context: https://github.com/dart-lang/sdk/issues/43881
Change-Id: I456e319564a620b44fa4bd36e8ed949c83ab6373
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168766
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Karl Klose <karlklose@google.com>
2020-10-29 01:15:03 +00:00
Johnni Winther 4948c31b7a [test_runner] Support detection of CFE warnings
+ some test expectation fixes

Change-Id: Ibf0259914960ea25978f2b8e29aa89336e209f2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162321
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-15 07:57:31 +00:00
Johnni Winther 0e93845ba1 Make update_static_error_tests work on Windows (again)
+ update some test expectations

Change-Id: I63ca86309ea3352a88686f5e3f416311ee7bc03c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162185
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-10 06:21:13 +00:00
Robert Nystrom 451e420612 Add support for web errors to the static error test updater.
Change-Id: I666d081a8ad18a1aef7dd2a2d0fbe2f12b740e11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160980
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-08-31 18:15:18 +00:00
Robert Nystrom 1d93f9cc7b Run the analyzer from the built SDK directory.
The static error updater used to run analyzer using the scripts in
sdk/bin/, but those are no longer reliable now that analyzer looks for
a nearby VERSION file. Instead, look for the most recently built
analyzer in the build directory.

Change-Id: If2b437b12d036e15f5503aba816dc2a007e39cfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160943
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-08-28 23:53:29 +00:00
Robert Nystrom 1094b3c61d Prepare static error test updater tool to handle web tests.
This doesn't actually run DDC to generate the web errors yet, but it
changes the CLI in anticipation of that, and adds tests to verify that
once web errors are reported that the updater handles them correctly.

Change-Id: I31264e3d468969b07f9eb60353a9b02a93bec7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155102
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-07-22 22:48:49 +00:00
Robert Nystrom bd6e3733a7 Include warnings in the static error updater tool.
A while back, we changed the test runner to validate warnings in static
error tests, so this gets the updater tool to parity with that.

Also, when printing analyzer errors, sort them by location before
severity.

Change-Id: Ia07e79adb6d7ca19a50210a2813d7f2f7e60f7e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148285
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-26 18:24:20 +00:00
Leaf Petersen a608616e6f Handle CFE and analyzer crashes when updating static errors.
Change-Id: I3a9b5d3d25f8e0a5331f72e0a83b439c679540a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115008
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-04-10 19:56:48 +00:00
Robert Nystrom 274938dfef Allow enabling NNBD in the static error test updater.
This lets us generate or update NNBD static error tests.

Change-Id: Ice837c2b885114e10041176928c7f695e8ff5c75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137723
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-02-28 01:22:12 +00:00
Robert Nystrom cb2cbb7074 Enable "omit_local_variable_types" lint in test_runner and fix violations.
Also turned a couple of "final" locals to "var" to be consistent with others.
Removed a no-longer valid analysis option.

Change-Id: I741989b20199ba8f1e86e464e1cf994137332fad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128500
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-12-17 19:48:54 +00:00
Karl Klose 413867d678 [infra] Add a script to convert multi-tests to the new static error test framework
The script verifies that the multi-test only contains static annotations
and that converting it to a single test produces the same error messages
as testing the sub-tests generated by the multi-test.

If that is the case, it uses
  pkg/test_runner/tool/update_static_error_tests.dart
to insert the expected errors and removes the multi-test markers.

Additionally, a copy of the '/none' test and of all the sub-tests with an
'OK' marker are created to preserve the testof runtime behavior.

Change-Id: I6eb67246f209dfbdf9b4ba8705c368c6f1978938
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124128
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-12-04 11:25:19 +00:00
Johnni Winther a87c563ecb [test_runner] Make update_static_error_tests work on Windows
Change-Id: Ia2e9a1b122953d1565f5829932cd21705a725f45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125972
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-22 21:06:57 +00:00
Robert Nystrom 90ff37e011 Plumb the configuration's experiments flags through to tools.
Both a test file and now a test configuration can specify that
experiment flags should be enabled. Since they both can, passing those
to the tools is a little tricky because we need to merge the two
command line arguments. It's made worse by the fact that this corner of
test_runner is riddled with poorly factored code.

This doesn't fix the redundant code, but does merge and pass the flags
through. Right now, it parses them from the test file by looking for
them in the SharedOptions line, which is where they currently appear.

That's pretty hacky. Eventually, we should change these tests to use:

// Requirements=

Fixes #38386, #38387, #38388, and #38389.

Change-Id: I1aea1482b30b9ba19c427319f895822d81ee12ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121262
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-10-11 20:33:36 +00:00
Nate Bosch 97925ece63 Delete test_runner/tool/co19.dart
Towards #37318

Removes a script using the deprecated `--checked` flag. No one appears to be
using this tool.

Change-Id: Ib9d30790943845ece2cb5e4af1e4f45da5a28f79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115769
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-09-12 18:43:09 +00:00
Robert Nystrom 9ff104efd6 Move StaticError and StaticErrorParser to a separate file.
test_file.dart was getting kind of unwieldy.

Change-Id: Ic1fd496f837f5f9b0150a640845d29c42a350c58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115772
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-09-06 01:16:48 +00:00