OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:path/path.dart' as path; | 9 import 'package:path/path.dart' as path; |
10 import 'package:async_helper/async_helper.dart'; | 10 import 'package:async_helper/async_helper.dart'; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 Future runTests(Process process) { | 60 Future runTests(Process process) { |
61 String inFile = path.join(tmpDir.path, 'dart2js_batch2_run.dart'); | 61 String inFile = path.join(tmpDir.path, 'dart2js_batch2_run.dart'); |
62 String outFile = path.join(tmpDir.path, 'out.js'); | 62 String outFile = path.join(tmpDir.path, 'out.js'); |
63 | 63 |
64 process.stdin.writeln('--out="$outFile" "$inFile"'); | 64 process.stdin.writeln('--out="$outFile" "$inFile"'); |
65 process.stdin.close(); | 65 process.stdin.close(); |
66 Future<String> output = process.stdout.transform(UTF8.decoder).join(); | 66 Future<String> output = process.stdout.transform(UTF8.decoder).join(); |
67 Future<String> errorOut = process.stderr.transform(UTF8.decoder).join(); | 67 Future<String> errorOut = process.stderr.transform(UTF8.decoder).join(); |
68 return Future.wait([output, errorOut]).then((result) { | 68 return Future.wait([output, errorOut]).then((result) { |
69 String stdoutOutput = result[0]; | 69 String stdoutOutput = result[0]; |
70 String stderrOutput = result[1]; | |
71 | |
72 Expect.isFalse(stdoutOutput.contains("crashed")); | 70 Expect.isFalse(stdoutOutput.contains("crashed")); |
73 }); | 71 }); |
74 } | 72 } |
75 | 73 |
76 void main() { | 74 void main() { |
77 var tmpDir; | |
78 asyncTest(() { | 75 asyncTest(() { |
79 return setup().then(launchDart2Js).then(runTests).whenComplete(cleanUp); | 76 return setup().then(launchDart2Js).then(runTests).whenComplete(cleanUp); |
80 }); | 77 }); |
81 } | 78 } |
OLD | NEW |