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

Side by Side Diff: utils/testrunner/pipeline_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 | « tests/standalone/io/directory_test.dart ('k') | utils/testrunner/utils.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 pipeline; 5 part of pipeline;
6 6
7 List log; 7 List log;
8 var replyPort; 8 var replyPort;
9 int _procId = 1; 9 int _procId = 1;
10 Map _procs = {}; 10 Map _procs = {};
(...skipping 11 matching lines...) Expand all
22 22
23 /** 23 /**
24 * Given a file path [file], make it absolute if it is relative, 24 * Given a file path [file], make it absolute if it is relative,
25 * and return the result as a [Path]. 25 * and return the result as a [Path].
26 */ 26 */
27 Path getAbsolutePath(String file) { 27 Path getAbsolutePath(String file) {
28 var p = new Path(file).canonicalize(); 28 var p = new Path(file).canonicalize();
29 if (p.isAbsolute) { 29 if (p.isAbsolute) {
30 return p; 30 return p;
31 } else { 31 } else {
32 var cwd = new Path((new Directory.current()).path); 32 var cwd = new Path(Directory.current.path);
33 return cwd.join(p); 33 return cwd.join(p);
34 } 34 }
35 } 35 }
36 36
37 /** Get the directory that contains a [file]. */ 37 /** Get the directory that contains a [file]. */
38 String getDirectory(String file) => 38 String getDirectory(String file) =>
39 getAbsolutePath(file).directoryPath.toString(); 39 getAbsolutePath(file).directoryPath.toString();
40 40
41 /** Create a file [fileName] and populate it with [contents]. */ 41 /** Create a file [fileName] and populate it with [contents]. */
42 void writeFile(String fileName, String contents) { 42 void writeFile(String fileName, String contents) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 void completePipeline(List stdout, List stderr, [exitCode = 0]) { 204 void completePipeline(List stdout, List stderr, [exitCode = 0]) {
205 replyPort.send([stdout, stderr, log, exitCode]); 205 replyPort.send([stdout, stderr, log, exitCode]);
206 } 206 }
207 207
208 /** Utility function to log diagnostic messages. */ 208 /** Utility function to log diagnostic messages. */
209 void logMessage(msg) => log.add(msg); 209 void logMessage(msg) => log.add(msg);
210 210
211 /** Turn file paths into standard form with forward slashes. */ 211 /** Turn file paths into standard form with forward slashes. */
212 String normalizePath(String p) => (new Path(p)).toString(); 212 String normalizePath(String p) => (new Path(p)).toString();
OLDNEW
« no previous file with comments | « tests/standalone/io/directory_test.dart ('k') | utils/testrunner/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698