Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |