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

Side by Side Diff: utils/testrunner/utils.dart

Issue 13896034: Add the ability to change the working directory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed tests Created 7 years, 7 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
« no previous file with comments | « utils/testrunner/pipeline_utils.dart ('k') | utils/tests/testrunner/testrunner_test.dart » ('j') | 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 part of testrunner; 5 part of testrunner;
6 6
7 /** Create a file [fileName] and populate it with [contents]. */ 7 /** Create a file [fileName] and populate it with [contents]. */
8 void writeFile(String fileName, String contents) { 8 void writeFile(String fileName, String contents) {
9 var file = new File(fileName); 9 var file = new File(fileName);
10 file.writeAsStringSync(contents); 10 file.writeAsStringSync(contents);
(...skipping 18 matching lines...) Expand all
29 29
30 /** 30 /**
31 * Given a file path [path], make it absolute if it is relative, 31 * Given a file path [path], make it absolute if it is relative,
32 * and return the result. 32 * and return the result.
33 */ 33 */
34 String makePathAbsolute(String path) { 34 String makePathAbsolute(String path) {
35 var p = new Path(path).canonicalize(); 35 var p = new Path(path).canonicalize();
36 if (p.isAbsolute) { 36 if (p.isAbsolute) {
37 return p.toNativePath(); 37 return p.toNativePath();
38 } else { 38 } else {
39 var cwd = new Path((new Directory.current()).path); 39 var cwd = new Path(Directory.current.path);
40 return cwd.join(p).toNativePath(); 40 return cwd.join(p).toNativePath();
41 } 41 }
42 } 42 }
43 43
44 /** 44 /**
45 * Create the list of all the files in a set of directories 45 * Create the list of all the files in a set of directories
46 * ([dirs]) whose names match [filePat]. If [recurse] is true 46 * ([dirs]) whose names match [filePat]. If [recurse] is true
47 * look at subdirectories too. An optional [excludePat] can be supplied 47 * look at subdirectories too. An optional [excludePat] can be supplied
48 * and files or directories that match that will be excluded. 48 * and files or directories that match that will be excluded.
49 * [includeSymLinks] controls whether or not to include files that 49 * [includeSymLinks] controls whether or not to include files that
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 options = new ProcessOptions(); 109 options = new ProcessOptions();
110 options.workingDirectory = workingDir; 110 options.workingDirectory = workingDir;
111 } 111 }
112 return Process.run(command, args, options) 112 return Process.run(command, args, options)
113 .then((result) => result.exitCode) 113 .then((result) => result.exitCode)
114 .catchError((e) { 114 .catchError((e) {
115 print("$command ${args.join(' ')}: ${e.toString()}"); 115 print("$command ${args.join(' ')}: ${e.toString()}");
116 }); 116 });
117 } 117 }
118 118
OLDNEW
« no previous file with comments | « utils/testrunner/pipeline_utils.dart ('k') | utils/tests/testrunner/testrunner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698