| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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:io"; | 5 import "dart:io"; |
| 6 import "dart:async"; | 6 import "dart:async"; |
| 7 import "../../../tools/testing/dart/command.dart"; |
| 7 import "../../../tools/testing/dart/configuration.dart"; | 8 import "../../../tools/testing/dart/configuration.dart"; |
| 8 import "../../../tools/testing/dart/expectation.dart"; | 9 import "../../../tools/testing/dart/expectation.dart"; |
| 9 import "../../../tools/testing/dart/options.dart"; | 10 import "../../../tools/testing/dart/options.dart"; |
| 10 import "../../../tools/testing/dart/test_runner.dart"; | 11 import "../../../tools/testing/dart/test_runner.dart"; |
| 11 import "../../../tools/testing/dart/test_suite.dart"; | 12 import "../../../tools/testing/dart/test_suite.dart"; |
| 12 import "../../../tools/testing/dart/test_progress.dart" as progress; | 13 import "../../../tools/testing/dart/test_progress.dart" as progress; |
| 13 import "../../../tools/testing/dart/utils.dart"; | 14 import "../../../tools/testing/dart/utils.dart"; |
| 14 import "process_test_util.dart"; | 15 import "process_test_util.dart"; |
| 15 | 16 |
| 16 final DEFAULT_TIMEOUT = 20; | 17 final DEFAULT_TIMEOUT = 20; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 enqueueTestCase(testCaseFailUnexpected); | 91 enqueueTestCase(testCaseFailUnexpected); |
| 91 | 92 |
| 92 if (onDone != null) { | 93 if (onDone != null) { |
| 93 onDone(); | 94 onDone(); |
| 94 } | 95 } |
| 95 } | 96 } |
| 96 | 97 |
| 97 TestCase _makeNormalTestCase(name, expectations) { | 98 TestCase _makeNormalTestCase(name, expectations) { |
| 98 var args = packageOptions(); | 99 var args = packageOptions(); |
| 99 args.addAll([Platform.script.toFilePath(), name]); | 100 args.addAll([Platform.script.toFilePath(), name]); |
| 100 var command = CommandBuilder.instance | 101 var command = Command.process('custom', Platform.executable, args, {}); |
| 101 .getProcessCommand('custom', Platform.executable, args, {}); | |
| 102 return _makeTestCase(name, DEFAULT_TIMEOUT, command, expectations); | 102 return _makeTestCase(name, DEFAULT_TIMEOUT, command, expectations); |
| 103 } | 103 } |
| 104 | 104 |
| 105 _makeCrashTestCase(name, expectations) { | 105 _makeCrashTestCase(name, expectations) { |
| 106 var crashCommand = CommandBuilder.instance.getProcessCommand( | 106 var crashCommand = Command.process( |
| 107 'custom_crash', getProcessTestFileName(), ["0", "0", "1", "1"], {}); | 107 'custom_crash', getProcessTestFileName(), ["0", "0", "1", "1"], {}); |
| 108 // The crash test sometimes times out. Run it with a large timeout | 108 // The crash test sometimes times out. Run it with a large timeout |
| 109 // to help diagnose the delay. | 109 // to help diagnose the delay. |
| 110 // The test loads a new executable, which may sometimes take a long time. | 110 // The test loads a new executable, which may sometimes take a long time. |
| 111 // It involves a wait on the VM event loop, and possible system | 111 // It involves a wait on the VM event loop, and possible system |
| 112 // delays. | 112 // delays. |
| 113 return _makeTestCase(name, LONG_TIMEOUT, crashCommand, expectations); | 113 return _makeTestCase(name, LONG_TIMEOUT, crashCommand, expectations); |
| 114 } | 114 } |
| 115 | 115 |
| 116 _makeTestCase(name, timeout, command, expectations) { | 116 _makeTestCase(name, timeout, command, expectations) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 break; | 158 break; |
| 159 case 'timeout': | 159 case 'timeout': |
| 160 // This process should be killed by the test after DEFAULT_TIMEOUT | 160 // This process should be killed by the test after DEFAULT_TIMEOUT |
| 161 new Timer(new Duration(hours: 42), () {}); | 161 new Timer(new Duration(hours: 42), () {}); |
| 162 break; | 162 break; |
| 163 default: | 163 default: |
| 164 throw "Unknown option ${arguments[0]} passed to test_runner_test"; | 164 throw "Unknown option ${arguments[0]} passed to test_runner_test"; |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 } | 167 } |
| OLD | NEW |