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

Side by Side Diff: tests/compiler/dart2js/zero_termination_test.dart

Issue 2238353002: Additional fixes to zero_termination_test (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // A regression test for issue 22667. 5 // A regression test for issue 22667.
6 // 6 //
7 // Makes sure that we don't print a '\0' character for files that are not 7 // Makes sure that we don't print a '\0' character for files that are not
8 // properly new-line terminated. 8 // properly new-line terminated.
9 library zero_termination_test; 9 library zero_termination_test;
10 10
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 void cleanup() { 42 void cleanup() {
43 File outFile = new File(outFilePath); 43 File outFile = new File(outFilePath);
44 if (outFile.existsSync()) { 44 if (outFile.existsSync()) {
45 outFile.deleteSync(); 45 outFile.deleteSync();
46 } 46 }
47 } 47 }
48 48
49 Future launchDart2Js(args) { 49 Future launchDart2Js(args) {
50 String executable = Platform.executable;
51 String command = path.join(path.dirname(executable), 'dart2js');
Siggi Cherem (dart-lang) 2016/08/12 20:26:37 this was dead code.
52 String dart2jsPath = path.normalize( 50 String dart2jsPath = path.normalize(
53 path.join(path.fromUri(Platform.script), 51 path.join(path.fromUri(Platform.script),
54 '../../../../pkg/compiler/lib/src/dart2js.dart')); 52 '../../../../pkg/compiler/lib/src/dart2js.dart'));
55 List allArgs = ['--package-root=${Platform.packageRoot}', 53 List allArgs = [];
56 dart2jsPath]..addAll(args); 54 if (Platform.packageRoot != null) {
Siggi Cherem (dart-lang) 2016/08/12 20:26:37 this addresses Bill's comments from the other CL.
Bill Hesse 2016/08/15 15:48:36 Acknowledged.
55 allArgs.add('--package-root=${Platform.packageRoot}');
56 } else if (Platform.packageConfig != null) {
57 allArgs.add('--packages=${Platform.packageConfig}');
58 }
59 allArgs.add(dart2jsPath);
60 allArgs.addAll(args);
57 return Process.run(Platform.executable, allArgs, stdoutEncoding: null); 61 return Process.run(Platform.executable, allArgs, stdoutEncoding: null);
58 } 62 }
59 63
60 void check(ProcessResult result) { 64 void check(ProcessResult result) {
61 Expect.notEquals(0, result.exitCode); 65 Expect.notEquals(0, result.exitCode);
62 List<int> stdout = result.stdout; 66 List<int> stdout = result.stdout;
63 String stdoutString = UTF8.decode(stdout); 67 String stdoutString = UTF8.decode(stdout);
64 Expect.isTrue(stdoutString.contains("Error")); 68 Expect.isTrue(stdoutString.contains("Error"));
65 // Make sure the "499" from the last line is in the output. 69 // Make sure the "499" from the last line is in the output.
66 Expect.isTrue(stdoutString.contains("499")); 70 Expect.isTrue(stdoutString.contains("499"));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 await testHttp(); 112 await testHttp();
109 } finally { 113 } finally {
110 await tempDir.delete(recursive:true); 114 await tempDir.delete(recursive:true);
111 } 115 }
112 } 116 }
113 117
114 main() { 118 main() {
115 asyncStart(); 119 asyncStart();
116 runTests().whenComplete(asyncEnd); 120 runTests().whenComplete(asyncEnd);
117 } 121 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698