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

Unified Diff: test/io.dart

Issue 933083002: Add a test runner executable. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Code review changes 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 | « test/console_reporter_test.dart ('k') | test/loader_test.dart » ('j') | 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 663d454c11da659dba0ddfd96e81db6b0429d216..1dbc377eebf599728281be8e342a6657c3354061 100644
--- a/test/io.dart
+++ b/test/io.dart
@@ -8,7 +8,6 @@ import 'dart:io';
import 'package:path/path.dart' as p;
import 'package:stack_trace/stack_trace.dart';
-import 'package:unittest/unittest.dart';
/// The root directory of the `unittest` package.
final String packageDir = _computePackageDir();
@@ -17,9 +16,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);
+}
« no previous file with comments | « test/console_reporter_test.dart ('k') | test/loader_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698