608 Commits

Author SHA1 Message Date
Alan Carvalho de Assis
9500938d44 testing/sensortest: Add support to Speed Sensors
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-12-20 08:52:42 +08:00
Xiang Xiao
adb4c3b555 testing/testsuites: Fix format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'size_t'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-12-19 04:22:09 +01:00
zhangshoukui
cebd77c614 fs cases: fix compile error
kernel/fs/cases/fs_stream_test.c:279:70: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=]
  279 |           syslog(LOG_ERR, "len = %zi != return value from fwrite = %zi",
      |                                                                    ~~^
      |                                                                      |
      |                                                                      long int
      |                                                                    %i
  280 |                  len, ret);
      |                       ~~~
      |                       |
      |                       int
kernel/fs/cases/fs_stream_test.c:311:69: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=]
  311 |           syslog(LOG_ERR, "len = %zi != return value from fread = %zi",
      |                                                                   ~~^
      |                                                                     |
      |                                                                     long int
      |                                                                   %i
  312 |                  len, ret);
      |                       ~~~
      |                       |
      |                       int

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-12-19 04:22:09 +01:00
Tiago Medicci
231827e84e ostest: Add test for GCC's tls (CONFIG_SCHED_THREAD_LOCAL)
Enables testing the GCC thread local storage (tls) and the __thread
keyword within ostest.
2024-12-18 22:46:04 +08:00
tengshuangshuang
1e199e4d4f test:add mutex socket syscall directory
some test cases have been added that cover the functionality of fs, mutex, pthread, socket, and syscall

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2024-12-18 17:43:33 +08:00
zhangshoukui
2e0b577680 drivertest_uart: The string was not truncated because one more character was read
#0 0x43c7443a in strnlen nuttx/libs/libc/string/lib_strnlen.c:42
    #1 0x43c698aa in vsprintf_internal nuttx/libs/libc/stdio/lib_libvsprintf.c:933
    #2 0x43c6ca80 in lib_vsprintf nuttx/libs/libc/stdio/lib_libvsprintf.c:1383
    #3 0x4409c0bd in vsnprintf nuttx/libs/libc/stdio/lib_vsnprintf.c:72
    #4 0x47137cd0 in vcmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2097
    #5 0x47139573 in cmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2422
    #6 0x471376ff in string_equal_display_error apps/testing/cmocka/cmocka/src/cmocka.c:1410
    #7 0x471379a0 in _assert_string_equal apps/testing/cmocka/cmocka/src/cmocka.c:1952
    #8 0x4433d972 in read_default apps/testing/drivertest/drivertest_uart.c:242
    #9 0x4713c6cd in cmocka_run_one_test_or_fixture apps/testing/cmocka/cmocka/src/cmocka.c:3029
    #10 0x4713d487 in cmocka_run_one_tests apps/testing/cmocka/cmocka/src/cmocka.c:3143
    #11 0x4713f2ca in _cmocka_run_group_tests apps/testing/cmocka/cmocka/src/cmocka.c:3294
    #12 0x443444c6 in cmocka_driver_uart_main apps/testing/drivertest/drivertest_uart.c:358
    #13 0x4409a472 in nxtask_startup nuttx/libs/libc/sched/task_startup.c:72
    #14 0x43dc92e7 in nxtask_start nuttx/sched/task/task_start.c:116
    #15 0x43e31f00 in pre_start nuttx/arch/sim/src/sim/sim_initialstate.c:52

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-12-17 16:06:13 +08:00
Lup Yuen Lee
9c5568c2af testing/ltp: Increase Stack Size
Inside CI Build risc-v-05: `rv-virt:citest` fails with a Stack Overflow at ltp_interfaces_pthread_barrierattr_init_2_1:
- https://github.com/apache/nuttx/issues/15170

This PR doubles the Stack Size for `testing/ltp` (from 4096 bytes to 8192), so that `rv-virt:citest` completes successfully.
2024-12-17 02:20:15 +08:00
buxiasen
1f8b9aa74c drivertest: update comment in driver test Kconfig
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-11 01:28:27 +08:00
buxiasen
b232fa42cf drivertest: add arm-m signal through isr case
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-11 01:28:27 +08:00
wangmingrong1
f1ae5f32f5 mtetest: Add a series of tests for the mte instruction set
Added basic mte instructions, ldg, stg, irg, gmi instruction tests

➜  NX git:(master) ✗ qemu-system-aarch64 -cpu max -nographic \
        -machine virt,virtualization=on,gic-version=3,mte=on \
        -chardev stdio,id=con,mux=on, -serial chardev:con \
        -mon chardev=con,mode=readline  -kernel ./nuttx/nuttx
