poky/meta/lib/oeqa/core
Leonardo Sandoval 28a1d1973d core/loader.py: fix regex to include all available test cases
Some test cases (eSDK.oeSDK*, runtime_test/*) does not match
with current regex, fix it accept all.

[YOCTO #12385]

(From OE-Core rev: 1ecf48fd286a77078451b67879a44f9c9dc7a894)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-04 12:57:42 +00:00
..
cases oeqa/core/cases: Add example test cases 2017-01-23 12:05:18 +00:00
decorator oeqa/core/decorator/oetimeout: Add support for OEQA threaded mode 2017-06-02 13:36:14 +01:00
target oeqa/qemu: remove elf image type 2018-01-02 17:24:37 +00:00
tests oeqa/core/tests: Add tests of OEQA Threaded mode 2017-06-02 13:36:14 +01:00
utils meta: remove remaining True option to getVar calls 2017-01-31 14:43:02 +00:00
__init__.py
case.py oeqa/core/case: fix typo on comment about exception name 2017-06-02 13:36:14 +01:00
context.py context: Include a command line argument to run all except certain tests 2017-08-13 09:27:37 +01:00
exception.py oeqa/{core,selftest}: Add support to validate if a specified test case isn't found 2017-07-30 08:46:19 +01:00
loader.py core/loader.py: fix regex to include all available test cases 2018-01-04 12:57:42 +00:00
README oeqa/core: Improve grammar in README and loader comments 2017-06-05 09:19:51 +01:00
runner.py oeqa/runner: Pass the value of buffer, don't force to True 2017-11-11 12:14:26 +00:00
threaded.py oeqa/core/threaded: Don't assume that results exists on logDetails 2017-06-23 11:44:12 +01:00

= OEQA (v2) Framework =

== Introduction ==

This is version 2 of the OEQA framework. Base clases are located in the 'oeqa/core' directory and subsequent components must extend from these.

The main design consideration was to implement the needed functionality on top of the Python unittest framework. To achieve this goal, the following modules are used:

* oeqa/core/runner.py: Provides OETestResult and OETestRunner base
  classes extending the unittest class. These classes support exporting
  results to different formats; currently RAW and XML support exist.

* oeqa/core/loader.py: Provides OETestLoader extending the unittest class.
  It also features a unified implementation of decorator support and
  filtering test cases.

* oeqa/core/case.py: Provides OETestCase base class extending
  unittest.TestCase and provides access to the Test data (td), Test context
  and Logger functionality.

* oeqa/core/decorator: Provides OETestDecorator, a new class to implement
  decorators for Test cases.

* oeqa/core/context: Provides OETestContext, a high-level API for
  loadTests and runTests of certain Test component and
  OETestContextExecutor a base class to enable oe-test to discover/use
  the Test component.

Also, a new 'oe-test' runner is located under 'scripts', allowing scans for components that supports OETestContextExecutor (see below).

== Terminology ==

* Test component: The area of testing in the Project, for example: runtime, SDK, eSDK, selftest.

* Test data: Data associated with the Test component. Currently we use bitbake datastore as
  a Test data input.

* Test context: A context of what tests needs to be run and how to do it; this additionally
  provides access to the Test data and could have custom methods and/or attrs.

== oe-test ==

The new tool, oe-test, has the ability to scan the code base for test components and provide a unified way to run test cases. Internally it scans folders inside oeqa module in order to find specific classes that implement a test component.

== Usage ==

Executing the example test component

$ source oe-init-build-env
$ oe-test core

Getting help

$ oe-test -h

== Creating new Test Component ==

Adding a new test component the developer needs to extend OETestContext/OETestContextExecutor (from context.py) and OETestCase (from case.py)

== Selftesting the framework ==

Run all tests:

$ PATH=$PATH:../../ python3 -m unittest discover -s tests

Run some test:

$ cd tests/
$ ./test_data.py