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

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

Issue 1393693003: add completion tests (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: remove unused code Created 5 years, 2 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/completion_timing_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_tests.dart
diff --git a/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart b/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
index a738396333c490cb8ff9fec005636b7a4df24e6e..5ebac444b220341380ac4fe51152969607aa72d6 100644
--- a/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
+++ b/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
@@ -18,7 +18,7 @@ import 'performance_tests.dart';
/**
* Pass in the directory of the source to be analyzed as option `--source`,
* optionally specify a priority file with `--priority` and the specific
- * test to run with `--test`. If no test is specified, the default is
+ * test to run with `--metric`. If no test is specified, the default is
* `analysis`.
*/
main(List<String> arguments) {
@@ -31,11 +31,14 @@ main(List<String> arguments) {
}
source = args[SOURCE_OPTION];
priorityFile = args[PRIORITY_FILE_OPTION];
- var metricNameParam = args[METRIC_NAME_OPTION] ?? DEFAULT_METRIC;
+ metricNames.addAll(args[METRIC_NAME_OPTION]);
+ unittestConfiguration.timeout = new Duration(minutes: 20);
- metricNames.addAll(metricNameParam);
-
- defineReflectiveTests(TimingTest);
+ if (metricNames.isEmpty) {
+ defineReflectiveTests(AnalysisTimingTest);
+ } else {
+ defineReflectiveTests(SubscriptionTimingTest);
+ }
}
const DEFAULT_METRIC = 'analysis';
@@ -62,6 +65,20 @@ class AbstractTimingTest extends AbstractAnalysisServerPerformanceTest {
});
}
+@reflectiveTest
+class AnalysisTimingTest extends AbstractTimingTest {
+ Future test_timing() {
+ // Set root after subscribing to avoid empty notifications.
+ setAnalysisRoot();
+
+ stopwatch.start();
+ return analysisFinished.then((_) {
+ print('analysis completed in ${stopwatch.elapsed}');
+ stopwatch.reset();
+ });
+ }
+}
+
class Metric {
List<Duration> timings = <Duration>[];
Stream eventStream;
@@ -72,7 +89,7 @@ class Metric {
}
@reflectiveTest
-class TimingTest extends AbstractTimingTest {
+class SubscriptionTimingTest extends AbstractTimingTest {
List<Metric> _metrics;
List<Metric> get metrics =>
@@ -105,7 +122,7 @@ class TimingTest extends AbstractTimingTest {
}
Future test_timing() {
- //debugStdio();
+// debugStdio();
expect(metrics, isNotEmpty);
expect(priorityFile, isNotNull,
« no previous file with comments | « no previous file | pkg/analysis_server/benchmark/perf/completion_timing_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698