[yocto] Python3 ptest and unittest

Paul Barker paul at paulbarker.me.uk
Tue Feb 18 13:27:31 PST 2014


I've just thrown together a couple of things which may be useful.
They're currently slightly hackish but I could improve them and share
them/submit them as patches if wanted:

1) I've wrote a custom python test runner which runs test suites and
outputs the format expected by ptest natively instead of needing the
sed magic in "openembedded-core/meta/recipes-devtools/python/python/run-ptest".
I'm using it in my own project, might move the opkg test suite over to
it if I have time, and it might be useful for any other python test
suites. It's <50 lines of python :)

2) I've wrote a script which patches this test runner into python3's
own testsuite then runs the suite. You don't even to patch the
Makefile from the python source tree and install it (as in the python
recipe in openembedded-core). It should run on anything with python3
installed with the python standard library (as the standard library
already includes all the tests). This may be a good option for adding
ptest support to the python3 recipe - it'd just be a single 50-line
'run-ptest' script written in python.

Does that sound interesting to anyone else?

-- 
Paul Barker

Email: paul at paulbarker.me.uk
http://www.paulbarker.me.uk



More information about the yocto mailing list