| 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 20 matching lines...) Expand all Loading... |
| 31 Directory tempDir; | 31 Directory tempDir; |
| 32 File testJs; | 32 File testJs; |
| 33 File testJsDeps; | 33 File testJsDeps; |
| 34 File testDart; | 34 File testDart; |
| 35 File testSnapshot; | 35 File testSnapshot; |
| 36 | 36 |
| 37 FileUtils({bool createJs, | 37 FileUtils({bool createJs, |
| 38 bool createJsDeps, | 38 bool createJsDeps, |
| 39 bool createDart, | 39 bool createDart, |
| 40 bool createSnapshot}) { | 40 bool createSnapshot}) { |
| 41 tempDir = new Directory('').createTempSync(); | 41 tempDir = Directory.systemTemp |
| 42 .createTempSync('dart_skipping_dart2js_compilations'); |
| 42 if (createJs) { | 43 if (createJs) { |
| 43 testJs = _createFile(testJsFilePath); | 44 testJs = _createFile(testJsFilePath); |
| 44 _writeToFile(testJs, "test.js content"); | 45 _writeToFile(testJs, "test.js content"); |
| 45 } | 46 } |
| 46 if (createSnapshot) { | 47 if (createSnapshot) { |
| 47 testSnapshot = _createFile(testSnapshotFilePath); | 48 testSnapshot = _createFile(testSnapshotFilePath); |
| 48 _writeToFile(testSnapshot, "dart2js snapshot"); | 49 _writeToFile(testSnapshot, "dart2js snapshot"); |
| 49 } | 50 } |
| 50 if (createDart) { | 51 if (createDart) { |
| 51 testDart = _createFile(testDartFilePath); | 52 testDart = _createFile(testDartFilePath); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 cleanup(); | 235 cleanup(); |
| 235 throw error; | 236 throw error; |
| 236 }).then((_) { | 237 }).then((_) { |
| 237 cleanup(); | 238 cleanup(); |
| 238 }); | 239 }); |
| 239 } | 240 } |
| 240 // We need to wait some time to make sure that the files we 'touch' get a | 241 // We need to wait some time to make sure that the files we 'touch' get a |
| 241 // bigger timestamp than the old ones | 242 // bigger timestamp than the old ones |
| 242 new Timer(new Duration(seconds: 1), touchFilesAndRunTests); | 243 new Timer(new Duration(seconds: 1), touchFilesAndRunTests); |
| 243 } | 244 } |
| OLD | NEW |