Also:
- Add "RT_" prefix for utest config options.
- Rename the case names to following the naming rule.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Also:
- Add "RT_" prefix for the UTEST config options.
- Follow the naming rules to update the case name.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Also,
- Rename UTEST_SMP_CALL_FUNC to RT_UTEST_SMP_CALL_FUNC.
- Add depends on RT_USING_SMP in Kconfig for RT_UTEST_SMP_CALL_FUNC
- Follow the naming rules of utest case to update the cases' name.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Add dependent of RT_USING_SERIAL_V2 in Kconfig to
make sure utest for serial_v2 is only available
when RT_USING_SERIAL_V2 is enabled.
Otherwise menuconfig allow people enable UTEST_SERIAL_TC
but building of utestcases failed. It looks weird and
better to be fixed.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Add dependent of RT_USING_SERIAL_BYPASS in Kconfig to
make sure utest for serial-bypass is only available
when RT_USING_SERIAL_BYPASS is enabled.
Otherwise building of utestcases failed when UTEST_SERIAL_BYPASS
is enabled.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
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>
* 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>
Change the entry of utest's Kconfig from
'examples/utest/testcases/Kconfig' to
'Kconfig.utestcases'.
Modified the build scripts where the path name
is "examples/utest/testcases/Kconfig" and changed
it to 'Kconfig.utestcases', otherwise build
operations such 'scons --dist' may fail.
In the future, the testcase source code of
utest will be placed in each module for
maintenance, but the entry of Kconfig will all
be placed in Kconfig.utestcases for unified
maintenance. In this way, when executing menuconfig,
people can enter and configure from one place,
avoiding searching for utest configuration switches
here and there in the menuconfig interface.
For each module, you can maintain unit-test
in a unified manner in the following way:
- Create a subdirectory named 'utest' in the
directory where your module is located.
- Store the following files in the utest subdirectory:
- Unit test case program source code files for this
module.
- Kconfig file, add configuration options for the
unit test files of this module, the recommended
option is named RT_UTEST_TC_USING_XXXX, XXXX is the
global unique module name of this module.
- SConscript file, note that when adding src files,
in addition to relying on RT_UTEST_TC_USING_XXXX,
you must also rely on RT_UTEST_USING_ALL_CASES, the
two dependencies are in an "or" relationship. The
role of RT_UTEST_USING_ALL_CASES is that once this
option is turned on, all unit tests will be enabled
to avoid selecting one by one.
After completing the above steps, add the path of the
Kconfig file of utest of this module to the
Kconfig.utestcases file.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
* add sys pref frameworks
* add context switch test code
* add irq latency test code
* add thread sem test code
* add thread event test code
* add thread mbox test code
* add thread mq test code
* Adding a Test Documentation Note
* Modification of text description
This is required so the user will not be confused on waiting for test to complete.
Changes:
- notify user that the test is not corrupted
- expand waiting tick on timed mtx test, for compatibility on different hw.
Signed-off-by: Shell <smokewood@qq.com>
* [libcpu/arm64] add C11 atomic ticket spinlock
Replace the former implementation of flag-based spinlock which is unfair
Besides, C11 atomic implementation is more readable (it's C anyway),
and maintainable. Cause toolchain can use their builtin optimization and
tune for different micro-architectures. For example armv8.5 introduces a
better instruction. The compiler can help with that when it knows your
target platform in support of it.
Signed-off-by: Shell <smokewood@qq.com>
* fixup: RT_CPUS_NR
---------
Signed-off-by: Shell <smokewood@qq.com>
* [ipc] lockless rt_completion implementation
The new rt_completion implemented by lockless algorithm can improve timer resolution for up to ~12%, compare to sem IPC.
Signed-off-by: Shell <smokewood@qq.com>
* fixup: error
* remove useless changes
---------
Signed-off-by: Shell <smokewood@qq.com>