Files
sdk/pkg/analyzer_cli/test/perf_report_test.dart
T
pq 4f5aacfd90 [CQ] bump analyzer_cli to 3.7 and tall-style re-format
Change-Id: Ic0e1e33da71036800432aa3dae8df22dbef8a460
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404343
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-14 16:40:21 -08:00

26 lines
935 B
Dart

// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:convert' show json;
import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer_cli/src/error_formatter.dart' show AnalysisStats;
import 'package:analyzer_cli/src/options.dart';
import 'package:analyzer_cli/src/perf_report.dart';
import 'package:test/test.dart';
void main() {
test('makePerfReport', () {
var options =
CommandLineOptions.parse(PhysicalResourceProvider.INSTANCE, [
'somefile.dart',
])!;
var encoded = makePerfReport(1000, 1234, options, 0, AnalysisStats());
var jsonData = json.decode(encoded);
expect(jsonData['totalElapsedTime'], 234);
expect(jsonData['options']['sourceFiles'], ['somefile.dart']);
});
}