mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-26 08:42:40 +01:00
Display line number with assertion for failed test cases
Summary: We use custom `assert*` functions here and there. Remove them from backtrace. Test Plan: Ran `XHPASTTreeTestCase`. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D6411
This commit is contained in:
parent
f5ceceea87
commit
ad9cb418c4
1 changed files with 6 additions and 2 deletions
|
@ -52,8 +52,12 @@ abstract class ArcanistPhutilTestCase {
|
|||
$expect = PhutilReadableSerializer::printableValue($expect);
|
||||
$result = PhutilReadableSerializer::printableValue($result);
|
||||
|
||||
$where = debug_backtrace();
|
||||
$where = array_shift($where);
|
||||
foreach (debug_backtrace() as $location) {
|
||||
if (!preg_match('/^assert[A-Z]/', idx($location, 'function'))) {
|
||||
break;
|
||||
}
|
||||
$where = $location;
|
||||
}
|
||||
|
||||
$line = idx($where, 'line');
|
||||
$file = basename(idx($where, 'file'));
|
||||
|
|
Loading…
Reference in a new issue