- Ready to Boot Primary CPU
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize

NuttShell (NSH)
nsh>
nsh>
nsh> mtetest
Spawning process for test: mtetest1
Running test: mtetest1
Test 'mtetest1' completed
Spawning process for test: mtetest2
Running test: mtetest2
Test 'mtetest2' completed
Spawning process for test: mtetest3
Running test: mtetest3
Test 'mtetest3' completed
Spawning process for test: mtetest4
Running test: mtetest4
Test 'mtetest4' completed
Spawning process for test: mtetest5
Running test: mtetest5
Test 'mtetest5' completed
All tests completed.
nsh>

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-06 19:44:12 -03:00
wangmingrong1
818a3e6b63 kasantest.c: Adding Dependencies
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-04 22:36:04 +08:00
YAMAMOTO Takashi
365869b0a2 testing/ostest/signest.c: fix the range of signals
Note that MAX_SIGNO is a valid signal number.
2024-11-22 13:31:33 +08:00
YAMAMOTO Takashi
54a571fc92 testing/ostest/wdog.c: remove a set-only global 2024-11-22 13:31:19 +08:00
hujun5
d9d851813e testing: add iob test
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-17 21:10:25 +08:00
haopengxiang
f67097662f build(bugfix):fix uClibc++ layout build error
make[2]: *** No rule to make target '/home/nuttx/libs/libxx/uClibc++/tests/testframework.cpp',
needed by '/home/nuttx/libs/libxx/uClibc++/tests/testframework.cpp.home.apps.testing.uclibcxx_test.o'.  Stop.

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2024-11-16 21:33:32 +01:00
anjiahao
59855a1a67 remove <nuttx/xxx.h> in stdio need add depend header file
libuv:
CC:  pthread/pthread_mutexattr_setrobust.c libuv/src/unix/thread.c: In function ‘uv_thread_create_ex’:
libuv/src/unix/thread.c:174:24: error: storage size of ‘param’ isn’t known
  174 |     struct sched_param param;
      |                        ^~~~~

btsak_main:
In file included from btsak_main.c:39:
btsak.h:149:1: error: unknown type name ‘bool’
  149 | bool btsak_str2bool(FAR const char *str);

pipe_main.c:
CC:  sim/sim_registerdump.c pipe_main.c:44:30: error: unknown type name ‘pthread_addr_t’
   44 | static void *open_write_only(pthread_addr_t pvarg)
      |                              ^~~~~~~~~~~~~~
pipe_main.c: In function ‘pipe_main’:
pipe_main.c:81:3: error: unknown type name ‘pthread_t’
   81 |   pthread_t writeonly;

redirect_test.c: In function ‘redirection_test’:
redirect_test.c:205:3: error: unknown type name ‘pthread_t’
  205 |   pthread_t readerid;
      |   ^~~~~~~~~
redirect_test.c:206:3: error: unknown type name ‘pthread_t’
  206 |   pthread_t writerid;
      |   ^~~~~~~~~

drivertest_posix_timer.c:48:29: error: ‘optarg’ undeclared (first use in this function)
   48 |       value = (type)strtoul(optarg, &ptr, base);                      \

drivertest_posix_timer.c:208:3: warning: implicit declaration of function ‘sleep’ [-Wimplicit-function-declaration]
  208 |   sleep(SLEEPSECONDS);
      |   ^~~~~

drivertest_uart.c:92:13: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration]
   92 |       len = read(fd, &tmp_char, 1);
      |             ^~~~
      |             fread

drivertest_uart.c:323:44: error: ‘optopt’ undeclared (first use in this function)
  323 |             printf("Unknown option: %c\n", optopt);

kernel/fs/cases/fs_getfilep_test.c:71:9: warning: implicit declaration of function ‘fs_getfilep’ [-Wimplicit-function-declaration]
   71 |   ret = fs_getfilep(fileno(fp), &filep);
      |         ^~~~~~~~~~~

