| 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 * Test infrastructure for testing pub. Unlike typical unit tests, most pub | 6 * Test infrastructure for testing pub. Unlike typical unit tests, most pub |
| 7 * tests are integration tests that stage some stuff on the file system, run | 7 * tests are integration tests that stage some stuff on the file system, run |
| 8 * pub, and then validate the results. This library provides an API to build | 8 * pub, and then validate the results. This library provides an API to build |
| 9 * tests like that. | 9 * tests like that. |
| 10 */ | 10 */ |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 /// Schedule a Git command to run in this repository. | 1034 /// Schedule a Git command to run in this repository. |
| 1035 void scheduleGit(List<String> args) { | 1035 void scheduleGit(List<String> args) { |
| 1036 _schedule((parentDir) { | 1036 _schedule((parentDir) { |
| 1037 var gitDir = new Directory(join(parentDir, name)); | 1037 var gitDir = new Directory(join(parentDir, name)); |
| 1038 return _runGit(args, gitDir); | 1038 return _runGit(args, gitDir); |
| 1039 }); | 1039 }); |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 Future _runGitCommands(String parentDir, List<List<String>> commands) { | 1042 Future _runGitCommands(parentDir, List<List<String>> commands) { |
| 1043 var workingDir; | 1043 var workingDir; |
| 1044 | 1044 |
| 1045 Future runGitStep(_) { | 1045 Future runGitStep(_) { |
| 1046 if (commands.isEmpty) return new Future.immediate(workingDir); | 1046 if (commands.isEmpty) return new Future.immediate(workingDir); |
| 1047 var command = commands.removeAt(0); | 1047 var command = commands.removeAt(0); |
| 1048 return _runGit(command, workingDir).chain(runGitStep); | 1048 return _runGit(command, workingDir).chain(runGitStep); |
| 1049 } | 1049 } |
| 1050 | 1050 |
| 1051 return super.create(parentDir).chain((rootDir) { | 1051 return super.create(parentDir).chain((rootDir) { |
| 1052 workingDir = rootDir; | 1052 workingDir = rootDir; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 /** | 1217 /** |
| 1218 * Schedules a callback to be called after Pub is run with [runPub], even if it | 1218 * Schedules a callback to be called after Pub is run with [runPub], even if it |
| 1219 * fails. | 1219 * fails. |
| 1220 */ | 1220 */ |
| 1221 void _scheduleCleanup(_ScheduledEvent event) { | 1221 void _scheduleCleanup(_ScheduledEvent event) { |
| 1222 if (_scheduledCleanup == null) _scheduledCleanup = []; | 1222 if (_scheduledCleanup == null) _scheduledCleanup = []; |
| 1223 _scheduledCleanup.add(event); | 1223 _scheduledCleanup.add(event); |
| 1224 } | 1224 } |
| OLD | NEW |