Commit graph

113 commits

Author SHA1 Message Date
Jaime Wren cd878bc433 Create the new flag --use-cfe in the analyzer, analysis server and analyzer_cli and migrate the old behavior of --preview-dart-2 to --use-cfe. The --preview-dart-2 flag is now a no-op, with functionality coming soon.
See https://github.com/dart-lang/sdk/issues/31640

Change-Id: I2db2e7ef6a324cbd5d369b807e331495fed167df
Reviewed-on: https://dart-review.googlesource.com/33121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2018-01-08 22:37:05 +00:00
Devon Carew 3bca5b6a1d Duplicate some analyzer cli tests to also run in --preview-dart-2.
Bug:
Change-Id: Ic2b96434e58a7d3eff3ff9aef1bcb540d8f4f0ce
Reviewed-on: https://dart-review.googlesource.com/29623
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2017-12-14 22:18:35 +00:00
Devon Carew 6346b18028 Restore a strong mode analyzer cli test.
Bug:
Change-Id: If9b459d99a3120071ba8f3a7bd9aa1d2e776bbd6
Reviewed-on: https://dart-review.googlesource.com/29443
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2017-12-13 22:26:56 +00:00
Konstantin Shcheglov e67cd0daab The very first CL for end-to-end integration of FrontEnd resolution into Analysis Server.
At this point KernelDriver is used only by Analyzer, so I don't include
anyone from the FrontEnd team. We will merge to get the same performance
benefits of the latest IKG approach, but later.

Only just enought integration is done - we can store and apply
types in the local variable declaration.

Everything is in disarray, I will follow up with improvements.


R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Ie3434e26233b84fb019c50a7cc834a08d0dadbed
Reviewed-on: https://dart-review.googlesource.com/22202
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-11-20 22:42:09 +00:00
Brian Wilkerson fbd7619b2e Remove missed references to enableAssertInitializers
Change-Id: I2403d8bbc5db877bfdf28cc05f4e498d95b1b06d
Reviewed-on: https://dart-review.googlesource.com/11260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-10-05 17:44:20 +00:00
Sigmund Cherem 436ed70100 Add preview-dart-2 flag to analyzer cli and plumb it through test.py.
This allows us to collect stats about language-style tests as follows:

 ./tools/test.py -m release -c dart2analyzer -r none --preview-dart-2 --report \
      language language_2 corelib corelib_2

As of this morning, the command above has 87% of the tests passing.

Change-Id: I0f84211d5f33659d5923601267367be90c578107
Reviewed-on: https://dart-review.googlesource.com/3381
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-09-07 20:13:40 +00:00
Devon Carew 4c5531315b fix two test failures in analyzer_cli/test/options_test.dart
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/3003343002 .
2017-08-24 11:36:38 -07:00
Konstantin Shcheglov 776b7eb9cd Cache PackageBundle instances in AnalyzerWorkerLoop and reuse for multiple requests.
There are many Bazel targets that have huge number of dependencies,
hundreds and thousands of them, and these dependencies are the same
as for other targets. So, we want to keep corresponding PackageBundle
instances, partially decoded, in memory and reuse.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3006543002 .
2017-08-24 11:32:20 -07:00
Konstantin Shcheglov 11b8c54e22 Switch build mode to Analysis Driver.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2994763002 .
2017-08-08 11:11:37 -07:00
Konstantin Shcheglov 6515a80b21 Make AnalyzerWorkerLoop AsyncWorkerLoop.
BuildMode will be switched to AnalysisDriver, so will become async.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2998603002 .
2017-08-08 08:11:06 -07:00
Erik Ernst 9336e199fd Re-land of CL 2990703002, adding fixes to analyzer_test and error_test.
This CL is identical to the reverted CL 2990703002 which implements
syntactic support for generalized void in the analyzer, plus two bug
fixes in pkg/analyzer/test/generated/parser_test.dart and
pkg/analyzer_cli/test/error_test.dart. In the former, a test on parsing
`void,` was changed to expect an error: _isTypeIdentifier on a lone
`void` will no longer return true, which is necessary because `void`
can now be used as a type annotation alone. Another test on `void x`
was added, which produces the behavior previously seen for `void,`.
In error_test, the error which is used throughout was changed from
`void foo;` to `var int foo;` (because the former is no longer an
error).

