Commit Graph

312 Commits

Author SHA1 Message Date
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
Gustavo Henrique Nihei
f500c64962 Include missing headers throughout the repository
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-07 09:58:13 +08:00
Xiang Xiao
21bc466a2b Remove the tail space char from all files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-03 00:18:36 +02:00
xinbingnan
9246502aca drivertest/drivertest_uart: uart driver testcase
VELAPLATFO-4612

There are three test.

1. Write a long default string into the serial port.
2. Read the default string given by the last test from the serial port.
3. Manually execute the `test_content_ gen.py` script and write the text into the serial device to test the burst capability or run this script and specify device path to automatically test.

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2023-02-24 17:13:06 +08:00
lilei19
41f60bd669 change strcpy to strlcpy
Change-Id: I8b9429a3c225a82842fce136bdb14b8b135066d3
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-02-22 23:09:55 +08:00
crafcat7
b8533e0f70 drivertest/gpio:Add FAR to the pointer 2023-02-22 16:17:04 +08:00
crafcat7
fd0ac1b8fb drivertest/block:Add FAR to the pointer 2023-02-22 16:16:51 +08:00
xinbingnan
5a8e089c66 drivertest/drivertest_i2c_spi.c: add testcase for i2c and spi
The BMI160 6-axis acceleration sensor is used as the peripheral of the I2C test. The main purpose of the test is to open the peripheral and read the data of the sensor. If it is read successfully, the test is successful.

Add compiled constraints to make it work only when the bmi160 driver is turned on.

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2023-02-22 02:46:36 +08:00
yintao
49f88d50b2 testing/cmocka: update cmocka version and add patch
Specify cmocka as the latest version 1.15
add patch to enable cmocka to output with syslog

Signed-off-by: yintao <yintao@xiaomi.com>
2023-02-17 23:44:30 +08:00
wangbowen6
f3d06972dc drivertest_relay: add relay test case
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-02-17 23:43:11 +08:00
crafcat7
1789e685a2 testing/drivertest: add gpio driver test 2023-02-12 21:48:24 +08:00