Commit graph

811 commits

Author SHA1 Message Date
tengshuangshuang
40a890626d testing: specify arch format Kconfig
Specify architecture format in Kconfig to ensure proper configuration
handling for different architectures in testing modules.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-21 14:44:00 -03:00
wangchengdong
5456849446 ostest/hrtimer: Add threaded hrtimer tests
Add threaded hrtimer tests

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-21 00:29:40 +08:00
wangchengdong
840c4fceef ostest/hrtimer: align hrtimer callback declaration
align hrtimer callback declaration with latest update of hrtimer

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-21 00:29:40 +08:00
wangchengdong
19dd2531fb testing/ostest: fix build issue
fix:

  Building NuttX...

  /d/a/nuttx-apps/nuttx-apps/sources/apps/Application.mk:238: target 'signest.c.d.a.nuttx-apps.nuttx-  apps.sources.apps.testing.ostest.o' given more than once in the same rule

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-20 17:01:42 +01:00
wangchengdong
d9afe2db8c signals: fix build and runtime issues when signals all isabled
Fix build and runtime issues when signals all disabled.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-19 22:55:19 +08:00
wangchengdong
df30f84f33 ostest/hrtimer: sync hrtimer test with latest updates
Synchronize the hrtimer ostest with the latest hrtimer changes.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-19 08:37:08 -03:00
guoshichao
5595a01fcd watchdog: disable the drivertest_watchdog_api testcase on some platform
When we support the watchdog interrupt on the Armv7-A platform with
the TEE enabled, the watchdog interrupt needs to be configured as
a FIQ to avoid the impact of interrupt disabling in the AP.
In this case, the drivertest_watchdog_api testcase cannot pass the
test in such a scenario.

This is because the drivertest_watchdog_api itself requires
calling a specified callback after the watchdog interrupt is
triggered, instead of directly dumping the AP's context and
then asserting the system.

Therefore, when both CONFIG_ARCH_ARMV7A and CONFIG_ARCH_HAVE_TRUSTZONE
are enabled, we need to skip the current drivertest_watchdog_api
testcase.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-19 17:51:42 +08:00
wangchengdong
60d814efa2 sched/signal: Add support to disable partial or all signals
Fix dependency issue when signals are partially or fully enabled

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-15 15:48:54 +08:00
zhaoxingyu1
26fcdbd9ad mtdconfig/nvs: fix typo error in nvs testcase
such as: 2st->2nd, 3st->3rd and so on

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-15 10:26:21 +08:00
zhaoxingyu1
32facd5b3a mtd/nvs: testcases fit the situation where erasestate is 0
Special_id dynamically adjusts based on erase value

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-15 10:26:21 +08:00
zhaoxingyu1
58c2473b38 apps/testing: nvs testcases support remove align size
mtd/nvs removes CONFIG_MTD_WRITE_ALIGN_SIZE,
testcases need to be modified meanwhile

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-15 10:26:21 +08:00
haopengxiang
680dca1121 ltp: close mq_close/3-1 testcase when open CONFIG_FDCHECK
Caused the cause will used after free on fd

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-15 10:25:21 +08:00
ligd
429f24afbd ltp: close mq_close/4-1 testcase when open CONFIG_FDCHECK
Caused the cause will used after free on fd

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-15 10:25:21 +08:00
ligd
b7b2ba37a1 timer_test: reduce the sleep time to improve testing efficiency
reduce the sleep time

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-15 10:25:21 +08:00
Matteo Golin
8d4e872402 !testing/cmocka: Compile cmocka as a libary only by default
BREAKING CHANGE

This commit introduces a Kconfig switch to include the cmocka binary
built from cmocka_main.c. The default behaviour is now changed so that
cmocka is built as a library only, which would be the desired behaviour
for users creating their own cmocka projects.

