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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library test.kernel.closures.suite; | 5 library test.kernel.closures.suite; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import 'dart:io' show File; | 9 import 'dart:io' show File; |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 class FastaCompile extends Step<TestDescription, Program, InterpreterContext> { | 69 class FastaCompile extends Step<TestDescription, Program, InterpreterContext> { |
70 const FastaCompile(); | 70 const FastaCompile(); |
71 | 71 |
72 String get name => "fasta compile"; | 72 String get name => "fasta compile"; |
73 | 73 |
74 Future<Result<Program>> run( | 74 Future<Result<Program>> run( |
75 TestDescription description, InterpreterContext context) async { | 75 TestDescription description, InterpreterContext context) async { |
76 Program platform = await context.loadPlatform(); | 76 Program platform = await context.loadPlatform(); |
77 Ticker ticker = new Ticker(); | 77 Ticker ticker = new Ticker(); |
78 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator); | 78 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator); |
79 dillTarget.loader | 79 dillTarget.loader.appendLibraries(platform); |
80 ..input = Uri.parse("org.dartlang:platform") // Make up a name. | |
81 ..setProgram(platform); | |
82 KernelTarget sourceTarget = new KernelTarget(PhysicalFileSystem.instance, | 80 KernelTarget sourceTarget = new KernelTarget(PhysicalFileSystem.instance, |
83 dillTarget, context.uriTranslator, context.strongMode); | 81 dillTarget, context.uriTranslator, context.strongMode); |
84 | 82 |
85 Program p; | 83 Program p; |
86 try { | 84 try { |
87 sourceTarget.read(description.uri); | 85 sourceTarget.read(description.uri); |
88 await dillTarget.writeOutline(null); | 86 await dillTarget.writeOutline(null); |
89 await sourceTarget.writeOutline(null); | 87 await sourceTarget.writeOutline(null); |
90 p = await sourceTarget.writeProgram(null); | 88 p = await sourceTarget.writeProgram(null); |
91 } on InputError catch (e, s) { | 89 } on InputError catch (e, s) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 final Uri uri; | 147 final Uri uri; |
150 | 148 |
151 /// Evaluated program log. | 149 /// Evaluated program log. |
152 final String log; | 150 final String log; |
153 | 151 |
154 EvaluationLog(this.uri, this.log); | 152 EvaluationLog(this.uri, this.log); |
155 } | 153 } |
156 | 154 |
157 main(List<String> arguments) => | 155 main(List<String> arguments) => |
158 runMe(arguments, InterpreterContext.create, "testing.json"); | 156 runMe(arguments, InterpreterContext.create, "testing.json"); |
OLD | NEW |