Commit Graph

422 Commits

Author SHA1 Message Date
zhangchao53
f1154b5be2 Memory leaks can be checked using cmocka
Signed-off-by: zhangchao53 <zhangchao53@xiaomi.com>
2023-08-11 18:09:40 +08:00
xucheng5
c7955e5faf drivertest/adc : support cmocka_driver_adc
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-11 13:51:30 +08:00
Xiang Xiao
d420036cbc testing/drivertest: Fix typo error in drivertest_uart.c
Made by:
commit 5659906fdfdac0a363aecb329c39c936324dcc55
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Mar 24 12:02:04 2023 -0600

    Changes to apps needed by nutts PR 8885

    needby:965551

    ostest contains some logic that depends on internal implementation of signal sets and ostest must be updated to match those changes.

    There is no particular impact from this PR.  This PR is the result of impact from nuttx 8885.

    Tested with nuttx 8885

    Change-Id: I2550888ee29aadcfcf8a98bfe5690920ee2b17d1

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-11 13:50:55 +08:00
dulibo1
3c674fb4d8 add test case for regulator
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-11 00:45:16 +08:00
dulibo1
6534f3d87c add batterydump tool for dump the battery info
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-10 20:44:03 +08:00
yangguangcai
5c6ffe1a4d drivertest:fix timer testcase
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:41:05 +08:00
yangguangcai
1dc7845c06 drivertest/timer:test interface getstatus.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:41:05 +08:00
yangguangcai
ffebcfbb9f testing/drivertest:fix variable may be negative
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:41:05 +08:00
rongyichang
9abb0a2592 apps/testing: support alignment for lcd driver test
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
rongyichang
6d11e1e7e2 drivertest/lcd: fix draw area calc error in LCD rect
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
rongyichang
694fbd2f77 apps/testing : correct the dependency option of fb driver test
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
rongyichang
49f81d387a apps/testing/driver_test:fix warning
drivertest_lcd.c:234:12: warning: assignment to 'uint16_t *' {aka 'short unsigned int *'} from incompatible pointer type 'uint8_t *' {aka 'unsigned char *'} [-Wincompatible-pointer-types]

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
rongyichang
b2d3fb726d testing/drivertest:add testcase for LCD driver
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
rongyichang
7c18361faf testing/drivertest:add testcase for framebuffer driver
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
yangguangcai
3717ce2094 watchdog:input watchdog deviation.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:34:47 +08:00
yangguangcai
16872c582c test/watchdog:call board_ioctl from board_reset_cause.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:34:47 +08:00
yangguangcai
d4b202ec7e test/watchdog:test interface getstatus.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:34:47 +08:00
yangguangcai
76dff2b924 watchdog:test watchdog not depend on fs.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:34:47 +08:00
xuxin19
8e71885ee5 Enhance Makefile to avoid "Argument list too long"
define a macro for split long variable and redefine variable in batch.
see details in `apps/Make.defs` `SPLITVARIABLE`.
replace the variable reference that caused the error.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-10 11:16:07 +08:00
jinxudong
6bea926ef2 sensor: add force sensor
A sensor of this type measures the force on it, and additionally
compares the force with one or more specified thresholds. The sensor
can output the force value directly. Moreover, it's usually applied
as a press key. In that case, when it detects a force greater than
some given threshold, a corresponding event is reported.