To restore the old behaviour (where the cmocka program is compiled), add
CONFIG_TESTING_CMOCKA_PROG=y to your legacy configuration.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-01-12 10:14:55 +08:00
hujun5
21f4156048 sighand: need block WAKEUP_SIGNAL in current tcb
If the main thread receives the signal, the waiter_main will not be awakened.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-12 00:55:33 +08:00
wangchengdong
416c315f92 ostest: sync hrtimer ostest with hrtimer updates
Update the hrtimer ostest to reflect recent changes in the hrtimer
implementation.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-07 09:44:42 +08:00
buxiasen
188838469c kernel/syscall: fix required INET may case no support
We may possible enable socket and no ipv4

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-04 00:06:17 +08:00
zhangkai25
1ca7838482 apps/testing: add cmock_test for enet in order to test send and receive pkt
add cmock_test for enet in order to test send and receive pkt

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2025-12-29 22:30:56 +08:00
Matteo Golin
39310946ec testing/nuts: NuttX Unit Test Selection (NUTS) application.
Introduces a collection of unit tests for NuttX, built on top of the
cmocka framework. Tests are organized into suites/groups which can be
individually included/excluded from the build using Kconfig. Output is
easily legible and separated with headers including the test group name.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-12-28 10:28:14 +08:00
wangchengdong
fb4f80665d ostest/hrtimer: Fix typos
The current code incorrectly used the CONFIG_SCHED_EVENTS
macro in ostest.h for hrtimer_test(). This has been corrected to use CONFIG_HRTIMER.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-12-25 23:06:42 +08:00
wangchengdong
4d98ecccaf testing/ostest: add hrtimer API functional tests
Add functional tests for the newly added hrtimer APIs,
including hrtimer_init(), hrtimer_start(), and hrtimer_cancel().

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-24 09:52:18 +08:00
p-szafonimateusz
8856a587a6 testsuites/Kconfig: fix codespell issues
fix codespell issues

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-12-23 09:12:02 -03:00
p-szafonimateusz
951740627b testing/testsuites/Kconfig: add missing dependencies for test cases
add missing dependencies for test cases to avoid compilation errors

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-12-23 09:12:02 -03:00
p-szafonimateusz
008433dcfe testing/testsuites: add cmake support
add cmake support for testsuites

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Co-authored-by: v-wangshihang <v-wangshihang@xiaomi.com>
Co-authored-by: v-chenglong8 <v-chenglong8@xiaomi.com>
Co-authored-by: xuxin19 <xuxin19@xiaomi.com>
Co-authored-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-12-23 09:12:02 -03:00
Alan Carvalho de Assis
8cb7dd0694 apps/testing: Add pthread_mutex_perf created by Anchao
During the discussion about the impact of adding counter to TCB
Mr anchao created a pthread mutex performance example:
https://github.com/apache/nuttx/pull/17468#issuecomment-3660925314

Because this example can exercise (not ideally) the pthread mutex
I decided to add it to apps/testing/sched, the program name will
be called "pmutexp" (because "pmp" is not a good name).

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-16 20:57:58 -03:00
chenxiaoyi
a59436985c testing: getTimeofday_test: fix build warning
getTimeofday_test.c:68:22: error: variable 'cnt' set but not used [-Werror,-Wunused-but-set-variable]

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-12-10 12:17:44 +01:00
hujun5
24e1c4df6f testing/ostest/smp_call.c: fix smp_call cpu_set inconsistency issue
If we set CONFIG_SMP_DEFAULT_CPUSET=1
This will cause the value of cpuset to be 0x1,
((1 << CONFIG_SMP_NCPUS) - 1) will result in the cpuset being 0x11,
leading to test case errors.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-12-09 09:44:37 -05:00
raiden00pl
641f7ced84 testing/ltp: add ltp zip file to gitignore
add ltp zip file to gitignore

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-05 17:53:57 +01:00
raiden00pl
5549f66dc1 testing/memtester: fix build error for cmake
fix broken CMakeLists.txt for memtester

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-05 17:53:57 +01:00
raiden00pl
39cb6fefda testing/memtester: add memtester.zip to gitignore
add memtester.zip to gitignore

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-05 17:53:57 +01:00
raiden00pl
8c5c506e40 testing/cachetest: fix compilation error for arm64
fix compilation error:

cachetest_main.c:37:26: error: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
   37 | #define CACHETEST_PREFIX "CACHE Test: "
      |                          ^~~~~~~~~~~~~~
