Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: utils/tests/pub/test_pub.dart

Issue 10905202: Look for git.cmd on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« utils/pub/io.dart ('K') | « utils/pub/io.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 976
977 /// Schedule a Git command to run in this repository. 977 /// Schedule a Git command to run in this repository.
978 void scheduleGit(List<String> args) { 978 void scheduleGit(List<String> args) {
979 _schedule((parentDir) { 979 _schedule((parentDir) {
980 var gitDir = new Directory(join(parentDir, name)); 980 var gitDir = new Directory(join(parentDir, name));
981 return _runGit(args, gitDir); 981 return _runGit(args, gitDir);
982 }); 982 });
983 } 983 }
984 984
985 Future<String> _runGit(List<String> args, Directory workingDir) { 985 Future<String> _runGit(List<String> args, Directory workingDir) {
986 return runProcess('git', args, workingDir: workingDir.path). 986 return runGit(args, workingDir: workingDir.path).transform((result) {
987 transform((result) { 987 if (!result.success) throw "Error running git: ${result.stderr}";
988 if (!result.success) throw "Error running git: ${result.stderr}"; 988 return result.stdout;
989 return result.stdout; 989 });
990 });
991 } 990 }
992 } 991 }
993 992
994 /** 993 /**
995 * Describes a gzipped tar file and its contents. 994 * Describes a gzipped tar file and its contents.
996 */ 995 */
997 class TarFileDescriptor extends Descriptor { 996 class TarFileDescriptor extends Descriptor {
998 final List<Descriptor> contents; 997 final List<Descriptor> contents;
999 998
1000 TarFileDescriptor(Pattern name, this.contents) 999 TarFileDescriptor(Pattern name, this.contents)
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 } 1114 }
1116 1115
1117 /** 1116 /**
1118 * Schedules a callback to be called after Pub is run with [runPub], even if it 1117 * Schedules a callback to be called after Pub is run with [runPub], even if it
1119 * fails. 1118 * fails.
1120 */ 1119 */
1121 void _scheduleCleanup(_ScheduledEvent event) { 1120 void _scheduleCleanup(_ScheduledEvent event) {
1122 if (_scheduledCleanup == null) _scheduledCleanup = []; 1121 if (_scheduledCleanup == null) _scheduledCleanup = [];
1123 _scheduledCleanup.add(event); 1122 _scheduledCleanup.add(event);
1124 } 1123 }
OLDNEW
« utils/pub/io.dart ('K') | « utils/pub/io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698