941d2a7148
run.sh now records flutter's JSON results beside the log and prints a summary from tool/memwatch/summary.dart: one verdict line (pass/fail/skip counts, peak MB, duration, exit status), only failing tests with their error and app stack frames (framework frames dropped, per-test and total caps, tail of printed output), the tests still running when killed, and the log and JSON paths. Quiet is the default when stdout is not a terminal; MEMWATCH_OUTPUT=full also prints the whole log. The watchdog loop and exit status are unchanged. tool/analyze.sh bounds flutter analyze to a verdict line and the first 40 issues. Tests: test/tool/memwatch/summary_test.dart and the end-to-end tool/memwatch/quiet_test.sh over fixture suites.
23 lines
831 B
Dart
23 lines
831 B
Dart
// Fixture for tool/memwatch/quiet_test.sh: one passing test, one plain
|
|
// expectation failure and one widget-test failure that prints far more than
|
|
// the quiet summary may show. It lives outside test/ so the app suite skips it.
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
test('passing neighbour', () => expect(1, 1));
|
|
|
|
test('plain expectation fails', () {
|
|
expect('memwatch-actual', 'memwatch-expected');
|
|
});
|
|
|
|
testWidgets('widget failure with long output', (tester) async {
|
|
for (var i = 0; i < 2000; i++) {
|
|
// ignore: avoid_print
|
|
print('memwatch-flood line $i ${'x' * 60}');
|
|
}
|
|
await tester.pumpWidget(const Text('memwatch', textDirection: TextDirection.ltr));
|
|
expect(find.text('memwatch-missing-widget'), findsOneWidget);
|
|
});
|
|
}
|