Many modules' utests currently don't support enabling all
tests at once. Furthermore, some modules' tests are complex,
for example due to their numerous dependencies on other
modules. This makes it nearly impossible to enable all
tests with a single global switch. Consequently, the
previously defined `RT_UTEST_USING_ALL_CASES` has lost
its original meaning.
We recommend deprecating this configuration switch. If a
module needs to enable a group of functional tests through
its own configuration, this local enable all switch should
be implemented by the module itself, and a global RTT enable
switch will no longer be provided.
If such a requirement arises in the future, we recommend
careful design, especially considering how to ensure that
turning on a single switch enables all dependencies for
all involved modules for ease of use.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
The names of the utest cases defined in their respective
modules have been updated.
Some utest case names are not yet in their respective modules
because their paths need to be finalized before their unique
names can be determined. Currently, these names do not
appear to conflict with the unified names. These include:
- utest cases still in examples
- bsp/qemu-virt64-riscv/applications/test/test_vector/test_vector.c.
The entire test case should probably be placed in libcpu/risc-v
rather than bsp.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
* utest: move testcases of Utest from example to Utest folder
Create unit-test-cases for the Utest framework subsystem
according to "How to add utest cases into RT-Thread for your module." [1]
Link:
https://rt-thread.github.io/rt-thread/page_component_utest.html#autotoc_md804
[1]
The original `components/utilities/utest` directory already has unit
testcases, which are more comprehensive than the testcases in
`examples/utest/testcases/utest/`. Therefore, simply deleted
the test cases in `examples` and used the existing testcases
in the utest framework.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
* utest/utest: rename name and add license text
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
---------
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
There is a problem with the matching of case names
in the original code. Due to original code use memcmp
with len, if the input case name and the existing
case name have an inclusion relationship, for example,
if the actual case name is "gpip_irq", and run
`utest_run gpio` will also match successfully, but it's
not expected.
Modify the logic of exact matching and use strcmp instead.
Keep the original wildcard logic, that is,
`utest_run gpio*` can match both "gpio_irq" and "gpio".
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
* [utest] remove delay for on thread testing
The delay is introduced from 0dc7b9a5a2.
Though this is unnecessary for on sync utest.
So this is removed by a new entry and delay for asynchronous utest only.
Signed-off-by: Shell <smokewood@qq.com>
* fixup: msh cmd prototype
---------
Signed-off-by: Shell <smokewood@qq.com>