mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 19:21:30 +00:00
[CFE et al] Presubmit should give details of unexpected results
For instance before this CL one might just be told ``` 1 failed: lint/front_end/lib/src/fasta/type_inference/type_constraint_gatherer/ExplicitType: Fail ``` which isn't very actionable. With this CL it will also print the error, giving something like ``` [...]/pkg/front_end/lib/src/fasta/type_inference/type_constraint_gatherer.dart:136:5: No explicit type. var isMatch = _isNullabilityObliviousSubtypeMatch(subtype, supertype); ^^^ 1 failed: lint/front_end/lib/src/fasta/type_inference/type_constraint_gatherer/ExplicitType: Fail ``` which is actually actionable. Change-Id: I1e906a899b14678ae4f8625da6dc32d295a32ec6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352223 Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This commit is contained in:
parent
3d1f22a79b
commit
b2815eeb60
|
@ -195,17 +195,37 @@ class ErrorNotingLogger implements Logger {
|
|||
|
||||
@override
|
||||
void logUncaughtError(error, StackTrace stackTrace) {
|
||||
print("Uncaught Error: $error\n$stackTrace");
|
||||
gotFailure = true;
|
||||
}
|
||||
|
||||
// package:testing logs the result twice: As it happens and at the end.
|
||||
// I don't want that so for now I'll maintain a set of already reported
|
||||
// test results.
|
||||
Set<testing.Result> alreadyReportedResults = {};
|
||||
|
||||
@override
|
||||
void logUnexpectedResult(Suite suite, testing.TestDescription description,
|
||||
testing.Result result, Set<testing.Expectation> expectedOutcomes) {
|
||||
if (!alreadyReportedResults.add(result)) return;
|
||||
|
||||
String log = result.log;
|
||||
if (log.isNotEmpty) {
|
||||
print(log);
|
||||
}
|
||||
if (result.error != null) {
|
||||
print(result.error);
|
||||
if (result.trace != null) {
|
||||
print(result.trace);
|
||||
}
|
||||
}
|
||||
|
||||
gotFailure = true;
|
||||
}
|
||||
|
||||
@override
|
||||
void noticeFrameworkCatchError(error, StackTrace stackTrace) {
|
||||
print("Framework Catch Error: $error\n$StackTrace");
|
||||
gotFailure = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue