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

Unified Diff: tests/compiler/dart2js/dill_loader_test.dart

Issue 2803973002: Support dartk on Windows. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | tools/dartk_wrappers/dartk.bat » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/dill_loader_test.dart
diff --git a/tests/compiler/dart2js/dill_loader_test.dart b/tests/compiler/dart2js/dill_loader_test.dart
index 8cb2b86bbf7f00d985442a552b3c24ab01d11a58..19b2ef8707d469b3e6f287c8e1197e63f7e0a0e6 100644
--- a/tests/compiler/dart2js/dill_loader_test.dart
+++ b/tests/compiler/dart2js/dill_loader_test.dart
@@ -17,17 +17,18 @@ import 'package:compiler/src/apiimpl.dart' show CompilerImpl;
import "package:expect/expect.dart";
import 'package:path/path.dart' as path;
+final String dartkExecutable = Platform.isWindows
+ ? 'tools/dartk_wrappers/dartk.bat'
+ : 'tools/dartk_wrappers/dartk';
+
/// Run the dartk.dart script, and return the binary encoded results.
-List<int> runDartk(Uri filename) {
+List<int> runDartk(String filename) {
String basePath = path.fromUri(Uri.base);
- String dartkPath =
- path.normalize(path.join(basePath, 'tools/dartk_wrappers/dartk'));
+ String dartkPath = path.normalize(path.join(basePath, dartkExecutable));
- var args = [filename.path, '-fbin', '-ostdout'];
- ProcessResult result = Process.runSync(
- dartkPath, [filename.path, '-fbin', '-ostdout'],
- stdoutEncoding: null);
- Expect.equals(0, result.exitCode);
+ var args = [filename, '-fbin', '-ostdout'];
+ ProcessResult result = Process.runSync(dartkPath, args, stdoutEncoding: null);
+ Expect.equals(0, result.exitCode, result.stderr);
return result.stdout;
}
@@ -43,12 +44,12 @@ class TestScriptLoader implements ScriptLoader {
/// than just string source files.
main() {
asyncTest(() async {
- Uri uri = Uri.base.resolve('tests/corelib/list_literal_test.dart');
- File entity = new File.fromUri(uri);
+ String filename = 'tests/corelib/list_literal_test.dart';
+ Uri uri = Uri.base.resolve(filename);
DiagnosticCollector diagnostics = new DiagnosticCollector();
OutputCollector output = new OutputCollector();
Uri entryPoint = Uri.parse('memory:main.dill');
- List<int> kernelBinary = runDartk(entity.uri);
+ List<int> kernelBinary = runDartk(filename);
CompilerImpl compiler = compilerFor(
entryPoint: entryPoint,
« no previous file with comments | « no previous file | tools/dartk_wrappers/dartk.bat » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698