OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // Helper file that can be used to manually test the stability of incremental | 5 // Helper file that can be used to manually test the stability of incremental |
6 // compilation. Currently this test is not run automatically. | 6 // compilation. Currently this test is not run automatically. |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 | 9 |
10 import 'dart:io'; | 10 import 'dart:io'; |
11 | 11 |
12 import 'dart:developer' show | 12 import 'dart:developer' show |
13 UserTag; | 13 UserTag; |
14 | 14 |
15 import 'package:dart2js_incremental/dart2js_incremental.dart' show | 15 import 'package:dart2js_incremental/dart2js_incremental.dart' show |
16 IncrementalCompiler; | 16 IncrementalCompiler; |
| 17 import 'package:compiler/src/source_file_provider.dart' show |
| 18 FormattingDiagnosticHandler; |
17 | 19 |
18 import '../memory_source_file_helper.dart' show | 20 import '../memory_source_file_helper.dart' show |
19 Compiler; | 21 Compiler; |
20 | 22 |
21 import '../memory_compiler.dart' show | 23 import '../memory_compiler.dart' show |
22 compilerFor; | 24 compilerFor; |
23 | 25 |
24 const bool verbose = false; | 26 const bool verbose = false; |
25 | 27 |
26 main(List<String> arguments) { | 28 main(List<String> arguments) { |
27 Stopwatch sw = new Stopwatch()..start(); | 29 Stopwatch sw = new Stopwatch()..start(); |
28 Map<String, String> sources = <String, String>{}; | 30 Map<String, String> sources = <String, String>{}; |
29 for (String argument in arguments) { | 31 for (String argument in arguments) { |
30 Uri uri = new Uri(scheme: 'memory', path: argument); | 32 Uri uri = new Uri(scheme: 'memory', path: argument); |
31 String source = | 33 String source = |
32 new File.fromUri(Uri.base.resolve(argument)).readAsStringSync(); | 34 new File.fromUri(Uri.base.resolve(argument)).readAsStringSync(); |
33 sources['${uri.path}'] = source; | 35 sources['${uri.path}'] = source; |
34 } | 36 } |
35 sw.stop(); | 37 sw.stop(); |
36 print(sw.elapsedMilliseconds); | 38 print(sw.elapsedMilliseconds); |
37 compileTests(sources); | 39 compileTests(sources); |
38 } | 40 } |
39 | 41 |
40 void compileTests(Map<String, String> sources) { | 42 void compileTests(Map<String, String> sources) { |
41 int testCount = 0; | 43 int testCount = 0; |
42 int skipCount = 0; | 44 int skipCount = 0; |
43 Set<String> crashes = new Set<String>(); | 45 Set<String> crashes = new Set<String>(); |
44 Compiler memoryCompiler = compilerFor(sources); | 46 Compiler memoryCompiler = compilerFor(sources); |
45 memoryCompiler.handler.verbose = verbose; | 47 FormattingDiagnosticHandler handler = memoryCompiler.handler; |
| 48 handler.verbose = verbose; |
46 var options = ['--analyze-main']; | 49 var options = ['--analyze-main']; |
47 if (true || verbose) options.add('--verbose'); | 50 if (true || verbose) options.add('--verbose'); |
48 IncrementalCompiler compiler = new IncrementalCompiler( | 51 IncrementalCompiler compiler = new IncrementalCompiler( |
49 libraryRoot: memoryCompiler.libraryRoot, | 52 libraryRoot: memoryCompiler.libraryRoot, |
50 inputProvider: memoryCompiler.provider, | 53 inputProvider: memoryCompiler.provider, |
51 outputProvider: memoryCompiler.outputProvider, | 54 outputProvider: memoryCompiler.userOutputProvider, |
52 diagnosticHandler: memoryCompiler.handler, | 55 diagnosticHandler: memoryCompiler.handler, |
53 packageRoot: memoryCompiler.packageRoot, | 56 packageRoot: memoryCompiler.packageRoot, |
54 options: options); | 57 options: options); |
55 Future.forEach(sources.keys, (String path) { | 58 Future.forEach(sources.keys, (String path) { |
56 UserTag.defaultTag.makeCurrent(); | 59 UserTag.defaultTag.makeCurrent(); |
57 if (!path.endsWith('_test.dart')) return new Future.value(null); | 60 if (!path.endsWith('_test.dart')) return new Future.value(null); |
58 testCount++; | 61 testCount++; |
59 for (String brokenTest in brokenTests) { | 62 for (String brokenTest in brokenTests) { |
60 if (path.endsWith(brokenTest)) { | 63 if (path.endsWith(brokenTest)) { |
61 print('Skipped broken test $path'); | 64 print('Skipped broken test $path'); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 "/language/setter_declaration2_negative_test.dart", | 169 "/language/setter_declaration2_negative_test.dart", |
167 "/language/source_self_negative_test.dart", | 170 "/language/source_self_negative_test.dart", |
168 "/language/syntax_test.dart", | 171 "/language/syntax_test.dart", |
169 "/language/type_variable_bounds2_test.dart", | 172 "/language/type_variable_bounds2_test.dart", |
170 "/language/type_variable_conflict2_test.dart", | 173 "/language/type_variable_conflict2_test.dart", |
171 "/language/type_variable_field_initializer_test.dart", | 174 "/language/type_variable_field_initializer_test.dart", |
172 "/language/type_variable_nested_test.dart", | 175 "/language/type_variable_nested_test.dart", |
173 "/language/vm/reflect_core_vm_test.dart", | 176 "/language/vm/reflect_core_vm_test.dart", |
174 "/language/vm/regress_14903_test.dart", | 177 "/language/vm/regress_14903_test.dart", |
175 ]); | 178 ]); |
OLD | NEW |