Index: pkg/analysis_server/benchmark/perf/completion_timing_tests.dart |
diff --git a/pkg/analysis_server/benchmark/perf/completion_timing_tests.dart b/pkg/analysis_server/benchmark/perf/completion_timing_tests.dart |
index 6acd038f3581f7d82b56bac2d69e80f811ebddbf..0a1204195b9adc52dfbf1f01ee6cd5aaf175716e 100644 |
--- a/pkg/analysis_server/benchmark/perf/completion_timing_tests.dart |
+++ b/pkg/analysis_server/benchmark/perf/completion_timing_tests.dart |
@@ -10,32 +10,31 @@ import 'package:test/test.dart'; |
import 'performance_tests.dart'; |
+const COMPLETION_OFFSET = 'offset'; |
+const PRIORITY_FILE_OPTION = 'priority'; |
+const SOURCE_OPTION = 'source'; |
+ |
/** |
* Pass in the directory of the source to be analyzed as option `--source`, |
* specify a priority file with `--priority` and an offset for completions |
* with a `--offset`. |
*/ |
-main(List<String> arguments) { |
+main(List<String> arguments) async { |
ArgParser parser = _createArgParser(); |
var args = parser.parse(arguments); |
if (args[SOURCE_OPTION] == null) { |
print('path to source directory must be specified'); |
exit(1); |
} |
- source = args[SOURCE_OPTION]; |
- priorityFile = args[PRIORITY_FILE_OPTION]; |
- offset = int.parse(args[COMPLETION_OFFSET]); |
- |
- Future.wait([new CompletionTimingTest().test_timing()]); |
-} |
-const COMPLETION_OFFSET = 'offset'; |
-const PRIORITY_FILE_OPTION = 'priority'; |
-const SOURCE_OPTION = 'source'; |
+ int offset = int.parse(args[COMPLETION_OFFSET]); |
+ String priorityFile = args[PRIORITY_FILE_OPTION]; |
+ String source = args[SOURCE_OPTION]; |
-int offset; |
-String priorityFile; |
-String source; |
+ CompletionTimingTest test = |
+ new CompletionTimingTest(offset, priorityFile, source); |
+ await test.test_timing(); |
+} |
ArgParser _createArgParser() => new ArgParser() |
..addOption(SOURCE_OPTION, help: 'full path to source directory for analysis') |
@@ -50,8 +49,14 @@ ArgParser _createArgParser() => new ArgParser() |
* completions. |
*/ |
class CompletionTimingTest extends AbstractTimingTest { |
+ final int offset; |
+ final String priorityFile; |
+ final String source; |
+ |
List<Duration> timings = <Duration>[]; |
+ CompletionTimingTest(this.offset, this.priorityFile, this.source); |
+ |
Future test_timing() async { |
// debugStdio(); |