The arch_libc test only covered strcpy, so the architecture optimized
implementations of the remaining string and memory routines were never
exercised by the test suite.
Extend the test to also cover memcpy, memmove, memset, memcmp, memchr,
strlen, strcmp, strchr, strncmp, strnlen, strncpy, stpcpy, strcat and
strrchr:
* Every function gets a correctness test that sweeps the buffer
alignment and the transfer size and compares the result against the
expected value.
* Every function gets a speed test that reports the average cycle count
measured with perf_gettime().
* Every individual test is selected by its own
CONFIG_TESTING_ARCH_LIBC_<FUNC> option (default y), so a target can
drop the ones it does not need.
Impact: test only. Nothing is built unless CONFIG_TESTING_ARCH_LIBC
(default n) is selected, so no existing board configuration changes.
Testing: built and ran sim:nsh on Linux x86_64 (Ubuntu 24.04,
gcc 13.3.0) with CONFIG_TESTING_ARCH_LIBC=y. All 15 enabled functions
report PASSED and "arch_libc_test Passed".
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Add tests for popen()/pclose() and dpopen()/dpclose() that work in
both shell (NSH) and no-shell (direct posix_spawnp) modes. The test
binary doubles as its own target via the --echo sub-command.
Tests:
1-4: popen - basic read, multi-arg, pclose, invalid mode
5-7: dpopen - basic read, multi-arg, dpclose
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
Replace app-side includes of <debug.h> with <nuttx/debug.h> to use the
header from the NuttX tree explicitly after the header move.
Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
Skip UDP listen test when CONFIG_NET_UDP is disabled to prevent
test failures on configurations without UDP support.
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Correct date formatting in cache_test and arch_lib_test outputs to
ensure consistent date/time display format across test results.
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Specify architecture format in Kconfig to ensure proper configuration
handling for different architectures in testing modules.
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
In the previous changes to the apps/testing folder, I added an extra slash in the make.defs of uclibcxx, atomic.
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
This application test the libc's `wcstombs` function for different
len sizes (bigger than the converted string, exactly the size of
it and smaller than it).