diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-03-20 21:36:50 +0100 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-05-07 22:04:54 +0200 |
commit | a732fb222b8a60076a93d490834d459b0a1c1d6b (patch) | |
tree | 8c79a7249134bb17016dc71335c61f6d4351ab64 /support/testing/conf/unittest.cfg | |
parent | 04829295c78bd49f4d6238f2ffdb03d744202932 (diff) | |
download | buildroot-a732fb222b8a60076a93d490834d459b0a1c1d6b.tar.gz buildroot-a732fb222b8a60076a93d490834d459b0a1c1d6b.zip |
support/testing: core testing infrastructure
This commit adds the core of a new testing infrastructure that allows to
perform runtime testing of Buildroot generated systems. This
infrastructure uses the Python unittest logic as its foundation.
This core infrastructure commit includes the following aspects:
- A base test class, called BRTest, defined in
support/testing/infra/basetest.py. This base test class inherited
from the Python provided unittest.TestCase, and must be subclassed by
all Buildroot test cases.
Its main purpose is to provide the Python unittest setUp() and
tearDown() methods. In our case, setUp() takes care of building the
Buildroot system described in the test case, and instantiate the
Emulator object in case runtime testing is needed. The tearDown()
method simply cleans things up (stop the emulator, remove the output
directory).
- A Builder class, defined in support/testing/infra/builder.py, simply
responsible for building the Buildroot system in each test case.
- An Emulator class, defined in support/testing/infra/emulator.py,
responsible for running the generated system under Qemu, allowing
each test case to run arbitrary commands inside the emulated system.
- A run-tests script, which is the entry point to start the tests.
Even though I wrote the original version of this small infrastructure, a
huge amount of rework and improvement has been done by Maxime
Hadjinlian, and squashed into this patch. So many thanks to Maxime for
cleaning up and improving my Python code!
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support/testing/conf/unittest.cfg')
-rw-r--r-- | support/testing/conf/unittest.cfg | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/support/testing/conf/unittest.cfg b/support/testing/conf/unittest.cfg new file mode 100644 index 0000000000..6eaa234fc9 --- /dev/null +++ b/support/testing/conf/unittest.cfg @@ -0,0 +1,6 @@ +[unittest] +plugins = nose2.plugins.mp + +[multiprocess] +processes = 1 +always-on = True |