Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 Directory, File, Platform; | 9 import 'dart:io' show Directory, File, Platform; |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 const Kernel(), | 57 const Kernel(), |
| 58 const Print(), | 58 const Print(), |
| 59 const SanityCheck(), | 59 const SanityCheck(), |
| 60 const ClosureConversion(), | 60 const ClosureConversion(), |
| 61 const Print(), | 61 const Print(), |
| 62 const SanityCheck(), | 62 const SanityCheck(), |
| 63 new MatchExpectation(".expect", | 63 new MatchExpectation(".expect", |
| 64 updateExpectations: updateExpectations), | 64 updateExpectations: updateExpectations), |
| 65 const WriteDill(), | 65 const WriteDill(), |
| 66 const ReadDill(), | 66 const ReadDill(), |
| 67 const Run(), | 67 // TODO(dmitryas): uncomment this when Vectors are added to VM. |
|
karlklose
2017/03/22 14:34:19
Maybe file a bug and reference its number in the T
Dmitry Stefantsov
2017/03/23 11:22:43
Good idea! Done.
| |
| 68 //const Run(), | |
| 68 ]; | 69 ]; |
| 69 | 70 |
| 70 Future<DartLoader> createLoader() async { | 71 Future<DartLoader> createLoader() async { |
| 71 Program repository = new Program(); | 72 Program repository = new Program(); |
| 72 return new DartLoader(repository, options, await loadPackagesFile(packages), | 73 return new DartLoader(repository, options, await loadPackagesFile(packages), |
| 73 dartSdk: dartSdk); | 74 dartSdk: dartSdk); |
| 74 } | 75 } |
| 75 } | 76 } |
| 76 | 77 |
| 77 enum Environment { | 78 enum Environment { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 if (await fileExists(sdkUri, asyncSources)) { | 118 if (await fileExists(sdkUri, asyncSources)) { |
| 118 throw "Found '$asyncSources' in '$sdk', so it isn't a patched SDK. " | 119 throw "Found '$asyncSources' in '$sdk', so it isn't a patched SDK. " |
| 119 "$suggestion"; | 120 "$suggestion"; |
| 120 } | 121 } |
| 121 | 122 |
| 122 // TODO(karlklose): select the VM based on the mode. | 123 // TODO(karlklose): select the VM based on the mode. |
| 123 Uri vm = Uri.base.resolve("out/ReleaseX64/dart"); | 124 Uri vm = Uri.base.resolve("out/ReleaseX64/dart"); |
| 124 | 125 |
| 125 Uri packages = Uri.base.resolve(".packages"); | 126 Uri packages = Uri.base.resolve(".packages"); |
| 126 bool strongMode = false; | 127 bool strongMode = false; |
| 127 bool updateExpectations = environment["updateExpectations"] == "true"; | 128 bool updateExpectations = const String.fromEnvironment("updateExpectations", |
| 129 defaultValue: "false") == | |
| 130 "true"; | |
| 128 return new TestContext(sdk, vm, packages, strongMode, | 131 return new TestContext(sdk, vm, packages, strongMode, |
| 129 createDartSdk(sdk, strongMode: strongMode), updateExpectations); | 132 createDartSdk(sdk, strongMode: strongMode), updateExpectations); |
| 130 } | 133 } |
| 131 | 134 |
| 132 class Kernel extends Step<TestDescription, Program, TestContext> { | 135 class Kernel extends Step<TestDescription, Program, TestContext> { |
| 133 const Kernel(); | 136 const Kernel(); |
| 134 | 137 |
| 135 String get name => "kernel"; | 138 String get name => "kernel"; |
| 136 | 139 |
| 137 Future<Result<Program>> run( | 140 Future<Result<Program>> run( |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 .run(context.vm.toFilePath(), [generated.path, "Hello, World!"]); | 188 .run(context.vm.toFilePath(), [generated.path, "Hello, World!"]); |
| 186 print(process.output); | 189 print(process.output); |
| 187 } finally { | 190 } finally { |
| 188 generated.parent.delete(recursive: true); | 191 generated.parent.delete(recursive: true); |
| 189 } | 192 } |
| 190 return process.toResult(); | 193 return process.toResult(); |
| 191 } | 194 } |
| 192 } | 195 } |
| 193 | 196 |
| 194 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); | 197 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); |
| OLD | NEW |