cachetest_main.c:150:20: note: in expansion of macro 'CACHETEST_PREFIX'
  150 |   syslog(LOG_INFO, CACHETEST_PREFIX "waddr:%p, uncacheble addr start:%p,"
      |                    ^~~~~~~~~~~~~~~~
cachetest_main.c:151:17: note: format string is defined here
  151 |          "size:%u\n", info->waddr,
      |                ~^
      |                 |
      |                 unsigned int
      |                %lu

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-05 17:53:57 +01:00
buxiasen
0f8bca6d8f testing/pm_smp: add more delay, avoid idle canot run one cycle
If the host performance low, possible not able to enter idle thread,
cause case break.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 19:10:11 +08:00
buxiasen
4ac0b10318 drivertest_uart: uart device open should use cfmakeraw to ensure raw.
reference: https://www.man7.org/linux/man-pages/man3/termios.3.html

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 19:09:41 +08:00
buxiasen
3bd8506ae8 testing/ostest/roundrobin: add compatible for SMP
Fix if SMP cause calculation run in multi-core cause case break.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 19:09:27 +08:00
buxiasen
b95c9980b5 apps/ostest/roundrobin: add fail detect and print
Before patch we never detect the roundrobin fail.
After patch use a array to detect if the calculation swapped when
processing.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 19:09:27 +08:00
buxiasen
d23eb01490 fs_stat_test: fix fs date case not strict enough
use utc diff should prefer and more strict.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 19:07:22 +08:00
caofuqi1
1c769d1410 testing/ltp: add cmake support
add cmake support for LTP

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Co-Authored: xuxin19 <xuxin19@xiaomi.com>
2025-11-19 01:38:36 +08:00
p-szafonimateusz
188d533dd2 testing/cmoka: fix cmake build
fix cmake build for cmoka:

   [2/9] No update step for 'cmocka_fetch-populate'
   [3/9] Performing patch step for 'cmocka_fetch-populate'
   can't find file to patch at input line 16
   Perhaps you used the wrong -p or --strip option?

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-11-18 21:59:42 +08:00
wangchengdong
bd10572851 testing/ostest: align wdog ostest with wdog bugfix
https://github.com/apache/nuttx/pull/17293 fixed
    wd_start bug, and this patch fixed the related ostest
    accordingly

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-10 10:44:53 +08:00
raiden00pl
91a7580303 testing/mm/cachetest/cachetest_main.c: fix codespell error
fix codespell error for cachetest_main.c

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-11-02 22:33:46 +08:00
raiden00pl
4f5fe44af1 testing/testsuites/kernel/socket/cases: fix compilation error
fix compilation error:

kernel/socket/cases/net_socket_test_010.c: In function ‘ioctltestinternal’:
kernel/socket/cases/net_socket_test_010.c:188:20: error: ‘siocgifname’ undeclared (first use in this function)
  188 |   ret = ioctl(sfd, siocgifname, &ifr);

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-11-02 22:33:46 +08:00
raiden00pl
0a906edd81 testing/mm/cachetest/cachetest_main.c: fix compilation error
fix compilation error:

cachetest_main.c: In function ‘cachetest_main’:
cachetest_main.c:240:7: error: implicit declaration of function ‘up_flush_dcache’ [-Wimplicit-function-declaration]
  240 |       up_flush_dcache((uintptr_t)info.waddr, (uintptr_t)info.waddr +

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-11-02 22:33:46 +08:00
raiden00pl
1f1240a0f4 testing/drivers/fftest/fftest.c: fix compilation error
fix compilation error:

CC:  vfs/fs_rmdir.c fftest.c: In function ‘fftest_main’:
fftest.c:104:7: error: implicit declaration of function ‘ioctl’ [-Wimplicit-function-declaration]
  104 |   if (ioctl(fd, EVIOCGBIT, fffeatures) < 0)

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-11-02 22:33:46 +08:00
trns1997
a44d65c939 testing/cxx-oot-build: Exclude cxx-oot-build in CMake projects.
Remove the previous guard logic and use a proper CMake
`exclude` rule to prevent `cxx-oot-build` from being
included when building projects with CMake.

* Ensures OOT test project is not pulled into normal apps.
* Keeps CI and export tests isolated from regular builds.

Signed-off-by: trns1997 <trns1997@gmail.com>
2025-10-15 14:34:32 +08:00
trns1997
3684699190 testing/cxx-oot-build: Add out-of-tree build test.
Add the source content for the out-of-tree build test
under `apps/testing/cxx-oot-build`. This supports the
new CI check in NuttX to prevent regressions in the
`make export` workflow.

The test project provides:
* Sample OOT build structure.
* Integration with exported `nuttx-export`.
* Verification of successful build and link.

Signed-off-by: trns1997 <trns1997@gmail.com>
2025-09-25 18:32:38 +08:00
wangchengdong
1b9d420e79 sched/event: add nxevent_getmask tests
add test cases for the new nxevent_getmask() function

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-10 13:59:04 +08:00
wangchengdong
7c5800924a testing/ostest: add nxevent_clear() test cases
Add test cases to verify the new recently added nxevent_clear() api

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-09 15:36:01 +08:00
Matteo Golin
d334c5eb67 apps/unity: Add printf configuration
Allows the user to select whether or not they want access to the Unity
``TEST_PRINTF`` commands.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-07 11:21:57 +08:00
wangmingrong1
3f823f9f25 kasantest: -fno-builtin is enabled by default
The strlen function called by kasantest will be optimized by the compiler, and the strlen function implemented in NX will not be called. Adding -fno-builtin can solve the problem.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-07-18 22:42:25 +08:00