Signed-off-by: jinxudong <jinxudong@xiaomi.com>
2023-08-10 03:33:22 +08:00
haopengxiang
aa38c44b3b testing/unity: adjust unity download pack to 'Unity'
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-08-10 03:33:12 +08:00
jinxiuxu
4f7abe0231 apps/testing/drivertest:add audio drivertest
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2023-08-10 00:51:07 +08:00
yangguangcai
41388daf74 rtc test:add delay after set time.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 23:47:09 +08:00
yangguangcai
768ce91296 drivertest/rtc:input rtc alarm deviation.
Some vendor hardware precision cannot meet the requirements,
and the deviation needs to be input at this time.

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 23:47:09 +08:00
yangguangcai
0c8579151f drivertest/rtc:fix rtc testcase.
deviation from (-10,0) to (-10,10)

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 23:47:09 +08:00
yangguangcai
cd802f6a8f drivertest/rtc:add test case.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 23:47:09 +08:00
yangguangcai
89ad9c6527 test/drivertest:fix rtc settime incorrect.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 23:47:09 +08:00
makejian
6cd890e843 testing/crypto: add configs of crypto testing cases
crypto testing cases managed by respective config

Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-09 21:37:36 +08:00
yangguangcai
902a1d7ece test/oneshot:fix oneshot testcase.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 18:21:55 +08:00
yangguangcai
667d03f184 test/oneshot:fix compile warning.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 18:21:55 +08:00
yangguangcai
ed87aa242d drivertest:fix compile error.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 18:21:55 +08:00
yangguangcai
2782ed0721 test/drivertest:add oneshot test and posix timer test.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 18:21:55 +08:00
cuiziwei
4d6527ec8c testing/drivertest: add watch dog irq test
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-09 17:55:36 +08:00
cuiziwei
6c3e2f0aa0 drivertest_rtc:fix RTC_HAVE_SET_TIME is false.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-09 17:11:13 +08:00
hujun5
79a111fc1a ostest/mutex: mut need to be destroyed
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-09 15:07:25 +08:00
yinshengkai
d0f790e166 testing: add os performance measurement
Measure the performance of core system functions
such as thread switching and the time required for semaphore execution

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-09 14:59:41 +08:00
Petro Karashchenko
3648c0cc5c testing/ostest: call up_idle() only in case of CONFIG_SIM_WALLTIME_SLEEP=y
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-07 18:58:46 -07:00
Petro Karashchenko
6acf345296 testing/ostest: add test case for task priority change with locked scheduler
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-07 18:58:46 -07:00
Petro Karashchenko
e30a0602a0 testing/ostest: add missing section comments
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-07 18:58:46 -07:00
makejian
ff6df40e3c fix -Wmaybe-uninitialized compile warning in nist-sts
fix compile warning as following:
nist-sts/sts/src/cusum.c:15:23: warning: 'zerv' may be used uninitialized in this function[-Werror=maybe-uninitialized]

Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-03 22:43:59 -07:00
yanghuatao
89a1255dc2 ltp: follow linux on pthread_rwlock_unlock
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2023-08-03 22:43:50 -07:00
yanghuatao
1309990d6c ltp/makefile: nuttx on github download ltp code failed fix
Fix github download ltp code error:
Cloning into 'ltp'...
*** Please tell me who you are.
Run
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'root@33ba2a4a6fc5.(none)')

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-08-03 10:54:44 -07:00
makejian
e109319a2e fix memory leak in aesctr test case
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-03 10:54:25 -07:00
guoshichao
bc3fada2ce apps/testing/ltp: conditional build the testcases based on defconfig
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-08-03 07:30:28 -07:00
guoshichao
bc8d77fdbd apps/testing/ltp: filter the testcases based on config
control the testcases build rules based on the config that current
enabled

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-08-03 07:30:28 -07:00
makejian
4b0a3d92ff Porting NIST-Statistical-Test-Suite in nuttx to test quality of rng
(1)add nist-sts init nuttx
(2)Fix possible memory bug
(3)Fix double free memory
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-01 10:06:45 -07:00
guanyi
f50d2cdbe3 fix ostest sigprocmask testcase
problem: ostest may fail at procmask test, because signals:sigkill/sigstop should not be added in signal mask
solution: skip checking whether sigkill/sigstop are in signal mask

