| 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 | 17 import 'package:compiler/src/source_file_provider.dart' show |
| 18 FormattingDiagnosticHandler; | 18 FormattingDiagnosticHandler; |
| 19 | 19 |
| 20 import '../memory_source_file_helper.dart' show | 20 import '../memory_source_file_helper.dart' show |
| 21 Compiler; | 21 CompilerImpl; |
| 22 | 22 |
| 23 import '../memory_compiler.dart' show | 23 import '../memory_compiler.dart' show |
| 24 compilerFor; | 24 compilerFor; |
| 25 | 25 |
| 26 const bool verbose = false; | 26 const bool verbose = false; |
| 27 | 27 |
| 28 main(List<String> arguments) { | 28 main(List<String> arguments) { |
| 29 Stopwatch sw = new Stopwatch()..start(); | 29 Stopwatch sw = new Stopwatch()..start(); |
| 30 Map<String, String> sources = <String, String>{}; | 30 Map<String, String> sources = <String, String>{}; |
| 31 for (String argument in arguments) { | 31 for (String argument in arguments) { |
| 32 Uri uri = new Uri(scheme: 'memory', path: argument); | 32 Uri uri = new Uri(scheme: 'memory', path: argument); |
| 33 String source = | 33 String source = |
| 34 new File.fromUri(Uri.base.resolve(argument)).readAsStringSync(); | 34 new File.fromUri(Uri.base.resolve(argument)).readAsStringSync(); |
| 35 sources['${uri.path}'] = source; | 35 sources['${uri.path}'] = source; |
| 36 } | 36 } |
| 37 sw.stop(); | 37 sw.stop(); |
| 38 print(sw.elapsedMilliseconds); | 38 print(sw.elapsedMilliseconds); |
| 39 compileTests(sources); | 39 compileTests(sources); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void compileTests(Map<String, String> sources) { | 42 void compileTests(Map<String, String> sources) { |
| 43 int testCount = 0; | 43 int testCount = 0; |
| 44 int skipCount = 0; | 44 int skipCount = 0; |
| 45 Set<String> crashes = new Set<String>(); | 45 Set<String> crashes = new Set<String>(); |
| 46 Compiler memoryCompiler = compilerFor(memorySourceFiles: sources); | 46 CompilerImpl memoryCompiler = compilerFor(memorySourceFiles: sources); |
| 47 FormattingDiagnosticHandler handler = memoryCompiler.handler; | 47 FormattingDiagnosticHandler handler = memoryCompiler.handler; |
| 48 handler.verbose = verbose; | 48 handler.verbose = verbose; |
| 49 var options = ['--analyze-main']; | 49 var options = ['--analyze-main']; |
| 50 if (true || verbose) options.add('--verbose'); | 50 if (true || verbose) options.add('--verbose'); |
| 51 IncrementalCompiler compiler = new IncrementalCompiler( | 51 IncrementalCompiler compiler = new IncrementalCompiler( |
| 52 libraryRoot: memoryCompiler.libraryRoot, | 52 libraryRoot: memoryCompiler.libraryRoot, |
| 53 inputProvider: memoryCompiler.provider, | 53 inputProvider: memoryCompiler.provider, |
| 54 outputProvider: memoryCompiler.userOutputProvider, | 54 outputProvider: memoryCompiler.userOutputProvider, |
| 55 diagnosticHandler: memoryCompiler.handler, | 55 diagnosticHandler: memoryCompiler.handler, |
| 56 packageRoot: memoryCompiler.packageRoot, | 56 packageRoot: memoryCompiler.packageRoot, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 "/language/setter_declaration2_negative_test.dart", | 169 "/language/setter_declaration2_negative_test.dart", |
| 170 "/language/source_self_negative_test.dart", | 170 "/language/source_self_negative_test.dart", |
| 171 "/language/syntax_test.dart", | 171 "/language/syntax_test.dart", |
| 172 "/language/type_variable_bounds2_test.dart", | 172 "/language/type_variable_bounds2_test.dart", |
| 173 "/language/type_variable_conflict2_test.dart", | 173 "/language/type_variable_conflict2_test.dart", |
| 174 "/language/type_variable_field_initializer_test.dart", | 174 "/language/type_variable_field_initializer_test.dart", |
| 175 "/language/type_variable_nested_test.dart", | 175 "/language/type_variable_nested_test.dart", |
| 176 "/language/vm/reflect_core_vm_test.dart", | 176 "/language/vm/reflect_core_vm_test.dart", |
| 177 "/language/vm/regress_14903_test.dart", | 177 "/language/vm/regress_14903_test.dart", |
| 178 ]); | 178 ]); |
| OLD | NEW |