From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Mon, 23 Nov 2015 16:55:49 -0700 Subject: [U-Boot] [PATCH] Implement pytest-based test infrastructure In-Reply-To: <20151123234415.GE9551@bill-the-cat> References: <1447570381-1361-1-git-send-email-swarren@wwwdotorg.org> <564E0030.9090808@wwwdotorg.org> <20151123234415.GE9551@bill-the-cat> Message-ID: <5653A785.4010709@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/23/2015 04:44 PM, Tom Rini wrote: > On Thu, Nov 19, 2015 at 10:00:32AM -0700, Stephen Warren wrote: ... >> See the following in test/py/README.md: >> >>> ## Requirements >>> >>> The test suite is implemented using pytest. Interaction with the U-Boot >>> console uses pexpect. Interaction with real hardware uses the tools of your >>> choice; you get to implement various "hook" scripts that are called by the >>> test suite at the appropriate time. >>> >>> On Debian or Debian-like distributions, the following packages are required. >>> Similar package names should exist in other distributions. >>> >>> | Package | Version tested (Ubuntu 14.04) | >>> | -------------- | ----------------------------- | >>> | python | 2.7.5-5ubuntu3 | >>> | python-pytest | 2.5.1-1 | >>> | python-pexpect | 3.1-1ubuntu0.1 | >> >> In the main Python code, I trapped at least one exception location >> and made it print a message about checking the docs for missing >> requirements. I can probably patch the top-level test.py to do the >> same. > > Isn't there some way to inject the local to U-Boot copy of the libraries > in? I swear I've done something like that before in python.. It would certainly be possible to either check in the required Python libraries in the U-Boot source tree, or include instructions for people to manually create a "virtualenv" (or perhaps even automatically do this from test.py). However, I was hoping to avoid the need to for that since those options are a bit more complex than "just install these 3 packages and run the script". (And in fact I've already mentioned virtualenv-based setup instructions in the README for people which archaic distros). Still, if we find that varying versions of pytest/pexpect don't work well, we could certainly choose one of those options. BTW, I've created a ton of patches on top of all these that I haven't posted yet. See: git://github.com/swarren/u-boot.git tegra_dev I'm not sure if I should squash all that into a V2 of this patch, or just post them all as incremental fixes/enhancements?