From: Sean Anderson Date: Wed, 19 Feb 2020 15:12:45 -0500 Subject: [PATCH v3] cmd: Add command to dump drivers and compatible strings In-Reply-To: References: <20200206170349.1151628-1-seanga2@gmail.com> Message-ID: <7dd1a704-3d3b-22ab-ac10-12025657bea0@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2/19/20 10:45 AM, Bin Meng wrote: > Hi Simon, > > On Fri, Feb 7, 2020 at 1:46 AM Simon Glass wrote: >> >> On Thu, 6 Feb 2020 at 10:03, Sean Anderson wrote: >>> >>> This adds a subcommand to dm to dump out what drivers are installed, and their >>> compatible strings. I have found this useful in ensuring that I have the correct >>> drivers compiled, and that I have put in the correct compatible strings. >>> >>> Signed-off-by: Sean Anderson >>> Reviewed-by: Bin Meng >>> Tested-by: Bin Meng >>> >>> --- >>> >>> Changes in v3: >>> - Add python test >>> >>> Changes in v2: >>> - Check if entry->of_match is NULL before accessing it >>> - Remove trailing newline in help message >>> >>> cmd/dm.c | 12 +++++++++++- >>> drivers/core/dump.c | 20 ++++++++++++++++++++ >>> include/dm/util.h | 3 +++ >>> test/py/tests/test_dm.py | 17 +++++++++++++++++ > > Is this what you're looking for? I thought we need something in > test/dm C test cases instead? Tests for commands seem to be python tests. I considered writing a dm test, but afiak that seems to be for testing function calls. There does not seem to be an easy way to grab the console output. Additionally, where would the authoritative list of installed drivers come from? The easiest way would be to just use the same api that the command is using, but this doesn't really test anything. As it is, the current test does an ok job at correlating different methods of accessing the DM system from the associated commands. It will also catch null-dereference bugs like the one I found during testing. --Sean