OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 createSnapshot: true); | 193 createSnapshot: true); |
194 var fs_notUpToDate_dart = new FileUtils(createJs: true, | 194 var fs_notUpToDate_dart = new FileUtils(createJs: true, |
195 createJsDeps: true, | 195 createJsDeps: true, |
196 createDart: true, | 196 createDart: true, |
197 createSnapshot: true); | 197 createSnapshot: true); |
198 var fs_upToDate = new FileUtils(createJs: true, | 198 var fs_upToDate = new FileUtils(createJs: true, |
199 createJsDeps: true, | 199 createJsDeps: true, |
200 createDart: true, | 200 createDart: true, |
201 createSnapshot: true); | 201 createSnapshot: true); |
202 | 202 |
203 void touchFilesAndRunTests(Timer unused) { | 203 void touchFilesAndRunTests() { |
204 fs_notUpToDate_snapshot.touchFile(fs_notUpToDate_snapshot.testSnapshot); | 204 fs_notUpToDate_snapshot.touchFile(fs_notUpToDate_snapshot.testSnapshot); |
205 fs_notUpToDate_dart.touchFile(fs_notUpToDate_dart.testDart); | 205 fs_notUpToDate_dart.touchFile(fs_notUpToDate_dart.testDart); |
206 fs_upToDate.touchFile(fs_upToDate.testJs); | 206 fs_upToDate.touchFile(fs_upToDate.testJs); |
207 | 207 |
208 void runTest(String name, FileUtils fileUtils, bool shouldRun) { | 208 void runTest(String name, FileUtils fileUtils, bool shouldRun) { |
209 var testCase = makeTestCase( | 209 var testCase = makeTestCase( |
210 name, new TestCompletedHandler(fileUtils, shouldRun)); | 210 name, new TestCompletedHandler(fileUtils, shouldRun)); |
211 new runner.RunningProcess(testCase, testCase.commands[0]).start(); | 211 new runner.RunningProcess(testCase, testCase.commands[0]).start(); |
212 } | 212 } |
213 runTest("fs_noTestJs", fs_noTestJs, true); | 213 runTest("fs_noTestJs", fs_noTestJs, true); |
214 runTest("fs_noTestJsDeps", fs_noTestJsDeps, true); | 214 runTest("fs_noTestJsDeps", fs_noTestJsDeps, true); |
215 runTest("fs_noTestDart", fs_noTestDart, true); | 215 runTest("fs_noTestDart", fs_noTestDart, true); |
216 runTest("fs_noTestSnapshot", fs_noTestSnapshot, true); | 216 runTest("fs_noTestSnapshot", fs_noTestSnapshot, true); |
217 runTest("fs_notUpToDate_snapshot", fs_notUpToDate_snapshot, true); | 217 runTest("fs_notUpToDate_snapshot", fs_notUpToDate_snapshot, true); |
218 runTest("fs_notUpToDate_dart", fs_notUpToDate_dart, true); | 218 runTest("fs_notUpToDate_dart", fs_notUpToDate_dart, true); |
219 // This is the only test where all dependencies are present and the test.js | 219 // This is the only test where all dependencies are present and the test.js |
220 // file is newer than all the others. So we pass 'false' for shouldRun. | 220 // file is newer than all the others. So we pass 'false' for shouldRun. |
221 runTest("fs_upToDate", fs_upToDate, false); | 221 runTest("fs_upToDate", fs_upToDate, false); |
222 } | 222 } |
223 // We need to wait some time to make sure that the files we 'touch' get a | 223 // We need to wait some time to make sure that the files we 'touch' get a |
224 // bigger timestamp than the old ones | 224 // bigger timestamp than the old ones |
225 new Timer(1000, touchFilesAndRunTests); | 225 new Timer(new Duration(seconds: 1), touchFilesAndRunTests); |
226 } | 226 } |
OLD | NEW |