| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /* | 5 /* |
| 6 * This test makes sure that the "skipping Dart2Js compilations if the output is | 6 * This test makes sure that the "skipping Dart2Js compilations if the output is |
| 7 * already up to date" feature does work as it should. | 7 * already up to date" feature does work as it should. |
| 8 * Therefore this test ensures that compilations are only skipped if the last | 8 * Therefore this test ensures that compilations are only skipped if the last |
| 9 * modified date of the output of a dart2js compilation is newer than | 9 * modified date of the output of a dart2js compilation is newer than |
| 10 * - the the dart application to compile (including it's dependencies) | 10 * - the the dart application to compile (including it's dependencies) |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 .existsSync()); | 139 .existsSync()); |
| 140 } else { | 140 } else { |
| 141 Expect.isFalse(new File(fileUtils.scriptOutputPath.toNativePath()) | 141 Expect.isFalse(new File(fileUtils.scriptOutputPath.toNativePath()) |
| 142 .existsSync()); | 142 .existsSync()); |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 runner.TestCase makeTestCase(String testName, FileUtils fileUtils) { | 147 runner.TestCase makeTestCase(String testName, FileUtils fileUtils) { |
| 148 var config = new options.TestOptionsParser().parse(['--timeout', '2'])[0]; | 148 var config = new options.TestOptionsParser().parse(['--timeout', '2'])[0]; |
| 149 var scriptDirPath = new Path(new Options().script).directoryPath; | 149 var scriptDirPath = new Path(Platform.script).directoryPath; |
| 150 var createFileScript = scriptDirPath. | 150 var createFileScript = scriptDirPath. |
| 151 append('skipping_dart2js_compilations_helper.dart').toNativePath(); | 151 append('skipping_dart2js_compilations_helper.dart').toNativePath(); |
| 152 var executable = new Options().executable; | 152 var executable = Platform.executable; |
| 153 var arguments = [createFileScript, fileUtils.scriptOutputPath.toNativePath()]; | 153 var arguments = [createFileScript, fileUtils.scriptOutputPath.toNativePath()]; |
| 154 var bootstrapDeps = [ | 154 var bootstrapDeps = [ |
| 155 Uri.parse("file://${fileUtils.testSnapshotFilePath}")]; | 155 Uri.parse("file://${fileUtils.testSnapshotFilePath}")]; |
| 156 var commands = [new runner.CompilationCommand( | 156 var commands = [new runner.CompilationCommand( |
| 157 fileUtils.testJsFilePath.toNativePath(), | 157 fileUtils.testJsFilePath.toNativePath(), |
| 158 false, | 158 false, |
| 159 bootstrapDeps, | 159 bootstrapDeps, |
| 160 executable, | 160 executable, |
| 161 arguments)]; | 161 arguments)]; |
| 162 return new runner.TestCase( | 162 return new runner.TestCase( |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 cleanup(); | 240 cleanup(); |
| 241 throw error; | 241 throw error; |
| 242 }).then((_) { | 242 }).then((_) { |
| 243 cleanup(); | 243 cleanup(); |
| 244 }); | 244 }); |
| 245 } | 245 } |
| 246 // We need to wait some time to make sure that the files we 'touch' get a | 246 // We need to wait some time to make sure that the files we 'touch' get a |
| 247 // bigger timestamp than the old ones | 247 // bigger timestamp than the old ones |
| 248 new Timer(new Duration(seconds: 1), touchFilesAndRunTests); | 248 new Timer(new Duration(seconds: 1), touchFilesAndRunTests); |
| 249 } | 249 } |
| OLD | NEW |