OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library server.performance.analysis.timing; | 5 library server.performance.analysis.timing; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:args/args.dart'; | 10 import 'package:args/args.dart'; |
11 import 'package:test/test.dart'; | 11 import 'package:test/test.dart'; |
12 | 12 |
13 import '../../test/utils.dart'; | |
14 import 'performance_tests.dart'; | 13 import 'performance_tests.dart'; |
15 | 14 |
16 /** | 15 /** |
17 * Pass in the directory of the source to be analyzed as option `--source`, | 16 * Pass in the directory of the source to be analyzed as option `--source`, |
18 * specify a priority file with `--priority` and an offset for completions | 17 * specify a priority file with `--priority` and an offset for completions |
19 * with a `--offset`. | 18 * with a `--offset`. |
20 */ | 19 */ |
21 main(List<String> arguments) { | 20 main(List<String> arguments) { |
22 initializeTestEnvironment(); | |
23 ArgParser parser = _createArgParser(); | 21 ArgParser parser = _createArgParser(); |
24 var args = parser.parse(arguments); | 22 var args = parser.parse(arguments); |
25 if (args[SOURCE_OPTION] == null) { | 23 if (args[SOURCE_OPTION] == null) { |
26 print('path to source directory must be specified'); | 24 print('path to source directory must be specified'); |
27 exit(1); | 25 exit(1); |
28 } | 26 } |
29 source = args[SOURCE_OPTION]; | 27 source = args[SOURCE_OPTION]; |
30 priorityFile = args[PRIORITY_FILE_OPTION]; | 28 priorityFile = args[PRIORITY_FILE_OPTION]; |
31 offset = int.parse(args[COMPLETION_OFFSET]); | 29 offset = int.parse(args[COMPLETION_OFFSET]); |
32 | 30 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 sendAnalysisSetPriorityFiles([priorityFile]); | 73 sendAnalysisSetPriorityFiles([priorityFile]); |
76 sendCompletionGetSuggestions(priorityFile, offset); | 74 sendCompletionGetSuggestions(priorityFile, offset); |
77 | 75 |
78 await analysisFinished; | 76 await analysisFinished; |
79 | 77 |
80 print('analysis completed in ${stopwatch.elapsed}'); | 78 print('analysis completed in ${stopwatch.elapsed}'); |
81 print('completion received at : $timings'); | 79 print('completion received at : $timings'); |
82 await shutdown(); | 80 await shutdown(); |
83 } | 81 } |
84 } | 82 } |
OLD | NEW |