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