Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: pkg/analyzer_cli/test/perf_report_test.dart

Issue 1524413002: Add --x-perf-report flag to the dartanalyzer command (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add a test Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer_cli/test/perf_report_test.dart
diff --git a/pkg/analyzer_cli/test/perf_report_test.dart b/pkg/analyzer_cli/test/perf_report_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c5707ac18b6977fbae18c1a7146685c34eb3c594
--- /dev/null
+++ b/pkg/analyzer_cli/test/perf_report_test.dart
@@ -0,0 +1,23 @@
+// 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.
+
+library analyzer_cli.test.perf_report;
+
+import 'dart:convert' show JSON;
+
+import 'package:unittest/unittest.dart';
+
+import 'package:analyzer_cli/src/options.dart';
+import 'package:analyzer_cli/src/perf_report.dart';
+
+main() {
+ test('makePerfReport', () {
+ var options = CommandLineOptions.parse(["somefile.dart"]);
+ var encoded = makePerfReport(1000, 1234, options);
+
+ var json = JSON.decode(encoded);
+ expect(json['totalElapsedTime'], 234);
+ expect(json['options']['sourceFiles'], ["somefile.dart"]);
+ });
+}
« pkg/analyzer_cli/lib/src/perf_report.dart ('K') | « pkg/analyzer_cli/test/all.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698