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

Unified Diff: pkg/analysis_server/benchmark/perf/analysis_timing_test.dart

Issue 1366923003: add performance tests (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: move tests to benchmark Created 5 years, 3 months 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
« no previous file with comments | « no previous file | pkg/analysis_server/benchmark/perf/performance_tests.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/benchmark/perf/analysis_timing_test.dart
diff --git a/pkg/analysis_server/benchmark/perf/analysis_timing_test.dart b/pkg/analysis_server/benchmark/perf/analysis_timing_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..fd50e1364040614ff0158e9da8141002c7754bcd
--- /dev/null
+++ b/pkg/analysis_server/benchmark/perf/analysis_timing_test.dart
@@ -0,0 +1,59 @@
+// 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 server.performance.analysis.timing;
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:args/args.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../../test/utils.dart';
+import 'performance_tests.dart';
+
+const String SOURCE_OPTION = 'source';
+
+/**
+ * Pass in the directory of the source to be analyzed as option --source
+ */
+main(List<String> arguements) {
+ initializeTestEnvironment();
+ ArgParser parser = _createArgParser();
+ var args = parser.parse(arguements);
+ if (args[SOURCE_OPTION] == null) {
+ print('path to source directory must be specified');
+ exit(1);
+ }
+ source = args[SOURCE_OPTION];
+ defineReflectiveTests(AnalysisTimingIntegrationTest);
+}
+
+String source;
+
+@reflectiveTest
+class AnalysisTimingIntegrationTest
+ extends AbstractAnalysisServerPerformanceTest {
+ test_detect_analysis_done() {
+ sourceDirectory = new Directory(source);
+ subscribeToStatusNotifications();
+ return _runAndTimeAnalysis();
+ }
+
+ Future _runAndTimeAnalysis() {
+ stopwatch.start();
+ setAnalysisRoot();
+ return analysisFinished.then((_) {
+ print('analysis completed in ${stopwatch.elapsed}');
+ stopwatch.reset();
+ });
+ }
+}
+
+ArgParser _createArgParser() {
+ ArgParser parser = new ArgParser();
+ parser.addOption('source',
+ help: 'full path to source directory for analysis');
+ return parser;
+}
« no previous file with comments | « no previous file | pkg/analysis_server/benchmark/perf/performance_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698