Chromium Code Reviews| 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 1836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1847 watchdogTimer.cancel(); | 1847 watchdogTimer.cancel(); |
| 1848 } | 1848 } |
| 1849 } | 1849 } |
| 1850 } | 1850 } |
| 1851 | 1851 |
| 1852 // Close stdin so that tests that try to block on input will fail. | 1852 // Close stdin so that tests that try to block on input will fail. |
| 1853 process.stdin.close(); | 1853 process.stdin.close(); |
| 1854 void timeoutHandler() { | 1854 void timeoutHandler() { |
| 1855 timedOut = true; | 1855 timedOut = true; |
| 1856 if (process != null) { | 1856 if (process != null) { |
| 1857 if (!process.kill()) { | 1857 io.Process.run('gdb', |
|
rmacnak
2016/09/07 19:33:47
Only attempt to use gdb on Linux.
Florian Schneider
2016/09/07 21:02:58
Done.
| |
| 1858 DebugLogger.error("Unable to kill ${process.pid}"); | 1858 ['--pid=${process.pid}', |
| 1859 } | 1859 '--eval-command=thread apply all bt', |
| 1860 '--eval-command=quit']) | |
| 1861 .then((result) { | |
| 1862 io.stdout.write(result.stdout); | |
| 1863 io.stderr.write(result.stderr); | |
| 1864 }) | |
|
siva
2016/09/07 19:55:20
Do we also need a catchError handler here to print
Florian Schneider
2016/09/07 21:02:58
Yes. Added printing. Also, I should only invoke gd
Bill Hesse
2016/09/08 14:58:01
I would just run "which gdb" in a subprocess, and
| |
| 1865 .whenComplete(() { | |
| 1866 if (!process.kill()) { | |
| 1867 DebugLogger.error("Unable to kill ${process.pid}"); | |
| 1868 } | |
| 1869 }); | |
| 1860 } | 1870 } |
| 1861 } | 1871 } |
| 1862 | 1872 |
| 1863 stdoutSubscription.asFuture().then(closeStdout); | 1873 stdoutSubscription.asFuture().then(closeStdout); |
| 1864 stderrSubscription.asFuture().then(closeStderr); | 1874 stderrSubscription.asFuture().then(closeStderr); |
| 1865 | 1875 |
| 1866 process.exitCode.then((exitCode) { | 1876 process.exitCode.then((exitCode) { |
| 1867 if (!stdoutDone || !stderrDone) { | 1877 if (!stdoutDone || !stderrDone) { |
| 1868 watchdogTimer = new Timer(MAX_STDIO_DELAY, () { | 1878 watchdogTimer = new Timer(MAX_STDIO_DELAY, () { |
| 1869 DebugLogger.warning( | 1879 DebugLogger.warning( |
| (...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3044 } | 3054 } |
| 3045 } | 3055 } |
| 3046 | 3056 |
| 3047 void eventAllTestsDone() { | 3057 void eventAllTestsDone() { |
| 3048 for (var listener in _eventListener) { | 3058 for (var listener in _eventListener) { |
| 3049 listener.allDone(); | 3059 listener.allDone(); |
| 3050 } | 3060 } |
| 3051 _allDone(); | 3061 _allDone(); |
| 3052 } | 3062 } |
| 3053 } | 3063 } |
| OLD | NEW |