Review-Url: https://codereview.chromium.org/2992623002 .
2017-07-27 12:39:19 +02:00
Konstantin Shcheglov 1db0b3a29c Replace typed_mock with mockito in analyzer_cli.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2989583003 .
2017-07-25 09:54:08 -07:00
Konstantin Shcheglov 824a62ba3c More tests for build mode.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2971373002 .
2017-07-07 14:33:09 -07:00
Konstantin Shcheglov 671bedc8f6 Fix strong_mode_test after moving driver_test fields into class.
TBR

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2971343002 .
2017-07-07 10:01:47 -07:00
Konstantin Shcheglov 73ec7f0a79 Convert driver_test.dart to reflective tests.
It was hard to keep track of defined tests, and to run individual tests.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2976493002 .
2017-07-07 09:38:49 -07:00
Konstantin Shcheglov 711e37295a Remove the --build-summary-only-diet option.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2968403002 .
2017-07-07 09:15:48 -07:00
Konstantin Shcheglov 0699a72344 Additional tests for build mode.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2968303002 .
2017-07-06 15:02:28 -07:00
Konstantin Shcheglov 956b9ce96b Split driver_test main() into 4 tests methods.
This is not how I would ideally prefer to write tests, but a bit better.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2967413002 .
2017-07-06 14:12:45 -07:00
Devon Carew d4abd49df7 Add analytics to analyzer-cli and analysis server.
BUG=
R=brianwilkerson@google.com, scheglov@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2963323002 .
2017-07-05 23:29:46 -07:00
Brian Wilkerson 62d0376231 Run the sorter to reduce code churn
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933753002 .
2017-06-12 07:37:14 -07:00
Devon Carew f1a5503fcc Add --fatal-infos; hide --fatal-hints.
BUG=
R=brianwilkerson@google.com, danrubel@google.com

Review-Url: https://codereview.chromium.org/2874043002 .
2017-05-10 11:45:11 -07:00
Devon Carew 5d0056df88 Make the exit code for dartanalyzer more deterministic.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2857203002 .
2017-05-03 11:38:35 -07:00
danrubel 9649ca1a94 fix driver test
Review-Url: https://codereview.chromium.org/2855513002 .
2017-04-30 23:35:59 -04:00
danrubel c8784af933 rename .analysis_options --> analysis_options.yaml
See https://github.com/dart-lang/sdk/issues/28385

R=brianwilkerson@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2839383003 .
2017-04-30 18:33:10 -04:00
Brian Wilkerson e009f32ad7 Fix a failing test
Review-Url: https://codereview.chromium.org/2848643004 .
2017-04-27 10:45:24 -07:00
Devon Carew 66ac96c4a6 Use the dart:io Platform.resolvedExecutable API to locate the Dart SDK.
BUG=
R=brianwilkerson@google.com, danrubel@google.com, pquitslund@google.com

Review-Url: https://codereview.chromium.org/2844883005 .
2017-04-27 09:29:08 -07:00
Devon Carew eae2bf2747 Fix an issue with duplicate reported analysis errors.
BUG=
R=brianwilkerson@google.com, danrubel@google.com

Review-Url: https://codereview.chromium.org/2793813002 .
2017-04-23 21:05:10 -07:00
pq 1d4d0d769f CLI support for enableAssertInitializers.
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2809793004 .
2017-04-12 10:38:30 -07:00
Jacob MacDonald 3e623d7df1 Add --build-summary-only-unlinked flag, which makes the output summary be an unlinked summary instead of a linked one.
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2796953002 .
2017-04-04 12:22:20 -07:00
Devon Carew 0fcb91aa06 Fix analyzer tests when run in checked mode.
BUG=

Review-Url: https://codereview.chromium.org/2775073002 .
2017-03-25 15:34:40 -07:00
Devon Carew b51d1fd8e3 Use ansi color in the dartanalyzer cli output.
BUG=
R=brianwilkerson@google.com, danrubel@google.com

