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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 10937019: First pass at getting git and tar.gz working on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix merge bug. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/tests/pub/pub.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index b383dda9a3c4e47ceb2d210a634d72634fd52e63..cc9c6fad6b5ef8584aa784ec8e180bb92324accf 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -1031,10 +1031,30 @@ class TarFileDescriptor extends Descriptor {
tempDir = _tempDir;
return Futures.wait(contents.map((child) => child.create(tempDir)));
}).chain((_) {
- var args = ["--directory", tempDir.path, "--create", "--gzip", "--file",
- join(parentDir, _stringName)];
- args.addAll(contents.map((child) => child.name));
- return runProcess("tar", args);
+ if (Platform.operatingSystem != "windows") {
+ var args = ["--directory", tempDir.path, "--create", "--gzip",
+ "--file", join(parentDir, _stringName)];
+ args.addAll(contents.map((child) => child.name));
+ return runProcess("tar", args);
+ } else {
+ // Create the tar file.
+ var tarFile = join(tempDir, _stringName.replaceAll("tar.gz", "tar"));
+ var args = ["a", tarFile];
+ args.addAll(contents.map(
+ (child) => '-i!"${join(tempDir, child.name)}"'));
+
+ // Find 7zip. Note: this assumes the tests are being run from
+ // utils/tests/pub/
+ var scriptDir = new File(new Options().script).directorySync().path;
+ var command = fs.joinPaths(scriptDir,
+ '../../../third_party/7zip/7za.exe');
+
+ return runProcess(command, args).chain((_) {
+ // GZIP it. 7zip doesn't support doing both as a single operation.
+ args = ["a", join(parentDir, _stringName), tarFile];
+ return runProcess(command, args);
+ });
+ }
}).chain((result) {
if (!result.success) {
throw "Failed to create tar file $name.\n"
« no previous file with comments | « utils/tests/pub/pub.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698