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

Unified Diff: test/io.dart

Issue 933083002: Add a test runner executable. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: fix loader_test? 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
Index: test/io.dart
diff --git a/test/io.dart b/test/io.dart
index 663d454c11da659dba0ddfd96e81db6b0429d216..dc0222a2d911cbbedd2afc7870bdd973b1103c03 100644
--- a/test/io.dart
+++ b/test/io.dart
@@ -17,9 +17,14 @@ String _computePackageDir() {
return p.dirname(p.dirname(p.fromUri(trace.frames.first.uri)));
}
-/// Returns a matcher that matches a [FileSystemException] with the given
-/// [message].
-Matcher isFileSystemException(String message) => predicate(
- (error) => error is FileSystemException && error.message == message,
- 'is a FileSystemException with message "$message"');
+/// Runs the unittest executable with the package root set properly.
+ProcessResult runUnittest(List<String> args, {String workingDirectory}) {
+ var allArgs = Platform.executableArguments.toList()
+ ..add(p.join(packageDir, 'bin/unittest.dart'))
+ ..add("--package-root=${p.join(packageDir, 'packages')}")
+ ..addAll(args);
+ // TODO(nweiz): Use ScheduledProcess once it's compatible.
+ return Process.runSync(Platform.executable, allArgs,
+ workingDirectory: workingDirectory);
+}

Powered by Google App Engine
This is Rietveld 408576698