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

Unified Diff: test/io.dart

Issue 939383002: Run with colored output even within "pub run". (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 10 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 | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/io.dart
diff --git a/test/io.dart b/test/io.dart
index 09bd31df2c4de4a59f98d13dbd3b560aded397e4..7ba9eb04fe78aa819f705815fee1bb2c05713f33 100644
--- a/test/io.dart
+++ b/test/io.dart
@@ -16,23 +16,29 @@ String _computePackageDir() =>
p.dirname(p.dirname(_libraryPath(#unittest.test.io)));
/// Runs the unittest executable with the package root set properly.
-ProcessResult runUnittest(List<String> args, {String workingDirectory}) {
+ProcessResult runUnittest(List<String> args, {String workingDirectory,
+ Map<String, String> environment}) {
var allArgs = [
p.join(packageDir, 'bin/unittest.dart'),
"--package-root=${p.join(packageDir, 'packages')}"
]..addAll(args);
+ if (environment == null) environment = {};
+ environment.putIfAbsent("_UNITTEST_USE_COLOR", () => "false");
+
// TODO(nweiz): Use ScheduledProcess once it's compatible.
- return runDart(allArgs, workingDirectory: workingDirectory);
+ return runDart(allArgs, workingDirectory: workingDirectory,
+ environment: environment);
}
/// Runs Dart.
-ProcessResult runDart(List<String> args, {String workingDirectory}) {
+ProcessResult runDart(List<String> args, {String workingDirectory,
+ Map<String, String> environment}) {
var allArgs = Platform.executableArguments.toList()..addAll(args);
// TODO(nweiz): Use ScheduledProcess once it's compatible.
return Process.runSync(Platform.executable, allArgs,
- workingDirectory: workingDirectory);
+ workingDirectory: workingDirectory, environment: environment);
}
/// Returns the path to the library named [libraryName].
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698