| 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 "package:expect/expect.dart"; |
| 7 import "dart:async"; | 8 import "dart:async"; |
| 8 import "dart:io"; | 9 import "dart:io"; |
| 9 | 10 |
| 10 Future copyFileToDirectory(Path file, Path directory) { | 11 Future copyFileToDirectory(Path file, Path directory) { |
| 11 String src = file.toNativePath(); | 12 String src = file.toNativePath(); |
| 12 String dst = directory.toNativePath(); | 13 String dst = directory.toNativePath(); |
| 13 switch (Platform.operatingSystem) { | 14 switch (Platform.operatingSystem) { |
| 14 case 'linux': | 15 case 'linux': |
| 15 case 'macos': | 16 case 'macos': |
| 16 return Process.run('cp', [src, dst]); | 17 return Process.run('cp', [src, dst]); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 Path script = testDirectory.append('test_extension_fail_tester.dart'); | 57 Path script = testDirectory.append('test_extension_fail_tester.dart'); |
| 57 return Process.run(options.executable, [script.toNativePath()]); | 58 return Process.run(options.executable, [script.toNativePath()]); |
| 58 }).then((ProcessResult result) { | 59 }).then((ProcessResult result) { |
| 59 print("ERR: ${result.stderr}\n\n"); | 60 print("ERR: ${result.stderr}\n\n"); |
| 60 print("OUT: ${result.stdout}\n\n"); | 61 print("OUT: ${result.stdout}\n\n"); |
| 61 Expect.equals(255, result.exitCode); | 62 Expect.equals(255, result.exitCode); |
| 62 Expect.isTrue(result.stderr.contains("Unhandled exception:")); | 63 Expect.isTrue(result.stderr.contains("Unhandled exception:")); |
| 63 Expect.isTrue(result.stderr.contains("ball")); | 64 Expect.isTrue(result.stderr.contains("ball")); |
| 64 }).whenComplete(() => tempDirectory.deleteSync(recursive: true)); | 65 }).whenComplete(() => tempDirectory.deleteSync(recursive: true)); |
| 65 } | 66 } |
| OLD | NEW |