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 // OtherResources=skipping_dart2js_compilations_helper.dart | 5 // OtherResources=skipping_dart2js_compilations_helper.dart |
6 | 6 |
7 /* | 7 /* |
8 * This test makes sure that the "skipping Dart2Js compilations if the output is | 8 * This test makes sure that the "skipping Dart2Js compilations if the output is |
9 * already up to date" feature does work as it should. | 9 * already up to date" feature does work as it should. |
10 * Therefore this test ensures that compilations are only skipped if the last | 10 * Therefore this test ensures that compilations are only skipped if the last |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 class CommandCompletedHandler { | 128 class CommandCompletedHandler { |
129 FileUtils fileUtils; | 129 FileUtils fileUtils; |
130 bool _shouldHaveRun; | 130 bool _shouldHaveRun; |
131 | 131 |
132 CommandCompletedHandler(FileUtils this.fileUtils, bool this._shouldHaveRun); | 132 CommandCompletedHandler(FileUtils this.fileUtils, bool this._shouldHaveRun); |
133 | 133 |
134 void processCompletedTest(CommandOutput output) { | 134 void processCompletedTest(CommandOutput output) { |
135 Expect.isTrue(output.exitCode == 0); | 135 Expect.equals(0, output.exitCode); |
136 Expect.isTrue(output.stderr.length == 0); | 136 Expect.equals(0, output.stderr.length); |
137 if (_shouldHaveRun) { | 137 if (_shouldHaveRun) { |
138 Expect.isTrue(output.stdout.length == 0); | 138 Expect.equals(0, output.stdout.length); |
139 Expect.isTrue( | 139 Expect.isTrue( |
140 new File(fileUtils.scriptOutputPath.toNativePath()).existsSync()); | 140 new File(fileUtils.scriptOutputPath.toNativePath()).existsSync()); |
141 } else { | 141 } else { |
142 Expect.isFalse( | 142 Expect.isFalse( |
143 new File(fileUtils.scriptOutputPath.toNativePath()).existsSync()); | 143 new File(fileUtils.scriptOutputPath.toNativePath()).existsSync()); |
144 } | 144 } |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 Command makeCompilationCommand(String testName, FileUtils fileUtils) { | 148 Command makeCompilationCommand(String testName, FileUtils fileUtils) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 throw error; | 242 throw error; |
243 }).then((_) { | 243 }).then((_) { |
244 cleanup(); | 244 cleanup(); |
245 }); | 245 }); |
246 } | 246 } |
247 | 247 |
248 // We need to wait some time to make sure that the files we 'touch' get a | 248 // We need to wait some time to make sure that the files we 'touch' get a |
249 // bigger timestamp than the old ones | 249 // bigger timestamp than the old ones |
250 new Timer(new Duration(seconds: 1), touchFilesAndRunTests); | 250 new Timer(new Duration(seconds: 1), touchFilesAndRunTests); |
251 } | 251 } |
OLD | NEW |