[OE-core] [PATCH] classes/testsdk: Split implementation into classes

Joshua Watt jpewhacker at gmail.com
Thu Nov 15 22:28:42 UTC 2018


On Thu, 2018-11-15 at 19:40 +0000, Richard Purdie wrote:
> On Thu, 2018-11-15 at 13:14 -0600, Joshua Watt wrote:
> > Splits the SDK test implementation into separate class files. The
> > classes that are included are controlled by the variable
> > ${TESTSDK_CLASSES}. This allows a SDK machine to change which
> > classes
> > are used to implement the test cases.
> > 
> > [YOCTO #13020]
> > 
> > Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
> > ---
> >  meta/classes/testsdk-oecore.bbclass    |  88 +++++++++++
> >  meta/classes/testsdk.bbclass           | 202 ++-------------------
> > --
> > --
> >  meta/classes/testsdkext-oecore.bbclass | 107 +++++++++++++
> >  3 files changed, 205 insertions(+), 192 deletions(-)
> >  create mode 100644 meta/classes/testsdk-oecore.bbclass
> >  create mode 100644 meta/classes/testsdkext-oecore.bbclass
> 
> Would it make more sense to move some of this code to 'proper' python
> library/classes under meta/lib/oe ?
> 
> We did this with package_managers and I'd say it probably did improve
> things...
> 
> We probably don't want/need more bbclass files, particularly when
> they
> just include each other.

Organizationally, using Python classes for the main code makes a lot of
sense, but I believe you would still need the 3 (or 2 if you combine
testsdk-oecore and testsdkext-oecore) classes, since you want the
single entry point of testsdk.bbclass, but need to be able to override
how it gets implemented (unless I'm missing something)...

The files would basically boil down to:

---- classes/testsdk.bbclass ----

TESTSDK_CLASSES ?= "testsdk-oecore testsdkext-oecore"

inherit ${TESTSDK_CLASSES}

---- classes/testsdk(ext)?-oecore.bbclass ----

python do_testsdk() {
    from oeqa.sdk.testsdk import TestSDK
    t = TestSDK(d)
    t.run()
}

----

It might make things a little more clear if I describe the end game; I
would like to provide a different class to implement the MinGW SDK
tests. This would be done by adding the following to the MinGW SDK
machine.conf file (mingw32-common.inc):

 TESTSDK_CLASSES = "testsdk-mingw"

Then, adding a new class in meta-mingw

---- classes/testsdk-mingw.bbclass ----

python do_testsdk() {
    from oeqa.sdk.testsdkmingw import TestSDKMinGW
    t = TestSDKMinGW(d)
    t.run()
}

----

AFAICT, this is pretty similar to how the package managers are working.

Did you had something else in mind?

> 
> Cheers,
> 
> Richard
> 
-- 
Joshua Watt <JPEWhacker at gmail.com>



More information about the Openembedded-core mailing list