Review-Url: https://codereview.chromium.org/2775633002 .
2017-03-25 15:02:47 -07:00
Jacob Richman a993294503 Format all analyzer packages
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2753923003 .
2017-03-16 16:11:43 -07:00
danrubel b401f7272f cleanup bazel workspace relative path test
Review-Url: https://codereview.chromium.org/2712333002 .
2017-02-26 13:19:25 -08:00
danrubel 4c771a52d3 fix failing bazel workspace relative path test
Review-Url: https://codereview.chromium.org/2721483002 .
2017-02-26 12:44:28 -08:00
danrubel 130f43fe7b fix failing bazel workspace relative path test
Review-Url: https://codereview.chromium.org/2720593002 .
2017-02-26 11:14:14 -08:00
danrubel 994a3a2b20 Revert "debug failing test"
This reverts commit c78ea8c231.

Review-Url: https://codereview.chromium.org/2721473002 .
2017-02-26 11:08:19 -08:00
danrubel c78ea8c231 debug failing test
Review-Url: https://codereview.chromium.org/2721453002 .
2017-02-26 09:47:58 -08:00
danrubel c04f6a2ab1 fix dartanalyzer find options in bazel workspace
- add dartanalyzer test for bazel workspace
- ensure call to getAnalysisOptions passes an absolute path
- update BasicWorkspace to have an absolute normalized path similar to BazelWorkspace

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2719703005 .
2017-02-26 08:52:55 -08:00
Brian Wilkerson be65669b34 Fix tests that are failing on windows
Review-Url: https://codereview.chromium.org/2713913003 .
2017-02-24 08:18:54 -08:00
danrubel abee739921 rework analyzer_cli to use ContextBuilder getAnalysisOptions
This is a follow on to https://codereview.chromium.org/2716693003
that refactors analyzer_cli to use ContextBuilder.
As a result, dartanalyzer now correctly finds the default
flutter analysis options when the project references package:flutter
but does not contain an analysis options file.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2710313002 .
2017-02-23 16:52:26 -05:00
Devon Carew 1da570c215 Remove and hide analyzer cli flags.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2713723003 .
2017-02-22 14:09:41 -08:00
Devon Carew 46cacfeae9 Some improvements to the command-line analyzer's output.
BUG=
R=brianwilkerson@google.com, danrubel@google.com

Review-Url: https://codereview.chromium.org/2704103002 .
2017-02-22 12:35:09 -08:00
Devon Carew 6e9adf2624 Remove older deprecated flags; more cleanup to the cli help args.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2692203010 .
2017-02-17 13:30:37 -08:00
Devon Carew e1fb256694 Fix an arg parser test for the analyzer cli.
BUG=

Review-Url: https://codereview.chromium.org/2696703011 .
2017-02-17 06:56:33 -08:00
Konstantin Shcheglov 7e9f4ba34c Make the test's dart:core import dart:async in tests.
SDK's version does it, and we probably don't want to protect aginst
something what happens only in tests, but is not expected actually.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2696013004 .
2017-02-14 13:31:18 -08:00
Leaf Petersen 0c2bf046f1 Add FutureOr to analyzer_cli test async.dart.
Fixes https://github.com/dart-lang/sdk/issues/28653 .

BUG=
R=brianwilkerson@google.com, whesse@google.com

Review-Url: https://codereview.chromium.org/2675203006 .
2017-02-06 17:08:33 -08:00
danrubel 167107e94c fix dartanalyzer sdk setup
Separate analysis options initialization from context setup
so that analysis options can be used to correctly setup the SDK
in strong mode.

Fix https://github.com/dart-lang/sdk/issues/28507

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2678633002 .
2017-02-04 12:08:53 -05:00
Konstantin Shcheglov 15cf5cb017 Run analyzer_cli asynchronously.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2658863002 .
2017-01-26 09:42:51 -08:00
Dan Rubel 13bd1ad0bf DDC/AnalyzerCLI common cmdline option processing
Refactor DDC and Analyzer CLI command line option processing
to use common createContextBuilderOptions method
and ContextBuilderOptions to hold common options.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2584293003 .
2016-12-19 16:24:20 -05:00
danrubel e321439470 cleanup Analyzer CLI and DDC arg parsing
This removes the need to split arguments on '='
before calling the extractDefinedVariables method.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2581723002 .
2016-12-15 12:16:20 -05:00