Signed-off-by: guanyi <guanyi@xiaomi.com>
2023-08-01 21:02:52 +09:00
hujun5
13d3b3d26c ostest/rmutex: mutex need to be destroyed
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-07-26 08:33:26 -07:00
hujun5
7daeca62b0 testing/mm: add maxsize parameter
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-07-26 08:33:09 -07:00
Xiang Xiao
d46dce5819 testing/ostest: Remove the unnecessary defined(CONFIG_PTHREAD_CLEANUP_STACKSIZE)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-25 09:51:09 +08:00
chenrun1
4bc06d9a4b drivertest_block:New test items about cache and memory alignment
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-17 23:15:32 +08:00
chenrun1
9768cfab79 drivertest_block:Give redundant space for bad blocks in nand flash
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-17 23:15:32 +08:00
chenrun1
3cb5d475ae drivertest_block:Test the availability of each sector of the block.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-17 23:15:32 +08:00
Xiang Xiao
ff276e422f ostest: Skip test_dev_null when CONFIG_DEV_NULL isn't enabled
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-17 16:28:02 +09:00
chao an
b18cf9aab3 testing/ostest: fix Compiler Warning (level 1) C4716: 'function' must return a value
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4716?view=msvc-170
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-14 01:28:25 +08:00
chao an
7cfcb49213 cmake/apps: add more applications into cmake support
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-13 19:00:18 +02:00
chao an
4d79a5cbaf add initial cmake build system
Co-authored-by: Daniel Agar <daniel@agar.ca>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:52:02 +08:00
pengyiqiang
cb9cba8d3f testing/monkey: add file permission settings
Add missing file permission setting, fix file read failure.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-06-29 20:08:05 +08:00
Gregory Nutt
6d9259f334 Add small test of pthread_exit()/pthread_self() on main thread. 2023-06-29 13:53:02 +08:00
simbit18
83bddd86c5 Fix Kconfig style
Remove TABs from Kconfig files
Add comments
2023-06-21 00:36:52 +08:00
Xiang Xiao
e89409cfe6 Remove the unnecessary cast from pid_t to int
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-19 09:05:54 +02:00
yanghuatao
cb179e4ed2 testing/ostest: adjust PTHREAD_CLEANUP_STACKSIZE with nuttx project
in project nuttx "remove PTHREAD_CLEANUP, and use PTHREAD_CLEANUP_STACKSIZE to enable or disable interfaces pthread_cleanup_push() and pthread_cleanup_pop()", project apps also needes adjust code.

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-06-14 08:49:13 +02:00
Petro Karashchenko
aed0e2873e apps: fix style issues in code
Add missing FAR and CODE to pointers
Remove FAR for non-pointer variables
Remove extra spaces and align the parameters
Add do {} while(0) wrapper in macro
Use nitems to calculate number of elements in arrays

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 18:47:50 +08:00
Lucas Saavedra Vaz
9cc710e954 testing/nxdiag: Move to "system" and improve info generated
Move the application to the "System" category. Improve host OS info by using platform.uname() and get current config file using CONFIG_BASE_DEFCONFIG
2023-05-27 13:48:32 +08:00
Lucas Saavedra Vaz
eb36c15171 testing: Add application to gather debug information (nxdiag)
This commit aims to add an application to gather debug information about the host and target systems. It can also perform some diagnostic checks on the host and target systems.
This will facilitate the process of users seeking assistance for solving some problem.

Current capabilities:
- Get host OS version;
- Get host python modules;
- Get host system packages;
- Get host PATH;
- Get host compilation flags for the target;
- Get target NuttX configuration;
- Get target OS version, hostname, build and architecture;
- Capable of adding custom, vendor specific, information. Currently gathering only Espressif related info:
  - Get the bootloader version of detected image files;
  - Get the version of different toolchains used by Espressif chips;
  - Get Esptool version.
