OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Dart test program for testing native extensions. | 5 // Dart test program for testing native extensions. |
6 | 6 |
| 7 import "dart:async"; |
7 import "dart:io"; | 8 import "dart:io"; |
8 | 9 |
9 Future copyFileToDirectory(Path file, Path directory) { | 10 Future copyFileToDirectory(Path file, Path directory) { |
10 String src = file.toNativePath(); | 11 String src = file.toNativePath(); |
11 String dst = directory.toNativePath(); | 12 String dst = directory.toNativePath(); |
12 switch (Platform.operatingSystem) { | 13 switch (Platform.operatingSystem) { |
13 case 'linux': | 14 case 'linux': |
14 case 'macos': | 15 case 'macos': |
15 return Process.run('cp', [src, dst]); | 16 return Process.run('cp', [src, dst]); |
16 case 'windows': | 17 case 'windows': |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 }).then((_) { | 55 }).then((_) { |
55 Path script = testDirectory.append('test_extension_fail_tester.dart'); | 56 Path script = testDirectory.append('test_extension_fail_tester.dart'); |
56 return Process.run(options.executable, [script.toNativePath()]); | 57 return Process.run(options.executable, [script.toNativePath()]); |
57 }).then((ProcessResult result) { | 58 }).then((ProcessResult result) { |
58 print("ERR: ${result.stderr}\n\n"); | 59 print("ERR: ${result.stderr}\n\n"); |
59 print("OUT: ${result.stdout}\n\n"); | 60 print("OUT: ${result.stdout}\n\n"); |
60 Expect.equals(255, result.exitCode); | 61 Expect.equals(255, result.exitCode); |
61 Expect.isTrue(result.stderr.contains("Unhandled exception:\nball\n")); | 62 Expect.isTrue(result.stderr.contains("Unhandled exception:\nball\n")); |
62 }).whenComplete(() => tempDirectory.deleteSync(recursive: true)); | 63 }).whenComplete(() => tempDirectory.deleteSync(recursive: true)); |
63 } | 64 } |
OLD | NEW |