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 ext = Platform.isWindows ? '.bat' : ''; | 50 String executable = Platform.executable; |
| 51 String command = | 51 String command = path.join(path.dirname(executable), 'dart2js'); |
| 52 path.normalize(path.join(path.fromUri(Platform.script), | 52 String dart2jsPath = path.normalize( |
|
Bill Hesse
2016/08/12 19:01:31
Maybe check if this exists, and don't fail if it i
Siggi Cherem (dart-lang)
2016/08/12 20:21:14
I'd be afraid that the test would be "passing" but
| |
| 53 '../../../../sdk/bin/dart2js${ext}')); | 53 path.join(path.fromUri(Platform.script), |
| 54 return Process.run(command, args, stdoutEncoding: null); | 54 '../../../../pkg/compiler/lib/src/dart2js.dart')); |
| 55 List allArgs = ['--package-root=${Platform.packageRoot}', | |
|
Bill Hesse
2016/08/12 19:01:31
I'm just working on removing packageRoot from test
Siggi Cherem (dart-lang)
2016/08/12 20:21:14
good point - we should fix it to pass along whiche
| |
| 56 dart2jsPath]..addAll(args); | |
| 57 return Process.run(Platform.executable, allArgs, stdoutEncoding: null); | |
| 55 } | 58 } |
| 56 | 59 |
| 57 void check(ProcessResult result) { | 60 void check(ProcessResult result) { |
| 58 Expect.notEquals(0, result.exitCode); | 61 Expect.notEquals(0, result.exitCode); |
| 59 List<int> stdout = result.stdout; | 62 List<int> stdout = result.stdout; |
| 60 String stdoutString = UTF8.decode(stdout); | 63 String stdoutString = UTF8.decode(stdout); |
| 61 Expect.isTrue(stdoutString.contains("Error")); | 64 Expect.isTrue(stdoutString.contains("Error")); |
| 62 // Make sure the "499" from the last line is in the output. | 65 // Make sure the "499" from the last line is in the output. |
| 63 Expect.isTrue(stdoutString.contains("499")); | 66 Expect.isTrue(stdoutString.contains("499")); |
| 64 | 67 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 await testHttp(); | 108 await testHttp(); |
| 106 } finally { | 109 } finally { |
| 107 await tempDir.delete(recursive:true); | 110 await tempDir.delete(recursive:true); |
| 108 } | 111 } |
| 109 } | 112 } |
| 110 | 113 |
| 111 main() { | 114 main() { |
| 112 asyncStart(); | 115 asyncStart(); |
| 113 runTests().whenComplete(asyncEnd); | 116 runTests().whenComplete(asyncEnd); |
| 114 } | 117 } |
| OLD | NEW |