| 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 /** | 5 /** |
| 6 * Classes and methods for executing tests. | 6 * Classes and methods for executing tests. |
| 7 * | 7 * |
| 8 * This module includes: | 8 * This module includes: |
| 9 * - Managing parallel execution of tests, including timeout checks. | 9 * - Managing parallel execution of tests, including timeout checks. |
| 10 * - Evaluating the output of each test as pass/fail/crash/timeout. | 10 * - Evaluating the output of each test as pass/fail/crash/timeout. |
| (...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 _stderrStream = new io.StringInputStream(_process.stderr); | 1283 _stderrStream = new io.StringInputStream(_process.stderr); |
| 1284 _process.onExit = makeExitHandler(">>> TEST CRASH"); | 1284 _process.onExit = makeExitHandler(">>> TEST CRASH"); |
| 1285 callback(); | 1285 callback(); |
| 1286 }).catchError((e) { | 1286 }).catchError((e) { |
| 1287 print("Process error:"); | 1287 print("Process error:"); |
| 1288 print(" Command: $_executable ${_batchArguments.join(' ')}"); | 1288 print(" Command: $_executable ${_batchArguments.join(' ')}"); |
| 1289 print(" Error: $e"); | 1289 print(" Error: $e"); |
| 1290 // If there is an error starting a batch process, chances are that | 1290 // If there is an error starting a batch process, chances are that |
| 1291 // it will always fail. So rather than re-trying a 1000+ times, we | 1291 // it will always fail. So rather than re-trying a 1000+ times, we |
| 1292 // exit. | 1292 // exit. |
| 1293 exit(1); | 1293 io.exit(1); |
| 1294 return true; | 1294 return true; |
| 1295 }); | 1295 }); |
| 1296 } | 1296 } |
| 1297 } | 1297 } |
| 1298 | 1298 |
| 1299 /** | 1299 /** |
| 1300 * ProcessQueue is the master control class, responsible for running all | 1300 * ProcessQueue is the master control class, responsible for running all |
| 1301 * the tests in all the TestSuites that have been registered. It includes | 1301 * the tests in all the TestSuites that have been registered. It includes |
| 1302 * a rate-limited queue to run a limited number of tests in parallel, | 1302 * a rate-limited queue to run a limited number of tests in parallel, |
| 1303 * a ProgressIndicator which prints output when tests are started and | 1303 * a ProgressIndicator which prints output when tests are started and |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1458 } | 1458 } |
| 1459 if (!_isSeleniumAvailable) { | 1459 if (!_isSeleniumAvailable) { |
| 1460 _startSeleniumServer(); | 1460 _startSeleniumServer(); |
| 1461 } | 1461 } |
| 1462 }; | 1462 }; |
| 1463 }).catchError((e) { | 1463 }).catchError((e) { |
| 1464 print("Error starting process:"); | 1464 print("Error starting process:"); |
| 1465 print(" Command: $cmd ${arg.join(' ')}"); | 1465 print(" Command: $cmd ${arg.join(' ')}"); |
| 1466 print(" Error: $e"); | 1466 print(" Error: $e"); |
| 1467 // TODO(ahe): How to report this as a test failure? | 1467 // TODO(ahe): How to report this as a test failure? |
| 1468 exit(1); | 1468 io.exit(1); |
| 1469 return true; | 1469 return true; |
| 1470 }); | 1470 }); |
| 1471 } | 1471 } |
| 1472 } | 1472 } |
| 1473 | 1473 |
| 1474 void _runTest(TestCase test) { | 1474 void _runTest(TestCase test) { |
| 1475 if (test.usesWebDriver) { | 1475 if (test.usesWebDriver) { |
| 1476 browserUsed = test.configuration['browser']; | 1476 browserUsed = test.configuration['browser']; |
| 1477 if (_needsSelenium) _ensureSeleniumServerRunning(); | 1477 if (_needsSelenium) _ensureSeleniumServerRunning(); |
| 1478 } | 1478 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1529 new io.StringInputStream(_seleniumServer.stderr); | 1529 new io.StringInputStream(_seleniumServer.stderr); |
| 1530 stdoutStringStream.onLine = | 1530 stdoutStringStream.onLine = |
| 1531 makeSeleniumServerHandler(stdoutStringStream); | 1531 makeSeleniumServerHandler(stdoutStringStream); |
| 1532 stderrStringStream.onLine = | 1532 stderrStringStream.onLine = |
| 1533 makeSeleniumServerHandler(stderrStringStream); | 1533 makeSeleniumServerHandler(stderrStringStream); |
| 1534 }).catchError((e) { | 1534 }).catchError((e) { |
| 1535 print("Process error:"); | 1535 print("Process error:"); |
| 1536 print(" Command: java -jar $file"); | 1536 print(" Command: java -jar $file"); |
| 1537 print(" Error: $e"); | 1537 print(" Error: $e"); |
| 1538 // TODO(ahe): How to report this as a test failure? | 1538 // TODO(ahe): How to report this as a test failure? |
| 1539 exit(1); | 1539 io.exit(1); |
| 1540 return true; | 1540 return true; |
| 1541 }); | 1541 }); |
| 1542 } | 1542 } |
| 1543 }; | 1543 }; |
| 1544 } | 1544 } |
| 1545 | 1545 |
| 1546 Future _terminateBatchRunners() { | 1546 Future _terminateBatchRunners() { |
| 1547 var futures = new List(); | 1547 var futures = new List(); |
| 1548 for (var runners in _batchProcesses.values) { | 1548 for (var runners in _batchProcesses.values) { |
| 1549 for (var runner in runners) { | 1549 for (var runner in runners) { |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1746 completer.complete(testCase); | 1746 completer.complete(testCase); |
| 1747 } | 1747 } |
| 1748 }); | 1748 }); |
| 1749 } | 1749 } |
| 1750 runCommand(); | 1750 runCommand(); |
| 1751 | 1751 |
| 1752 return completer.future; | 1752 return completer.future; |
| 1753 } | 1753 } |
| 1754 } | 1754 } |
| 1755 | 1755 |
| OLD | NEW |