kernel/mm/cases/mm_test_008.c:148:9: warning: implicit declaration of function ‘task_create’; did you mean ‘timer_create’? [-Wimplicit-function-declaration]
  148 |   pid = task_create("TestNuttx08_routine_1",
      |         ^~~~~~~~~~~
      |         timer_create

/home/ajh/work/nuttxwork/apps/testing/cmocka/cmocka_main.c:171:11: warning: implicit declaration of function ‘setenv’ [-Wimplicit-function-declaration]
  171 |           setenv("CMOCKA_XML_FILE", xml_path, 1);
      |           ^~~~~~

drivertest_pm_runtime.c:123:7: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration]
  123 |       usleep(210 * 1000);
      |       ^~~~~~

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-13 16:49:12 +08:00
cuiziwei
2a76d17e10 cxxtest: Add static string test.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-11-13 13:18:17 +08:00
anjiahao
dfbf408567 stdio.h:Remove unnecessary header file, app header change
stdio.h remove <nuttx/xxxx.h>  Some .c previously depended on
<nuttx/xxx.h> and needed to be added to .c instead of stdio.h

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-12 19:37:10 +08:00
wangjianyu3
3da204c23e Pack parameters of nsh_execute() as struct nsh_exec_param_s
1. Input redirect flags currently is hardcode, passing by arguments maybe better.
2. Only support redirect to path_name, redirect to fd is needed for pipeline.

Test
  1. Redirect in
    cat < /etc/init.d/rc.sysinit

  2. Redirect with FIFO
    mkfifo /dev/testfifo
    cat /dev/testfifo &
    ls > /dev/testfifo

  3. NSH Params
    set name `uname`
    echo $name

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-11 10:36:46 +08:00
hujun5
e2a21337ac ostest/pthread_rwlock: We need to wait for race_cond_thread2
to acquire the rdlock first, otherwise it may cause a deadlock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-10 00:54:35 +08:00
hujun5
39908cc40c isrthread: add configuring the stack of an isrthread as static
reason:
we configure the isr thread stack as static to allow for more flexible placement of the stack.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-08 01:49:20 +08:00
hujun5
748a4d6b8f fix compile error
Error: smp_call.c:36:31: error: 'g_call_data' defined but not used [-Werror=unused-variable]
   36 | static struct smp_call_data_s g_call_data;
      |                               ^~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [/github/workspace/sources/apps/Application.mk:237: smp_call.c.github.workspace.sources.apps.testing.ostest.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:52: /github/workspace/sources/apps/testing/ostest_all] Error 2
