From: epriestley Date: Wed, 4 Jan 2012 15:02:41 +0000 (-0800) Subject: Slightly improve Arcanist unit test output messages X-Git-Tag: conduit-4~203 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=91d273a7dd9a113da47a96c4618bbfaae74b331d;p=arcanist.git Slightly improve Arcanist unit test output messages Summary: - Show file/line so you can tell which assertion failed if there's a block with a zillion of them and they don't have messages. - Try to format stuff a little better. Test Plan: - Ran some failing unit tests. Reviewers: btrahan, jungejason Reviewed By: btrahan CC: aran, btrahan Differential Revision: https://secure.phabricator.com/D1304 --- diff --git a/src/unit/engine/phutil/testcase/ArcanistPhutilTestCase.php b/src/unit/engine/phutil/testcase/ArcanistPhutilTestCase.php index 2b8b8c27..a7e6e1f7 100644 --- a/src/unit/engine/phutil/testcase/ArcanistPhutilTestCase.php +++ b/src/unit/engine/phutil/testcase/ArcanistPhutilTestCase.php @@ -1,7 +1,7 @@ failTest($message); - throw new ArcanistPhutilTestTerminatedException($message); + $output .= "Expected: {$expect}\n"; + $output .= "Actual: {$result}"; + + $this->failTest($output); + throw new ArcanistPhutilTestTerminatedException($output); } diff --git a/src/unit/engine/phutil/testcase/__init__.php b/src/unit/engine/phutil/testcase/__init__.php index 7f7dbd12..6a8819e9 100644 --- a/src/unit/engine/phutil/testcase/__init__.php +++ b/src/unit/engine/phutil/testcase/__init__.php @@ -9,5 +9,8 @@ phutil_require_module('arcanist', 'unit/engine/phutil/testcase/exception'); phutil_require_module('arcanist', 'unit/result'); +phutil_require_module('phutil', 'readableserializer'); +phutil_require_module('phutil', 'utils'); + phutil_require_source('ArcanistPhutilTestCase.php');