| 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 'package:front_end/physical_file_system.dart'; | 9 import 'package:front_end/physical_file_system.dart'; |
| 10 import 'package:testing/testing.dart' | 10 import 'package:testing/testing.dart' |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 extends Step<TestDescription, Program, ClosureConversionContext> { | 86 extends Step<TestDescription, Program, ClosureConversionContext> { |
| 87 const FastaCompile(); | 87 const FastaCompile(); |
| 88 | 88 |
| 89 String get name => "fasta compilation"; | 89 String get name => "fasta compilation"; |
| 90 | 90 |
| 91 Future<Result<Program>> run( | 91 Future<Result<Program>> run( |
| 92 TestDescription description, ClosureConversionContext context) async { | 92 TestDescription description, ClosureConversionContext context) async { |
| 93 Program platform = await context.loadPlatform(); | 93 Program platform = await context.loadPlatform(); |
| 94 Ticker ticker = new Ticker(); | 94 Ticker ticker = new Ticker(); |
| 95 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator); | 95 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator); |
| 96 dillTarget.loader | 96 dillTarget.loader.appendLibraries(platform); |
| 97 ..input = Uri.parse("org.dartlang:platform") // Make up a name. | |
| 98 ..setProgram(platform); | |
| 99 KernelTarget sourceTarget = new KernelTarget(PhysicalFileSystem.instance, | 97 KernelTarget sourceTarget = new KernelTarget(PhysicalFileSystem.instance, |
| 100 dillTarget, context.uriTranslator, context.strongMode); | 98 dillTarget, context.uriTranslator, context.strongMode); |
| 101 | 99 |
| 102 Program p; | 100 Program p; |
| 103 try { | 101 try { |
| 104 sourceTarget.read(description.uri); | 102 sourceTarget.read(description.uri); |
| 105 await dillTarget.writeOutline(null); | 103 await dillTarget.writeOutline(null); |
| 106 await sourceTarget.writeOutline(null); | 104 await sourceTarget.writeOutline(null); |
| 107 p = await sourceTarget.writeProgram(null); | 105 p = await sourceTarget.writeProgram(null); |
| 108 } on InputError catch (e, s) { | 106 } on InputError catch (e, s) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 123 try { | 121 try { |
| 124 program = closure_conversion.transformProgram(program); | 122 program = closure_conversion.transformProgram(program); |
| 125 return pass(program); | 123 return pass(program); |
| 126 } catch (e, s) { | 124 } catch (e, s) { |
| 127 return crash(e, s); | 125 return crash(e, s); |
| 128 } | 126 } |
| 129 } | 127 } |
| 130 } | 128 } |
| 131 | 129 |
| 132 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); | 130 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); |
| OLD | NEW |