| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async' show Future; | 5 import 'dart:async' show Future; |
| 6 | 6 |
| 7 import 'dart:io' show Directory, File, Platform; | 7 import 'dart:io' show Directory, File, Platform; |
| 8 | 8 |
| 9 import 'dart:isolate' show Isolate; |
| 10 |
| 9 import 'package:async_helper/async_helper.dart' show asyncEnd, asyncStart; | 11 import 'package:async_helper/async_helper.dart' show asyncEnd, asyncStart; |
| 10 | 12 |
| 11 import 'package:front_end/src/fasta/testing/patched_sdk_location.dart' | 13 import 'package:front_end/src/fasta/testing/patched_sdk_location.dart' |
| 12 show computePatchedSdk; | 14 show computePatchedSdk; |
| 13 | 15 |
| 14 import 'package:testing/testing.dart' show StdioProcess; | 16 import 'package:testing/testing.dart' show StdioProcess; |
| 15 | 17 |
| 16 import 'package:kernel/binary/ast_from_binary.dart' show BinaryBuilder; | 18 import 'package:kernel/binary/ast_from_binary.dart' show BinaryBuilder; |
| 17 | 19 |
| 18 import 'package:kernel/ast.dart' show Program; | 20 import 'package:kernel/ast.dart' show Program; |
| 19 | 21 |
| 20 import 'package:kernel/text/ast_to_text.dart' show programToString; | 22 import 'package:kernel/text/ast_to_text.dart' show programToString; |
| 21 | 23 |
| 22 Future main() async { | 24 Future main() async { |
| 23 asyncStart(); | 25 asyncStart(); |
| 24 Uri sourceCompiler = | 26 Uri sourceCompiler = |
| 25 Uri.base.resolve("pkg/front_end/tool/_fasta/compile.dart"); | 27 Uri.base.resolve("pkg/front_end/tool/_fasta/compile.dart"); |
| 26 Uri outline = Uri.base.resolve("pkg/front_end/tool/_fasta/outline.dart"); | 28 Uri outline = Uri.base.resolve("pkg/front_end/tool/_fasta/outline.dart"); |
| 29 Uri packages = await Isolate.packageConfig; |
| 27 Directory tmp = await Directory.systemTemp.createTemp("fasta_bootstrap"); | 30 Directory tmp = await Directory.systemTemp.createTemp("fasta_bootstrap"); |
| 28 Uri compiledOnceOutput = tmp.uri.resolve("fasta1.dill"); | 31 Uri compiledOnceOutput = tmp.uri.resolve("fasta1.dill"); |
| 29 Uri compiledTwiceOutput = tmp.uri.resolve("fasta2.dill"); | 32 Uri compiledTwiceOutput = tmp.uri.resolve("fasta2.dill"); |
| 30 Uri outlineOutput = tmp.uri.resolve("outline.dill"); | 33 Uri outlineOutput = tmp.uri.resolve("outline.dill"); |
| 31 try { | 34 try { |
| 32 await runCompiler(sourceCompiler, sourceCompiler, compiledOnceOutput); | 35 await runCompiler(sourceCompiler, sourceCompiler, compiledOnceOutput); |
| 33 await runCompiler(compiledOnceOutput, sourceCompiler, compiledTwiceOutput); | 36 await runCompiler(compiledOnceOutput, sourceCompiler, compiledTwiceOutput); |
| 34 await compare(compiledOnceOutput, compiledTwiceOutput); | 37 await compare(compiledOnceOutput, compiledTwiceOutput); |
| 35 await runCompiler(compiledTwiceOutput, outline, outlineOutput); | 38 await runCompiler(compiledTwiceOutput, outline, outlineOutput); |
| 36 try { | 39 try { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 106 } |
| 104 | 107 |
| 105 class ComparisonFailed { | 108 class ComparisonFailed { |
| 106 final Uri a; | 109 final Uri a; |
| 107 final Uri b; | 110 final Uri b; |
| 108 | 111 |
| 109 ComparisonFailed(this.a, this.b); | 112 ComparisonFailed(this.a, this.b); |
| 110 | 113 |
| 111 toString() => "Error: $a is different from $b"; | 114 toString() => "Error: $a is different from $b"; |
| 112 } | 115 } |
| OLD | NEW |