Home
last modified time | relevance | path

Searched hist:"022 a4bf6b59dfdb192ca8aef291c7346f984e511" (Results 1 – 3 of 3) sorted by relevance

/linux/scripts/kconfig/tests/
H A Dpytest.ini022a4bf6b59dfdb192ca8aef291c7346f984e511 Tue Mar 13 10:12:03 CET 2018 Masahiro Yamada <yamada.masahiro@socionext.com> kconfig: tests: add framework for Kconfig unit testing

Many parts in Kconfig are so cryptic and need refactoring. However,
its complexity prevents us from moving forward. There are several
naive corner cases where it is difficult to notice breakage. If
those are covered by unit tests, we will be able to touch the code
with more confidence.

Here is a simple test framework based on pytest. The conftest.py
provides a fixture useful to run commands such as 'oldaskconfig' etc.
and to compare the resulted .config, stdout, stderr with expectations.

How to add test cases?
----------------------

For each test case, you should create a subdirectory under
scripts/kconfig/tests/ (so test cases are separated from each other).
Every test case directory should contain the following files:

- __init__.py: describes test functions
- Kconfig: the top level Kconfig file for the test

To do a useful job, test cases generally need additional data like
input .config and information about expected results.

How to run tests?
-----------------

You need python3 and pytest. Then, run "make testconfig". O= option
is supported. If V=1 is given, detailed logs captured during tests
are displayed.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
H A Dconftest.py022a4bf6b59dfdb192ca8aef291c7346f984e511 Tue Mar 13 10:12:03 CET 2018 Masahiro Yamada <yamada.masahiro@socionext.com> kconfig: tests: add framework for Kconfig unit testing

Many parts in Kconfig are so cryptic and need refactoring. However,
its complexity prevents us from moving forward. There are several
naive corner cases where it is difficult to notice breakage. If
those are covered by unit tests, we will be able to touch the code
with more confidence.

Here is a simple test framework based on pytest. The conftest.py
provides a fixture useful to run commands such as 'oldaskconfig' etc.
and to compare the resulted .config, stdout, stderr with expectations.

How to add test cases?
----------------------

For each test case, you should create a subdirectory under
scripts/kconfig/tests/ (so test cases are separated from each other).
Every test case directory should contain the following files:

- __init__.py: describes test functions
- Kconfig: the top level Kconfig file for the test

To do a useful job, test cases generally need additional data like
input .config and information about expected results.

How to run tests?
-----------------

You need python3 and pytest. Then, run "make testconfig". O= option
is supported. If V=1 is given, detailed logs captured during tests
are displayed.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
/linux/scripts/kconfig/
H A DMakefilediff 022a4bf6b59dfdb192ca8aef291c7346f984e511 Tue Mar 13 10:12:03 CET 2018 Masahiro Yamada <yamada.masahiro@socionext.com> kconfig: tests: add framework for Kconfig unit testing

Many parts in Kconfig are so cryptic and need refactoring. However,
its complexity prevents us from moving forward. There are several
naive corner cases where it is difficult to notice breakage. If
those are covered by unit tests, we will be able to touch the code
with more confidence.

Here is a simple test framework based on pytest. The conftest.py
provides a fixture useful to run commands such as 'oldaskconfig' etc.
and to compare the resulted .config, stdout, stderr with expectations.

How to add test cases?
----------------------

For each test case, you should create a subdirectory under
scripts/kconfig/tests/ (so test cases are separated from each other).
Every test case directory should contain the following files:

- __init__.py: describes test functions
- Kconfig: the top level Kconfig file for the test

To do a useful job, test cases generally need additional data like
input .config and information about expected results.

How to run tests?
-----------------

You need python3 and pytest. Then, run "make testconfig". O= option
is supported. If V=1 is given, detailed logs captured during tests
are displayed.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>