| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 if (await fileExists(sdkUri, asyncSources)) { | 119 if (await fileExists(sdkUri, asyncSources)) { |
| 120 throw "Found '$asyncSources' in '$sdk', so it isn't a patched SDK. " | 120 throw "Found '$asyncSources' in '$sdk', so it isn't a patched SDK. " |
| 121 "$suggestion"; | 121 "$suggestion"; |
| 122 } | 122 } |
| 123 | 123 |
| 124 // TODO(karlklose): select the VM based on the mode. | 124 // TODO(karlklose): select the VM based on the mode. |
| 125 Uri vm = Uri.base.resolve("out/ReleaseX64/dart"); | 125 Uri vm = Uri.base.resolve("out/ReleaseX64/dart"); |
| 126 | 126 |
| 127 Uri packages = Uri.base.resolve(".packages"); | 127 Uri packages = Uri.base.resolve(".packages"); |
| 128 bool strongMode = false; | 128 bool strongMode = false; |
| 129 bool updateExpectations = environment["updateExpectations"] != "false"; | 129 bool updateExpectations = environment["updateExpectations"] == "true"; |
| 130 return new TestContext(sdk, vm, packages, strongMode, | 130 return new TestContext(sdk, vm, packages, strongMode, |
| 131 createDartSdk(sdk, strongMode: strongMode), updateExpectations); | 131 createDartSdk(sdk, strongMode: strongMode), updateExpectations); |
| 132 } | 132 } |
| 133 | 133 |
| 134 class Kernel extends Step<TestDescription, Program, TestContext> { | 134 class Kernel extends Step<TestDescription, Program, TestContext> { |
| 135 const Kernel(); | 135 const Kernel(); |
| 136 | 136 |
| 137 String get name => "kernel"; | 137 String get name => "kernel"; |
| 138 | 138 |
| 139 Future<Result<Program>> run( | 139 Future<Result<Program>> run( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 .run(context.vm.toFilePath(), [generated.path, "Hello, World!"]); | 186 .run(context.vm.toFilePath(), [generated.path, "Hello, World!"]); |
| 187 print(process.output); | 187 print(process.output); |
| 188 } finally { | 188 } finally { |
| 189 generated.parent.delete(recursive: true); | 189 generated.parent.delete(recursive: true); |
| 190 } | 190 } |
| 191 return process.toResult(); | 191 return process.toResult(); |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 | 194 |
| 195 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); | 195 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); |
| OLD | NEW |