From 20c0a7243c4ecfcdd65ed9e2976583e750fbfe21 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Mon, 25 Mar 2024 21:05:31 +0800 Subject: [PATCH] cmake:port testing applications to CMake build Signed-off-by: xuxin19 --- testing/arch_libc/CMakeLists.txt | 33 +++ testing/atomic/CMakeLists.txt | 33 +++ testing/cachetest/CMakeLists.txt | 33 +++ testing/cmocka/CMakeLists.txt | 91 +++++++ testing/cpuload/CMakeLists.txt | 33 +++ testing/crypto/CMakeLists.txt | 106 ++++++++ testing/cxxtest/CMakeLists.txt | 31 +++ testing/drivertest/CMakeLists.txt | 346 ++++++++++++++++++++++++++ testing/epoll/CMakeLists.txt | 35 +++ testing/fatutf8/CMakeLists.txt | 33 +++ testing/fdsantest/CMakeLists.txt | 35 +++ testing/fmemopen/CMakeLists.txt | 31 +++ testing/fstest/CMakeLists.txt | 10 +- testing/gpu/CMakeLists.txt | 52 ++++ testing/irtest/CMakeLists.txt | 36 +++ testing/memstress/CMakeLists.txt | 33 +++ testing/memtester/CMakeLists.txt | 64 +++++ testing/mm/CMakeLists.txt | 35 +++ testing/monkey/CMakeLists.txt | 36 +++ testing/mtd_config_fs/CMakeLists.txt | 33 +++ testing/nand_sim/CMakeLists.txt | 31 +++ testing/nist-sts/CMakeLists.txt | 77 ++++++ testing/nxffs/CMakeLists.txt | 3 +- testing/open_memstream/CMakeLists.txt | 31 +++ testing/opus_ramtest/CMakeLists.txt | 33 +++ testing/ostest/CMakeLists.txt | 5 +- testing/ramtest/CMakeLists.txt | 14 +- testing/scanftest/CMakeLists.txt | 33 +++ testing/sensortest/CMakeLists.txt | 33 +++ testing/setest/CMakeLists.txt | 31 +++ testing/smart/CMakeLists.txt | 24 ++ testing/smart_test/CMakeLists.txt | 31 +++ testing/stressapptest/CMakeLists.txt | 56 +++++ 33 files changed, 1531 insertions(+), 10 deletions(-) create mode 100644 testing/arch_libc/CMakeLists.txt create mode 100644 testing/atomic/CMakeLists.txt create mode 100644 testing/cachetest/CMakeLists.txt create mode 100644 testing/cmocka/CMakeLists.txt create mode 100644 testing/cpuload/CMakeLists.txt create mode 100644 testing/crypto/CMakeLists.txt create mode 100644 testing/cxxtest/CMakeLists.txt create mode 100644 testing/drivertest/CMakeLists.txt create mode 100644 testing/epoll/CMakeLists.txt create mode 100644 testing/fatutf8/CMakeLists.txt create mode 100644 testing/fdsantest/CMakeLists.txt create mode 100644 testing/fmemopen/CMakeLists.txt create mode 100644 testing/gpu/CMakeLists.txt create mode 100644 testing/irtest/CMakeLists.txt create mode 100644 testing/memstress/CMakeLists.txt create mode 100644 testing/memtester/CMakeLists.txt create mode 100644 testing/mm/CMakeLists.txt create mode 100644 testing/monkey/CMakeLists.txt create mode 100644 testing/mtd_config_fs/CMakeLists.txt create mode 100644 testing/nand_sim/CMakeLists.txt create mode 100644 testing/nist-sts/CMakeLists.txt create mode 100644 testing/open_memstream/CMakeLists.txt create mode 100644 testing/opus_ramtest/CMakeLists.txt create mode 100644 testing/scanftest/CMakeLists.txt create mode 100644 testing/sensortest/CMakeLists.txt create mode 100644 testing/setest/CMakeLists.txt create mode 100644 testing/smart/CMakeLists.txt create mode 100644 testing/smart_test/CMakeLists.txt create mode 100644 testing/stressapptest/CMakeLists.txt diff --git a/testing/arch_libc/CMakeLists.txt b/testing/arch_libc/CMakeLists.txt new file mode 100644 index 000000000..52dcd1eab --- /dev/null +++ b/testing/arch_libc/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/testing/arch_libc/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_ARCH_LIBC) + nuttx_add_application( + NAME + ${CONFIG_TESTING_ARCH_LIBC_PROGNAME} + PRIORITY + ${CONFIG_TESTING_ARCH_LIBC_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_ARCH_LIBC_STACKSIZE} + MODULE + ${CONFIG_TESTING_ARCH_LIBC} + SRCS + arch_libc_test_main.c) +endif() diff --git a/testing/atomic/CMakeLists.txt b/testing/atomic/CMakeLists.txt new file mode 100644 index 000000000..7e0d9193a --- /dev/null +++ b/testing/atomic/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/testing/atomic/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_ATOMIC) + nuttx_add_application( + NAME + ${CONFIG_TESTING_ATOMIC_PROGNAME} + PRIORITY + ${CONFIG_TESTING_ATOMIC_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_ATOMIC_STACKSIZE} + MODULE + ${CONFIG_TESTING_ATOMIC} + SRCS + atomic_main.c) +endif() diff --git a/testing/cachetest/CMakeLists.txt b/testing/cachetest/CMakeLists.txt new file mode 100644 index 000000000..661887ab5 --- /dev/null +++ b/testing/cachetest/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/testing/cachetest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_CACHETEST) + nuttx_add_application( + NAME + ${CONFIG_TESTING_CACHETEST_PROGNAME} + PRIORITY + ${CONFIG_TESTING_CACHETEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_CACHETEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_CACHETEST} + SRCS + cachetest_main.c) +endif() diff --git a/testing/cmocka/CMakeLists.txt b/testing/cmocka/CMakeLists.txt new file mode 100644 index 000000000..11568513e --- /dev/null +++ b/testing/cmocka/CMakeLists.txt @@ -0,0 +1,91 @@ +# ############################################################################## +# apps/testing/cmocka/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_CMOCKA) + + set(CMOCKA_DIR ${CMAKE_CURRENT_LIST_DIR}/cmocka) + + if(NOT EXISTS ${CMOCKA_DIR}) + set(CONFIG_CMOCKA_URL https://github.com/clibs/cmocka/archive) + + FetchContent_Declare( + cmocka_fetch + URL ${CONFIG_CMOCKA_URL}/1.1.5.zip SOURCE_DIR + ${CMAKE_CURRENT_LIST_DIR}/cmocka BINARY_DIR + ${CMAKE_BINARY_DIR}/apps/testing/cmocka/cmocka + PATCH_COMMAND + patch -p0 -d ${CMAKE_CURRENT_LIST_DIR}/cmocka < + ${CMAKE_CURRENT_LIST_DIR}/0001-cmocka.c-Reduce-the-call-stack-consumption-of-printf.patch + && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR}/cmocka < + ${CMAKE_CURRENT_LIST_DIR}/0002-cmocka-feature-to-forwarding-cmocka-log-message-to-c.patch + && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR}/cmocka < + ${CMAKE_CURRENT_LIST_DIR}/0003-cmocka-update-method-for-strmatch-to-regex-and-add-list-all-testcases-function.patch + && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR}/cmocka < + ${CMAKE_CURRENT_LIST_DIR}/0004-cmocka-xml-report.patch && patch -p0 -d + ${CMAKE_CURRENT_LIST_DIR}/cmocka < + ${CMAKE_CURRENT_LIST_DIR}/0005-cmocka-cmocka_private-fix-warning-in-cmocka_private.patch + && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR}/cmocka < + ${CMAKE_CURRENT_LIST_DIR}/0006-fix-linux-risc-v-compile-error-list_initialize.patch + DOWNLOAD_NO_PROGRESS true + TIMEOUT 30) + + FetchContent_GetProperties(cmocka_fetch) + + if(NOT cmocka_fetch_POPULATED) + FetchContent_Populate(cmocka_fetch) + endif() + endif() + + nuttx_add_library(cmocka) + + file(GLOB SRCS ${CMOCKA_DIR}/src/*.c) + + set(EXPORT_INCDIR ${CMOCKA_DIR}/include) + nuttx_export_header(TARGET cmocka INCLUDE_DIRECTORIES ${EXPORT_INCDIR}) + + set(INCDIR ${CMAKE_CURRENT_LIST_DIR} ${EXPORT_INCDIR}) + + set(CFLAGS -Dprint_error=nx_print_error -DCMOCKA_PLATFORM_INCLUDE + -DHAVE_CLOCK_REALTIME=1 -DHAVE_STRUCT_TIMESPEC=1) + if(CONFIG_TESTING_CMOCKA_LEAKDETECT) + list(APPEND CFLAGS -DUNIT_TESTING=ON) + endif() + + target_sources(cmocka PRIVATE ${SRCS}) + target_include_directories(cmocka PRIVATE ${INCDIR}) + target_compile_options(cmocka PRIVATE ${CFLAGS}) + + nuttx_add_application( + NAME + ${CONFIG_TESTING_CMOCKA_PROGNAME} + PRIORITY + ${CONFIG_TESTING_CMOCKA_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_CMOCKA_STACKSIZE} + MODULE + ${CONFIG_TESTING_CMOCKA} + INCLUDE_DIRECTORIES + ${INCDIR} + SRCS + cmocka_main.c + DEPENDS + cmocka) + +endif() diff --git a/testing/cpuload/CMakeLists.txt b/testing/cpuload/CMakeLists.txt new file mode 100644 index 000000000..43e776cf6 --- /dev/null +++ b/testing/cpuload/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/testing/cpuload/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_CPULOAD) + nuttx_add_application( + NAME + cpuload + PRIORITY + 100 + STACKSIZE + ${CONFIG_DEFAULT_TASK_STACKSIZE} + MODULE + ${CONFIG_TESTING_CPULOAD} + SRCS + cpuload_main.c) +endif() diff --git a/testing/crypto/CMakeLists.txt b/testing/crypto/CMakeLists.txt new file mode 100644 index 000000000..5db24386f --- /dev/null +++ b/testing/crypto/CMakeLists.txt @@ -0,0 +1,106 @@ +# ############################################################################## +# apps/testing/crypto/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_CRYPTO) + if(CONFIG_TESTING_CRYPTO_3DES_CBC) + nuttx_add_application( + NAME + des3cbc + PRIORITY + ${CONFIG_TESTING_CRYPTO_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_CRYPTO_STACKSIZE} + MODULE + ${CONFIG_TESTING_CRYPTO} + SRCS + 3descbc.c) + endif() + + if(CONFIG_TESTING_CRYPTO_AES_XTS) + nuttx_add_application( + NAME + aesxts + PRIORITY + ${CONFIG_TESTING_CRYPTO_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_CRYPTO_STACKSIZE} + MODULE + ${CONFIG_TESTING_CRYPTO} + SRCS + aesxts.c) + endif() + + if(CONFIG_TESTING_CRYPTO_AES_CTR) + nuttx_add_application( + NAME + aesctr + PRIORITY + ${CONFIG_TESTING_CRYPTO_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_CRYPTO_STACKSIZE} + MODULE + ${CONFIG_TESTING_CRYPTO} + SRCS + aesctr.c) + endif() + + if(CONFIG_TESTING_CRYPTO_AES_CBC) + nuttx_add_application( + NAME + aescbc + PRIORITY + ${CONFIG_TESTING_CRYPTO_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_CRYPTO_STACKSIZE} + MODULE + ${CONFIG_TESTING_CRYPTO} + SRCS + aescbc.c) + endif() + + if(CONFIG_TESTING_CRYPTO_HMAC) + nuttx_add_application( + NAME + hmac + PRIORITY + ${CONFIG_TESTING_CRYPTO_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_CRYPTO_STACKSIZE} + MODULE + ${CONFIG_TESTING_CRYPTO} + SRCS + hmac.c) + endif() + + if(CONFIG_TESTING_CRYPTO_HASH) + nuttx_add_application( + NAME + hash + PRIORITY + ${CONFIG_TESTING_CRYPTO_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_CRYPTO_STACKSIZE} + MODULE + ${CONFIG_TESTING_CRYPTO} + SRCS + hash.c) + endif() + +endif() diff --git a/testing/cxxtest/CMakeLists.txt b/testing/cxxtest/CMakeLists.txt new file mode 100644 index 000000000..d893638cc --- /dev/null +++ b/testing/cxxtest/CMakeLists.txt @@ -0,0 +1,31 @@ +# ############################################################################## +# apps/testing/cxxtest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_CXXTEST) + nuttx_add_application( + NAME + cxxtest + STACKSIZE + ${CONFIG_DEFAULT_TASK_STACKSIZE} + MODULE + ${CONFIG_TESTING_CXXTEST} + SRCS + cxxtest_main.c) +endif() diff --git a/testing/drivertest/CMakeLists.txt b/testing/drivertest/CMakeLists.txt new file mode 100644 index 000000000..8b32aec3d --- /dev/null +++ b/testing/drivertest/CMakeLists.txt @@ -0,0 +1,346 @@ +# ############################################################################## +# apps/testing/drivertest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_DRIVER_TEST) + if(CONFIG_TESTING_DRIVER_TEST_SIMPLE) + nuttx_add_application( + NAME + cmocka_driver_simple + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_simple.c) + endif() + + if(CONFIG_BCH) + nuttx_add_application( + NAME + cmocka_driver_block + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + INCLUDE_DIRECTORIES + ${NUTTX_DIR}/fs + DEPENDS + cmocka + SRCS + drivertest_block.c) + endif() + + if(CONFIG_RTC AND CONFIG_SIG_EVTHREAD) + nuttx_add_application( + NAME + cmocka_driver_rtc + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_rtc.c) + endif() + + if(CONFIG_TIMER) + nuttx_add_application( + NAME + cmocka_driver_timer + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_timer.c) + endif() + + if(CONFIG_ONESHOT) + nuttx_add_application( + NAME + cmocka_driver_oneshot + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_oneshot.c) + endif() + + if(NOT CONFIG_DISABLE_POSIX_TIMERS AND CONFIG_SIG_EVTHREAD) + nuttx_add_application( + NAME + cmocka_posix_timer + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_posix_timer.c) + endif() + + if(CONFIG_WATCHDOG AND CONFIG_BOARDCTL_RESET_CAUSE) + nuttx_add_application( + NAME + cmocka_driver_watchdog + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_watchdog.c) + endif() + + if(CONFIG_PWM) + nuttx_add_application( + NAME + cmocka_driver_pwm + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_pwm.c) + endif() + + if(CONFIG_ADC) + nuttx_add_application( + NAME + cmocka_driver_adc + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_adc.c) + endif() + + if(CONFIG_I2C OR CONFIG_SPI) + if(CONFIG_SENSORS_BMI160) + nuttx_add_application( + NAME + cmocka_driver_i2c_spi + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_i2c_spi.c) + endif() + endif() + + if(CONFIG_DEV_GPIO) + nuttx_add_application( + NAME + cmocka_driver_gpio + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_gpio.c) + endif() + + if(CONFIG_RELAY) + nuttx_add_application( + NAME + cmocka_driver_relay + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_relay.c) + endif() + + if(CONFIG_SERIAL) + nuttx_add_application( + NAME + cmocka_driver_uart + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_uart.c) + endif() + + if(CONFIG_AUDIO) + nuttx_add_application( + NAME + cmocka_driver_audio + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_audio.c) + endif() + + if(CONFIG_CPUFREQ) + nuttx_add_application( + NAME + cmocka_driver_cpufreq + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_cpufreq.c) + endif() + + if(CONFIG_VIDEO_FB) + nuttx_add_application( + NAME + cmocka_driver_framebuffer + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_framebuffer.c) + endif() + + if(CONFIG_LCD_DEV) + nuttx_add_application( + NAME + cmocka_driver_lcd + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_lcd.c) + endif() + + if(CONFIG_REGULATOR) + nuttx_add_application( + NAME + cmocka_driver_regulator + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_regulator.c) + endif() + + if(CONFIG_LV_USE_NUTTX_TOUCHSCREEN) + nuttx_add_application( + NAME + cmocka_driver_touchpanel + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_touchpanel.c) + endif() + + if(CONFIG_PM_RUNTIME) + nuttx_add_application( + NAME + cmocka_driver_pm_runtime + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_pm_runtime.c) + endif() + +endif() diff --git a/testing/epoll/CMakeLists.txt b/testing/epoll/CMakeLists.txt new file mode 100644 index 000000000..082f421f6 --- /dev/null +++ b/testing/epoll/CMakeLists.txt @@ -0,0 +1,35 @@ +# ############################################################################## +# apps/testing/epoll/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_EPOLL) + nuttx_add_application( + NAME + cmocka_epoll + PRIORITY + ${CONFIG_TESTING_EPOLL_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_EPOLL_STACKSIZE} + MODULE + ${CONFIG_TESTING_EPOLL} + DEPENDS + cmocka + SRCS + epoll.c) +endif() diff --git a/testing/fatutf8/CMakeLists.txt b/testing/fatutf8/CMakeLists.txt new file mode 100644 index 000000000..6facb8a67 --- /dev/null +++ b/testing/fatutf8/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/testing/fatutf8/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_FATUTF8) + nuttx_add_application( + NAME + ${CONFIG_TESTING_FATUTF8_PROGNAME} + PRIORITY + ${CONFIG_TESTING_FATUTF8_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_FATUTF8_STACKSIZE} + MODULE + ${CONFIG_TESTING_FATUTF8} + SRCS + fatutf8_main.c) +endif() diff --git a/testing/fdsantest/CMakeLists.txt b/testing/fdsantest/CMakeLists.txt new file mode 100644 index 000000000..f83dadb9c --- /dev/null +++ b/testing/fdsantest/CMakeLists.txt @@ -0,0 +1,35 @@ +# ############################################################################## +# apps/testing/fdsantest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_FDSAN_TEST AND CONFIG_TESTING_FDSAN_TEST_SIMPLE) + nuttx_add_application( + NAME + cmocka_fdsan_simple + PRIORITY + ${CONFIG_TESTING_FDSAN_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_FDSAN_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_FDSAN_TEST} + DEPENDS + cmocka + SRCS + fdsantest_simple.c) +endif() diff --git a/testing/fmemopen/CMakeLists.txt b/testing/fmemopen/CMakeLists.txt new file mode 100644 index 000000000..65e69e652 --- /dev/null +++ b/testing/fmemopen/CMakeLists.txt @@ -0,0 +1,31 @@ +# ############################################################################## +# apps/testing/fmemopen/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_FMEMOPEN_TEST) + nuttx_add_application( + NAME + fmemopen_test + STACKSIZE + 4096 + MODULE + ${CONFIG_TESTING_FMEMOPEN_TEST} + SRCS + fmemopen.c) +endif() diff --git a/testing/fstest/CMakeLists.txt b/testing/fstest/CMakeLists.txt index 6445c256b..e9213987a 100644 --- a/testing/fstest/CMakeLists.txt +++ b/testing/fstest/CMakeLists.txt @@ -22,10 +22,12 @@ if(CONFIG_TESTING_FSTEST) nuttx_add_application( NAME ${CONFIG_TESTING_FSTEST_PROGNAME} - SRCS - fstest_main.c + PRIORITY + ${CONFIG_TESTING_FSTEST_PRIORITY} STACKSIZE ${CONFIG_TESTING_FSTEST_STACKSIZE} - PRIORITY - ${CONFIG_TESTING_FSTEST_PRIORITY}) + MODULE + ${CONFIG_TESTING_FSTEST} + SRCS + fstest_main.c) endif() diff --git a/testing/gpu/CMakeLists.txt b/testing/gpu/CMakeLists.txt new file mode 100644 index 000000000..04006507e --- /dev/null +++ b/testing/gpu/CMakeLists.txt @@ -0,0 +1,52 @@ +# ############################################################################## +# apps/testing/gpu/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_GPU) + file(GLOB VG_LITE_SRCS vg_lite/*.c) + file(GLOB CURRENT_SRCS *.c) + list(REMOVE_ITEM CURRENT_SRCS gpu_main.c) + + set(SRCS gpu_main.c ${CURRENT_SRCS} ${VG_LITE_SRCS}) + + set(INCDIR ${CMAKE_CURRENT_LIST_DIR}) + if(CONFIG_TESTING_GPU_VG_LITE_INCLUDE) + list(APPEND INCDIR + ${NUTTX_APPS_DIR}/../${CONFIG_TESTING_GPU_VG_LITE_INCLUDE}) + endif() + + if(CONFIG_LIB_PNG) + list(APPEND INCDIR ${NUTTX_APPS_DIR}/../external/libpng + ${NUTTX_APPS_DIR}/../external/libpng/libpng) + endif() + + nuttx_add_application( + NAME + gpu_test + PRIORITY + ${CONFIG_TESTING_GPU_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_GPU_STACKSIZE} + MODULE + ${CONFIG_TESTING_GPU} + INCLUDE_DIRECTORIES + ${INCDIR} + SRCS + ${SRCS}) +endif() diff --git a/testing/irtest/CMakeLists.txt b/testing/irtest/CMakeLists.txt new file mode 100644 index 000000000..98d4e8c8e --- /dev/null +++ b/testing/irtest/CMakeLists.txt @@ -0,0 +1,36 @@ +# ############################################################################## +# apps/testing/irtest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_IRTEST) + file(GLOB CURRENT_SRCS *.cxx) + list(REMOVE_ITEM CURRENT_SRCS main.cxx) + set(SRCS main.cxx ${CURRENT_SRCS}) + nuttx_add_application( + NAME + ${CONFIG_TESTING_IRTEST_PROGNAME} + PRIORITY + ${CONFIG_TESTING_IRTEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_IRTEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_IRTEST} + SRCS + ${SRCS}) +endif() diff --git a/testing/memstress/CMakeLists.txt b/testing/memstress/CMakeLists.txt new file mode 100644 index 000000000..e10d721d9 --- /dev/null +++ b/testing/memstress/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/testing/memstress/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_MEMORY_STRESS) + nuttx_add_application( + NAME + ${CONFIG_TESTING_MEMORY_STRESS_PROGNAME} + PRIORITY + ${CONFIG_TESTING_MEMORY_STRESS_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_MEMORY_STRESS_STACKSIZE} + MODULE + ${CONFIG_TESTING_MEMORY_STRESS} + SRCS + memorystress_main.c) +endif() diff --git a/testing/memtester/CMakeLists.txt b/testing/memtester/CMakeLists.txt new file mode 100644 index 000000000..93f0e176d --- /dev/null +++ b/testing/memtester/CMakeLists.txt @@ -0,0 +1,64 @@ +# ############################################################################## +# apps/testing/memtester/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_UTILS_MEMTESTER) + + set(MEMTESTER_DIR ${CMAKE_CURRENT_LIST_DIR}/memtester) + + if(NOT EXISTS ${MEMTESTER_DIR}) + set(CONFIG_MEMTESTER_URL + https://github.com/jnavila/memtester/archive/refs/heads/master.zip) + + FetchContent_Declare( + memtester_fetch + URL ${CONFIG_MEMTESTER_URL}SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/memtester + BINARY_DIR ${CMAKE_BINARY_DIR}/apps/testing/memtester/memtester + DOWNLOAD_NO_PROGRESS true + TIMEOUT 30) + + FetchContent_GetProperties(memtester_fetch) + + if(NOT memtester_fetch_POPULATED) + FetchContent_Populate(memtester_fetch) + endif() + endif() + + set(SRCS ${MEMTESTER_DIR}/memtester.c ${MEMTESTER_DIR}/tests.c + ${MEMTESTER_DIR}/output.c) + set(CFLAGS) + if(CONFIG_UTILS_MEMTESTER_NARROW) + list(APPEND CFLAGS -DTEST_NARROW_WRITES) + endif() + + nuttx_add_application( + NAME + ${CONFIG_UTILS_MEMTESTER_PROGNAME} + PRIORITY + ${CONFIG_UTILS_MEMTESTER_PRIORITY} + STACKSIZE + ${CONFIG_UTILS_MEMTESTER_STACKSIZE} + MODULE + ${CONFIG_UTILS_MEMTESTER} + COMPILE_FLAGS + ${CFLAGS} + SRCS + ${SRCS}) + +endif() diff --git a/testing/mm/CMakeLists.txt b/testing/mm/CMakeLists.txt new file mode 100644 index 000000000..2c6f069fe --- /dev/null +++ b/testing/mm/CMakeLists.txt @@ -0,0 +1,35 @@ +# ############################################################################## +# apps/testing/mm/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_MM) + nuttx_add_application( + NAME + ${CONFIG_TESTING_MM_PROGNAME} + PRIORITY + ${CONFIG_TESTING_MM_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_MM_STACKSIZE} + MODULE + ${CONFIG_TESTING_MM} + INCLUDE_DIRECTORIES + ${NUTTX_DIR}/mm/mm_heap + SRCS + mm_main.c) +endif() diff --git a/testing/monkey/CMakeLists.txt b/testing/monkey/CMakeLists.txt new file mode 100644 index 000000000..e97ca78e0 --- /dev/null +++ b/testing/monkey/CMakeLists.txt @@ -0,0 +1,36 @@ +# ############################################################################## +# apps/testing/monkey/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_MONKEY) + file(GLOB CURRENT_SRCS *.c) + list(REMOVE_ITEM CURRENT_SRCS monkey_main.c) + set(SRCS monkey_main.c ${CURRENT_SRCS}) + nuttx_add_application( + NAME + monkey + PRIORITY + ${CONFIG_TESTING_MONKEY_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_MONKEY_STACKSIZE} + MODULE + ${CONFIG_TESTING_MONKEY} + SRCS + ${SRCS}) +endif() diff --git a/testing/mtd_config_fs/CMakeLists.txt b/testing/mtd_config_fs/CMakeLists.txt new file mode 100644 index 000000000..75397385d --- /dev/null +++ b/testing/mtd_config_fs/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/testing/mtd_config_fs/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_MTD_CONFIG_FAIL_SAFE) + nuttx_add_application( + NAME + ${CONFIG_TESTING_MTD_CONFIG_FAIL_SAFE_PROGNAME} + PRIORITY + ${CONFIG_TESTING_MTD_CONFIG_FAIL_SAFE_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_MTD_CONFIG_FAIL_SAFE_STACKSIZE} + MODULE + ${CONFIG_TESTING_MTD_CONFIG_FAIL_SAFE} + SRCS + mtd_config_fs_test_main.c) +endif() diff --git a/testing/nand_sim/CMakeLists.txt b/testing/nand_sim/CMakeLists.txt new file mode 100644 index 000000000..68994ebd3 --- /dev/null +++ b/testing/nand_sim/CMakeLists.txt @@ -0,0 +1,31 @@ +# ############################################################################## +# apps/testing/nand_sim/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_NAND_SIM) + nuttx_add_application( + NAME + nand + STACKSIZE + ${CONFIG_TESTING_NAND_SIM_STACK} + MODULE + ${CONFIG_TESTING_NAND_SIM} + SRCS + nand_sim_main.c) +endif() diff --git a/testing/nist-sts/CMakeLists.txt b/testing/nist-sts/CMakeLists.txt new file mode 100644 index 000000000..a0a6cf5f0 --- /dev/null +++ b/testing/nist-sts/CMakeLists.txt @@ -0,0 +1,77 @@ +# ############################################################################## +# apps/testing/nist-sts/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_NIST_STS) + + set(NIST_DIR ${CMAKE_CURRENT_LIST_DIR}/nist-sts) + + if(NOT EXISTS ${NIST_DIR}) + set(CONFIG_NIST_URL + https://csrc.nist.gov/CSRC/media/Projects/Random-Bit-Generation/documents/sts-2_1_2.zip + ) + + FetchContent_Declare( + nist-sts_fetch + URL ${CONFIG_NIST_URL} SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/nist-sts + BINARY_DIR ${CMAKE_BINARY_DIR}/apps/testing/nist-sts/nist-sts + PATCH_COMMAND + patch -p0 -d ${CMAKE_CURRENT_LIST_DIR}/nist-sts < + ${CMAKE_CURRENT_LIST_DIR}/0001-Solve-the-memory-out-of-bounds-problem-in-sts.patch + && patch -p0 -d ${CMAKE_CURRENT_LIST_DIR}/nist-sts < + ${CMAKE_CURRENT_LIST_DIR}/0002-Fix-bug-that-crash-in-running-a-single-test-after-ru.patch + DOWNLOAD_NO_PROGRESS true + TIMEOUT 30) + + FetchContent_GetProperties(nist-sts_fetch) + + if(NOT nist-sts_fetch_POPULATED) + FetchContent_Populate(nist-sts_fetch) + endif() + endif() + + file(GLOB NIST_SRCS ${NIST_DIR}/sts/src/*.c) + list(REMOVE_ITEM NIST_SRCS ${NIST_DIR}/sts/src/assess.c) + + set(SRCS ${NIST_DIR}/sts/src/assess.c ${NIST_SRCS}) + + set(CFLAGS + -Wno-misleading-indentation + -Wno-unused-but-set-variable + -Wno-strict-prototypes + -Wno-undef + -Wno-shadow + -Wno-unused-variable + -Wno-maybe-uninitialized) + + nuttx_add_application( + NAME + ${CONFIG_TESTING_NIST_STS_PROGNAME} + PRIORITY + ${CONFIG_TESTING_NIST_STS_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_NIST_STS_STACKSIZE} + MODULE + ${CONFIG_TESTING_NIST_STS} + COMPILE_FLAGS + ${CFLAGS} + SRCS + ${SRCS}) + +endif() diff --git a/testing/nxffs/CMakeLists.txt b/testing/nxffs/CMakeLists.txt index 208acb83e..17b18b2b1 100644 --- a/testing/nxffs/CMakeLists.txt +++ b/testing/nxffs/CMakeLists.txt @@ -19,5 +19,6 @@ # ############################################################################## if(CONFIG_TESTING_NXFFS) - nuttx_add_application(NAME nxffs SRCS nxffs_main.c) + nuttx_add_application(NAME nxffs MODULE ${CONFIG_TESTING_NXFFS} SRCS + nxffs_main.c) endif() diff --git a/testing/open_memstream/CMakeLists.txt b/testing/open_memstream/CMakeLists.txt new file mode 100644 index 000000000..fad47958e --- /dev/null +++ b/testing/open_memstream/CMakeLists.txt @@ -0,0 +1,31 @@ +# ############################################################################## +# apps/testing/open_memstream/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_OPEN_MEMSTREAM) + nuttx_add_application( + NAME + open_memstream_test + STACKSIZE + 4096 + MODULE + ${CONFIG_TESTING_FMEMOPEN_TEST} + SRCS + open_memstream.c) +endif() diff --git a/testing/opus_ramtest/CMakeLists.txt b/testing/opus_ramtest/CMakeLists.txt new file mode 100644 index 000000000..91a517e03 --- /dev/null +++ b/testing/opus_ramtest/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/testing/opus_ramtest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_OPUS_RAMTEST) + nuttx_add_application( + NAME + opus_ramtest + PRIORITY + ${CONFIG_TESTING_OPUS_RAMTEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_OPUS_RAMTEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_OPUS_RAMTEST} + SRCS + opus_ramtest_main.c) +endif() diff --git a/testing/ostest/CMakeLists.txt b/testing/ostest/CMakeLists.txt index f0f882c7d..d40da5d4f 100644 --- a/testing/ostest/CMakeLists.txt +++ b/testing/ostest/CMakeLists.txt @@ -143,8 +143,7 @@ if(CONFIG_TESTING_OSTEST) list(APPEND SRCS smp_call.c) endif() - target_sources(apps PRIVATE ${SRCS}) - - nuttx_add_application(NAME ostest SRCS ostest_main.c) + set(OSTEST_SRCS ostest_main.c ${SRCS}) + nuttx_add_application(NAME ostest SRCS ${OSTEST_SRCS}) endif() diff --git a/testing/ramtest/CMakeLists.txt b/testing/ramtest/CMakeLists.txt index 73c09ba38..de27cd89f 100644 --- a/testing/ramtest/CMakeLists.txt +++ b/testing/ramtest/CMakeLists.txt @@ -18,6 +18,16 @@ # # ############################################################################## -if(CONFIG_TESTING_RAMTEST) - nuttx_add_application(NAME ramtest) +if(CONFIG_SYSTEM_RAMTEST) + nuttx_add_application( + NAME + ${CONFIG_TESTING_RAMTEST_PROGNAME} + PRIORITY + ${CONFIG_TESTING_RAMTEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_RAMTEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_RAMTEST} + SRCS + ramtest.c) endif() diff --git a/testing/scanftest/CMakeLists.txt b/testing/scanftest/CMakeLists.txt new file mode 100644 index 000000000..02b966fbf --- /dev/null +++ b/testing/scanftest/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/testing/scanftest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_SCANFTEST) + nuttx_add_application( + NAME + ${CONFIG_TESTING_SCANFTEST_PROGNAME} + PRIORITY + ${CONFIG_TESTING_SCANFTEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_SCANFTEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_SCANFTEST} + SRCS + scanftest_main.c) +endif() diff --git a/testing/sensortest/CMakeLists.txt b/testing/sensortest/CMakeLists.txt new file mode 100644 index 000000000..aa8283523 --- /dev/null +++ b/testing/sensortest/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/testing/sensortest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_SENSORTEST) + nuttx_add_application( + NAME + ${CONFIG_TESTING_SENSORTEST_PROGNAME} + PRIORITY + ${CONFIG_TESTING_SENSORTEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_SENSORTEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_SENSORTEST} + SRCS + sensortest.c) +endif() diff --git a/testing/setest/CMakeLists.txt b/testing/setest/CMakeLists.txt new file mode 100644 index 000000000..42951c451 --- /dev/null +++ b/testing/setest/CMakeLists.txt @@ -0,0 +1,31 @@ +# ############################################################################## +# apps/testing/setest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_SETEST) + nuttx_add_application( + NAME + ${CONFIG_TESTING_SETEST_PROGNAME} + PRIORITY + ${CONFIG_TESTING_SETEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_SETEST_STACKSIZE} + SRCS + setest.c) +endif() diff --git a/testing/smart/CMakeLists.txt b/testing/smart/CMakeLists.txt new file mode 100644 index 000000000..dc4ea7280 --- /dev/null +++ b/testing/smart/CMakeLists.txt @@ -0,0 +1,24 @@ +# ############################################################################## +# apps/testing/smart/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_SMART) + nuttx_add_application(NAME smart MODULE ${CONFIG_TESTING_SMART} SRCS + smart_main.c) +endif() diff --git a/testing/smart_test/CMakeLists.txt b/testing/smart_test/CMakeLists.txt new file mode 100644 index 000000000..b1448da17 --- /dev/null +++ b/testing/smart_test/CMakeLists.txt @@ -0,0 +1,31 @@ +# ############################################################################## +# apps/testing/smart_test/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_SMART_TEST) + nuttx_add_application( + NAME + smart_test + STACKSIZE + 4096 + MODULE + ${CONFIG_TESTING_SMART_TEST} + SRCS + smart_test.c) +endif() diff --git a/testing/stressapptest/CMakeLists.txt b/testing/stressapptest/CMakeLists.txt new file mode 100644 index 000000000..3e49865fe --- /dev/null +++ b/testing/stressapptest/CMakeLists.txt @@ -0,0 +1,56 @@ +# ############################################################################## +# apps/testing/stressapptest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_STRESSAPPTEST) + + set(SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/stressapptest/src) + + set(SRCS + ${SRC_DIR}/main.cc + ${SRC_DIR}/adler32memcpy.cc + ${SRC_DIR}/disk_blocks.cc + ${SRC_DIR}/error_diag.cc + ${SRC_DIR}/finelock_queue.cc + ${SRC_DIR}/logger.cc + ${SRC_DIR}/os.cc + ${SRC_DIR}/os_factory.cc + ${SRC_DIR}/pattern.cc + ${SRC_DIR}/queue.cc + ${SRC_DIR}/sat.cc + ${SRC_DIR}/sat_factory.cc + ${SRC_DIR}/worker.cc) + + set(FLAGS -DHAVE_CONFIG_H -fpermissive) + + nuttx_add_application( + NAME + stressapptest + PRIORITY + ${CONFIG_TESTING_STRESSAPPTEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_STRESSAPPTEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_STRESSAPPTEST} + COMPILE_FLAGS + ${FLAGS} + SRCS + ${SRCS}) + +endif()