make[1]: Target 'all' not remade because of errors.
make: *** [tools/LibTargets.mk:248: /github/workspace/sources/apps/libapps.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-06 17:28:18 +08:00
hujun5
a320e6dda5 smpcall: add nxsched_smp_call_async and nxsched_smp_call_single_async
reason:
The old implementation of the SMP call, even when using the "no wait" parameter,
could still result in waiting, if invoking it within a critical section
may lead to deadlocks. Therefore, in order to implement a truly asynchronous SMP
call strategy, we have added nxsched_smp_call_async.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-06 09:53:35 +08:00
zhangning21
d2205f8759 add x86-64-ABI/.gitignore
Signed-off-by: zhangning21 <zhangning21@xiaomi.com>
2024-10-29 12:30:42 +08:00
ligd
48db89158a ostest: update wqueue test for new API
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-29 01:22:29 +08:00
buxiasen
36be4a08ed resmonitor: add showinfo/filldisk/fillcpu/fillmem from test/
add cmake support

after enable TESTING_RESMONITOR, use showinfo -i 2 can show cpuload to
syslog every two seconds.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:36 +08:00
liwenxiang1
a526a4a173 app/testing:Add x86_64 abi test cases
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>

app/testing:Add x86_64 abi test download path

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-28 22:51:25 +08:00
buxiasen
e260522fa3 testing/pm_smp: delay_yield ticks 1->2, avoid idle canot run one cycle
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
buxiasen
93a431d19b testing/drivertest: add pm_smp test
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
buxiasen
7acf0ff314 drivertest_pm: compatible with SMP
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
liugui
9353bcefa2 skip oneshot timer test
Signed-off-by: liugui <liugui@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
dengwenqi
41bc4f7873 testing/stressapptest: fix: git status --ignore normalization check problem
Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
2024-10-28 00:40:37 +01:00
zhuanglin
5b2397b595 testing/fatutf8:fix Out of bounds writing
Signed-off-by: zhuanglin <zhuanglin@xiaomi.com>
2024-10-27 22:30:39 +08:00
zhangchao53
1ddeaa1468 testing/cmocka: shuffling test sequence and pass seed arg
Signed-off-by: zhangchao53 <zhangchao53@xiaomi.com>
2024-10-27 20:01:51 +08:00
xuxin19
b4c2e6bf46 build(bugfix):remove unused cmake scrpits
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-27 14:05:17 +08:00
wangmingrong1
a7a03a9e5a kasantest: Add some tests for legitimate and illegitimate operations of memory APIs
1. By printing the results, you can know which libc memory APIs in the
current system support kasan check; for examples:
KASan Test: heap underflow -> PASS
KASan Test: heap overflow -> PASS
KASan Test: heap use after free -> PASS
KASan Test: heap invalid free -> PASS
KASan Test: heap double free -> PASS
KASan Test: heap poison -> PASS
KASan Test: heap unpoison -> PASS
KASan Test: heap illegal memchr -> PASS
KASan Test: heap illegal memcpy -> PASS
KASan Test: heap illegal memcmp -> PASS
KASan Test: heap illegal memmove -> PASS
KASan Test: heap illegal memset -> PASS
KASan Test: heap illegal strcmp -> PASS
KASan Test: heap illegal strcpy -> PASS
KASan Test: heap illegal strlen -> FAIL
KASan Test: heap illegal strncpy -> FAIL
KASan Test: heap illegal strchr -> PASS
KASan Test: heap illegal strncmp -> PASS
KASan Test: heap illegal strnlen -> FAIL
KASan Test: heap illegal strrchr -> PASS
KASan Test: heap legal memchr -> PASS
KASan Test: heap legal memcpy -> PASS
KASan Test: heap legal memcmp -> PASS
KASan Test: heap legal memmove -> PASS
KASan Test: heap legal memset -> PASS
KASan Test: heap legal strcmp -> PASS
KASan Test: heap legal strlen -> PASS
KASan Test: heap legal strlen -> PASS
KASan Test: heap legal strncpy -> PASS
KASan Test: heap legal strchr -> PASS
KASan Test: heap legal strncmp -> PASS
KASan Test: heap legal strnlen -> PASS
KASan Test: heap legal strrchr -> PASS
KASan Test: globals underflow -> PASS
KASan Test: globals overflow -> PASS

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-22 23:14:50 +08:00
zhangshoukui
8b17cfedf2 drivertest_i2c_spi: Supports incoming device nodes so we can test both iic and spi
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-10-18 19:56:40 +08:00
chenzihan1
f426265ab2 testing: mm test will be skipped to prevent memory overflow
In the mm test, if the memory requested this time exceeds 3/4 of the remaining memory,
the request will be skipped to avoid insufficient memory.

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2024-10-17 23:29:41 +08:00
cuiziwei
b022a71480 cxxsize: Updata code size.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-16 17:10:33 +02:00
ouyangxiangzhen
880e2661dc apps/testing: Introduce timerjitter test case
This commit introduces the timerjitter test case, designed for assessing timer accuracy quickly. It is a simplified cyclictest implementation, optimized for fast and effective testing of timer precision.
The program sets up a periodic timer and awaits the firing of SIGALRM. Upon signal arrived, it computes the time difference between consecutive periods. A smaller time difference indicates higher time accuracy.
You can execute timerjitter without passing any arguments. Alternatively, you have the option to pass '-p' to print the time difference after each period, or provide additional arguments to customize the timer interval (in microseconds) and the number of test iterations.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-16 17:09:51 +08:00
Yongrong Wang
3514c6c704 drivertest/Makefile: add CONFIG_BUILD_FLAT limit for drivertest_block.c
If BUILD_FLAT is not enabled, the app and CPU run in user mode and
kernel mode respectively. The kernel and app are in different
memory address spaces. Different apps are in the same memory address
space. drivertest_block.c cannot directly call the kernel API.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-16 12:34:25 +08:00
jihandong
eca0928319 cxxtest: optional stream test.
Signed-off-by: jihandong <jihandong@xiaomi.com>
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-16 07:20:47 +08:00
Yongrong Wang
a486129907 testing/drivertest_block.c: Fix cmoka driver block test error
1. Fix the problem that pre->source may have memory stampede
2. Fix total block size larger than cache size condition

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-16 07:18:20 +08:00
yintao
0e519328c8 fstest: Add header to fix build issues
Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-16 07:17:20 +08:00
ouyangxiangzhen
44d2250b6e apps: Fix compilation error after nuttx/arch.h excluded.
This patch fix compilation error after excluding nuttx/arch.h.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-16 07:12:40 +08:00
Gao Jiawei
30215c260b add test for longjump with 0 as return value
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-10-16 07:12:10 +08:00
yangguangcai
3f08d4f11c rtc: change localtime to gmtime.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-16 07:11:40 +08:00
ligd
0e8a6ee2d2 Revert "add test for longjump with 0 as return value"
This reverts commit 63542f83c2985723071ae7e428311213008aa108.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-14 13:31:47 +08:00
Gao Jiawei
63542f83c2 add test for longjump with 0 as return value
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-10-13 10:50:58 +08:00
Yongrong Wang
67fa0e89ff driverteset_block.c: Reduce the stack consumption
1. By reducing the use of local variables geometry
2. Use structure pre_build_s pointers instead of using the
structure directly

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-12 10:36:20 +08:00