dart-sdk/pkg/test_runner
Robert Nystrom 6fd24ef3c4 Show analysis errors when a non-static error analyzer test fails.
There are two ways the test runner might want to parse and show errors
from analyzer:

1. When a static error test's output doesn't match the expected errors.
2. When a normal runtime test produces unexpected errors.

The former were correctly migrated over to parse and read the analyzer's
JSON output. The latter wasn't. It was still trying to parse the old
"|"-separated machine format.

Worse, when migrating to the new JSON output, a try-catch-block was
added to handle any unexpected errors. That had the unintended side
effect of silently catching this parse error and then continuing. The
end result is that if an analyzer test failed on a normal runtime test,
the test runner didn't print any of the analyzer errors. :(

This fixes that. It uses a single code path to parse the JSON output to
AnalyzerError. Then, for static error tests, it converts those to
StaticErrors.

Change-Id: I51c1277f0ed04faead82f579d668f8897f379a49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201382
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2021-06-02 01:51:25 +00:00
..
bin fix sort_directives violations 2021-04-20 22:21:28 +00:00
lib Show analysis errors when a non-static error analyzer test fails. 2021-06-02 01:51:25 +00:00
test Improve the highlight range for conflicting_generic_interfaces 2021-05-18 20:42:33 +00:00
tool Add a tool to detect orphaned Dart files in "test/". 2021-05-11 01:23:03 +00:00
.gitignore
analysis_options.yaml Turn on the "isEmpty" and "isNotEmpty" lints and fix violations. 2020-08-31 18:33:48 +00:00
pubspec.yaml Add a tool to detect orphaned Dart files in "test/". 2021-05-11 01:23:03 +00:00