| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 return suite.TestUtils.absolutePath(new Path(tempDir.path) | 100 return suite.TestUtils.absolutePath(new Path(tempDir.path) |
| 101 .append('test_dart2js.snapshot')); | 101 .append('test_dart2js.snapshot')); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void touchFile(File file) { | 104 void touchFile(File file) { |
| 105 _writeToFile(file, _readFile(file)); | 105 _writeToFile(file, _readFile(file)); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void _writeToFile(File file, String content) { | 108 void _writeToFile(File file, String content) { |
| 109 if (content != null) { | 109 if (content != null) { |
| 110 var fd = new File(file.fullPathSync()).openSync(mode: FileMode.WRITE); | 110 var fd = new File(file.resolveSymbolicLinksSync()) |
| 111 .openSync(mode: FileMode.WRITE); |
| 111 fd.writeStringSync(content); | 112 fd.writeStringSync(content); |
| 112 fd.closeSync(); | 113 fd.closeSync(); |
| 113 } | 114 } |
| 114 } | 115 } |
| 115 | 116 |
| 116 String _readFile(File file) { | 117 String _readFile(File file) { |
| 117 return file.readAsStringSync(); | 118 return file.readAsStringSync(); |
| 118 } | 119 } |
| 119 | 120 |
| 120 File _createFile(Path path) { | 121 File _createFile(Path path) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 cleanup(); | 237 cleanup(); |
| 237 throw error; | 238 throw error; |
| 238 }).then((_) { | 239 }).then((_) { |
| 239 cleanup(); | 240 cleanup(); |
| 240 }); | 241 }); |
| 241 } | 242 } |
| 242 // We need to wait some time to make sure that the files we 'touch' get a | 243 // We need to wait some time to make sure that the files we 'touch' get a |
| 243 // bigger timestamp than the old ones | 244 // bigger timestamp than the old ones |
| 244 new Timer(new Duration(seconds: 1), touchFilesAndRunTests); | 245 new Timer(new Duration(seconds: 1), touchFilesAndRunTests); |
| 245 } | 246 } |
| OLD | NEW |