2023-05-25 11:04:39 -03:00
hujun5
97a38b2b1f ostest/cond_test: cond and mutex need to be destroyed
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-23 13:11:07 +08:00
Xiang Xiao
7032c72f2f Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 07:39:53 +03:00
hujun5
db767b6f45 ostest/sighand_test: sem need to be destroyed
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-20 12:42:35 +08:00
simbit18
d0cb5afc2f testing/cmocka/Kconfig: Fix indentation
Remove spaces from Kconfig
2023-05-19 01:00:38 +08:00
hujun5
aea9b50dc8 add fdsan unit test
Due to the current Nuttx not supporting death test, we removed death test from the original test cases of Android

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-16 22:42:23 -07:00
hujun5
70a4010635 ostest: sem need to be destroyed
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-16 11:59:08 +08:00
hujun5
dd20ae28cb ostest: rwlock need to be destroy
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-12 15:32:18 -03:00
Xiang Xiao
73701cd7cd Replace all strncpy with strlcpy
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
7c37421266 Replace all sprintf with snprintf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
134b8b538f Replace all strcat with strlcat
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
hujun5
02efb15b57 ostest:fix signal test fail
If the same signal is quickly repeated multiple times, the signal may be ignored.
In SMP since we cannot control thread scheduling to ensure timely signal processing,
it is best to use semaphores to wait for signal processing to complete, which can also shorten the ostest time

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-06 23:37:07 +03:00
simbit18
bfd4cbc743 apps/testing/ostest/roundrobin.c: Fix nxstyle errors
error: Long line found
2023-04-29 14:54:40 +08:00
hujun5
5b2a89e174 ostest: fix smp ostest fail
In SMP we need improve thread waiting strategy

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-04-24 09:55:54 +02:00
hujun5
f0f98c3d73 ostest: fix smp ostest fail
In SMP we need improve thread waiting strategy

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-04-24 09:55:54 +02:00
Petro Karashchenko
4159fa197b testing/ostest: make sure that pthread_rwlock timeout test is executed properly
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-17 15:54:32 +02:00
Petro Karashchenko
2655f80dd7 testing/ostest: fix tasks priority assignment in nested signal test
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-17 15:54:32 +02:00
Xiang Xiao
aa99d267b7 Change the private default signal number to 32
and remove the unused private signal number macro

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-05 03:38:24 -07:00
Xiang Xiao
417b87a0a0 testing/ostest: Remove the unreal used SIG_WAITCANCEL
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-05 03:38:24 -07:00
Xiang Xiao
3ac86cc6f1 testing/ostest: Define the private used signal to SIGRTMIN
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-05 03:38:24 -07:00
Fotis Panagiotopoulos
b93aa0cb8d ostest: Fixed use of uninitialized variable. 2023-04-05 03:57:00 +03:00
Gustavo Henrique Nihei
efb4e0bc91 Add another batch of missing headers throughout the repository
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-28 14:54:16 -03:00
Gregory Nutt
a1bca5070c Changes to apps needed by nutts PR 8885
ostest contains some logic that depends on internal implementation of signal sets and ostest must be updated to match those changes.

There is no particular impact from this PR.  This PR is the result of impact from nuttx 8885.

Tested with nuttx 8885
2023-03-27 16:58:52 +03:00
simbit18
e533df52cc apps/testing/smart_test/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-24 15:04:43 -03:00
Zhe Weng
412505d286 ostest: Introduce basic work queue test
The test consists of two parts:
- A tester that tries to trigger wrong states of work queue
- A verifier that checks whether the wqueue is still working properly

The tester is trying to queue and cancel work several times with
priority lower/same/higher than the work queue.

Most wrong cases are likely to happen with high priority like:
- If `cancel` never decreases semcount, the count may keep growing
  and finally overflow
- If `cancel` is decreasing semcount too much, the `work_thread` may
  be waken up less times than expected

The lower/same priority testers are just added for covering other
unexpected situations.

The verifier is trying to queue some works and check they are called as
expected:
- Frist queue a 'sleep' worker, to let a work queue thread be in busy
  status and not waiting on sem, while other work queue thread(s) (if
  any) still waiting for sem. If sem is in wrong state, it may cause
  wrong behavior in either thread waiting/not waiting on the sem.
- Then queue a few count works, if the work queue(s) are still working
  properly, these works should finally be all called once.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-03-22 12:56:01 +02:00
simbit18
04c31b820c apps/testing/crypto/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
ab675c5b7d apps/testing/crypto/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
XinStellaris
7ab1f2a957 Add Arch-specific libc test case.
Signed-off-by: XinStellaris <tianxin7@xiaomi.com>
2023-03-17 11:59:13 -03:00
zhangyuan21
4454c8d02f apps: remove unnecessary sem_setprotocol code
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-03-17 11:58:03 -03:00
zhangyuan21
922f9932a6 apps: add <assert.h> header file
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-03-16 12:00:28 +01:00
simbit18
e8dcb60d71 apps/testing/ltp/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-09 01:43:09 +08:00
simbit18
75b2519827 apps/testing/unity/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-09 01:43:09 +08:00
simbit18
5cee3eebd9 uclibcxx_test/Make.defs Fix mistakes in comments
apps/testing/uclibcxx_test/Make.defs:  Fix mistakes in comments
2023-03-09 01:43:09 +08:00
simbit18
77cc8c96b1 apps/testing/mtd_config_fs/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-09 01:43:09 +08:00
simbit18
e8bf439105 apps/testing/cxxtest/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-09 01:43:09 +08:00
simbit18
6d7ed39a0d apps/testing/cxxtest/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-09 01:43:09 +08:00