Skip to content

Commit

Permalink
mv tests/testsuites apps/testing/testsuites
Browse files Browse the repository at this point in the history
Signed-off-by: v-wangshihang <[email protected]>
  • Loading branch information
w-shihang authored and xiaoxiang781216 committed Jan 1, 2025
1 parent 00f8aea commit 30b3d77
Show file tree
Hide file tree
Showing 217 changed files with 37,973 additions and 0 deletions.
268 changes: 268 additions & 0 deletions testing/testsuites/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
# ##############################################################################
# apps/testing/testsuites/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_CM_FS_TEST)
set(INCDIR
${CMAKE_CURRENT_SOURCE_DIR}/kernel/fs/include ${NUTTX_DIR}/../apps/nshlib
${NUTTX_DIR}/../apps/testing/cmocka/include)
file(GLOB FS_CSRCS ${CMAKE_CURRENT_SOURCE_DIR}/kernel/fs/cases/*.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/fs/common/*.c)
nuttx_add_application(
NAME
cmocka_fs_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/fs/cmocka_fs_test.c
${FS_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
endif()

if(CONFIG_CM_SCHED_TEST)
set(INCDIR ${CMAKE_CURRENT_SOURCE_DIR}/kernel/sched/include
${NUTTX_DIR}/../apps/testing/cmocka/include)
file(GLOB SCHED_CSRCS ${CMAKE_CURRENT_SOURCE_DIR}/kernel/sched/cases/*.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/sched/common/*.c)
nuttx_add_application(
NAME
cmocka_sched_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/sched/cmocka_sched_test.c
${SCHED_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
endif()

if(CONFIG_CM_SYSCALL_TEST)
set(INCDIR
${CMAKE_CURRENT_SOURCE_DIR}/kernel/syscall/include
${NUTTX_DIR}/../apps/nshlib ${NUTTX_DIR}/../apps/testing/cmocka/include)
file(GLOB SYSCALL_CSRCS ${CMAKE_CURRENT_SOURCE_DIR}/kernel/syscall/cases/*.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/syscall/common/*.c)
nuttx_add_application(
NAME
cmocka_syscall_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/syscall/cmocka_syscall_test.c
${SYSCALL_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
endif()

if(CONFIG_CM_MM_TEST)
set(INCDIR ${CMAKE_CURRENT_SOURCE_DIR}/kernel/mm/include
${NUTTX_DIR}/../apps/testing/cmocka/include)
file(GLOB MM_CSRCS ${CMAKE_CURRENT_SOURCE_DIR}/kernel/mm/cases/*.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/mm/common/*.c)

nuttx_add_application(
NAME
cmocka_mm_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/mm/cmocka_mm_test.c
${MM_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
nuttx_add_application(
NAME
mem_batch_opt_perf_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/mm/tool/mem_batch_opt_perf_test.c
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
nuttx_add_application(
NAME
mem_cycle_opt_perf_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/mm/tool/mem_cycle_opt_perf_test.c
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
endif()

if(CONFIG_CM_KVDB_TEST)
set(INCDIR
${CMAKE_CURRENT_SOURCE_DIR}/kernel/kv/include
${NUTTX_DIR}/../frameworks/utils/include
${NUTTX_DIR}/../apps/testing/cmocka/include)
file(GLOB KVDB_CSRCS ${CMAKE_CURRENT_SOURCE_DIR}/kernel/kv/cases/*.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/kv/common/*.c)
nuttx_add_application(
NAME
cmocka_kv_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/kv/cmocka_kv_test.c
${KVDB_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
endif()

if(CONFIG_CM_TIME_TEST)
set(INCDIR ${CMAKE_CURRENT_SOURCE_DIR}/kernel/time/include
${NUTTX_DIR}/../apps/testing/cmocka/include ${NUTTX_DIR}/include)
file(GLOB TIME_CSRCS ${CMAKE_CURRENT_SOURCE_DIR}/kernel/time/cases/*.c)
nuttx_add_application(
NAME
cmocka_time_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/time/cmocka_time_test.c
${TIME_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
endif()

if(CONFIG_CM_SOCKET_TEST)
set(INCDIR ${CMAKE_CURRENT_SOURCE_DIR}/kernel/socket/include
${NUTTX_DIR}/../apps/testing/cmocka/include)
file(GLOB SOCKET_CSRCS ${CMAKE_CURRENT_SOURCE_DIR}/kernel/socket/cases/*.c)
nuttx_add_application(
NAME
cmocka_socket_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/socket/cmocka_socket_test.c
${SOCKET_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
endif()

if(CONFIG_CM_PTHREAD_TEST)
set(INCDIR ${CMAKE_CURRENT_SOURCE_DIR}/kernel/pthread/include
${NUTTX_DIR}/../apps/testing/cmocka/include)
file(GLOB PTHREAD_CSRCS ${CMAKE_CURRENT_SOURCE_DIR}/kernel/pthread/cases/*.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/pthread/common/*.c)
nuttx_add_application(
NAME
cmocka_pthread_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/pthread/cmocka_pthread_test.c
${PTHREAD_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
endif()

if(CONFIG_CM_MUTEX_TEST)
set(INCDIR ${CMAKE_CURRENT_SOURCE_DIR}/kernel/mutex/include
${NUTTX_DIR}/../apps/testing/cmocka/include)
file(GLOB MUTEX_CSRCS ${CMAKE_CURRENT_SOURCE_DIR}/kernel/mutex/cases/*.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/mutex/common/*.c)
nuttx_add_application(
NAME
cmocka_mutex_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/mutex/cmocka_mutex_test.c
${MUTEX_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
endif()

if(CONFIG_TEST_TELEPHONY)
set(INCDIR
${NUTTX_DIR}/../apps/frameworks/telephony/include
${NUTTX_DIR}/../apps/testing/cmocka/cmocka/include
${NUTTX_DIR}/../apps/testing/cmocka/include)
file(
GLOB
TELEPHONY_CSRCS
${CMAKE_CURRENT_SOURCE_DIR}/kernel/telephony/telephony_sim_test.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/telephony/telephony_call_test.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/telephony/telephony_data_test.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/telephony/telephony_sms_test.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/telephony/telephony_network_test.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/telephony/telephony_common_test.c
${CMAKE_CURRENT_SOURCE_DIR}/kernel/telephony/telephony_ims_test.c)
nuttx_add_application(
NAME
cmocka_telephony_test
STACKSIZE
${CONFIG_TESTING_TESTCASES_STACKSIZE}
PRIORITY
${CONFIG_TESTING_TESTCASES_PRIORITY}
SRCS
kernel/telephony/cmocka_telephony_test.c
${TELEPHONY_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
cmocka)
endif()
88 changes: 88 additions & 0 deletions testing/testsuites/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

config TESTS_TESTSUITES
tristate "vela test suite"
default n
depends on TESTING_CMOCKA
---help---
Enable testsuites for the vela

if TESTS_TESTSUITES

config TESTS_TESTSUITES_MOUNT_DIR
string "Mount directory for the testsuites"
default "/data"

config TESTS_TESTSUITES_PRIORITY
int "Testsuites task priority"
default 99

config TESTS_TESTSUITES_STACKSIZE
int "Testsuites stack size"
default 16384

config CM_FS_TEST
bool "enable fs test"
default n
depends on TESTS_TESTSUITES

config CM_SCHED_TEST
bool "enbale schedule test"
default n
depends on TESTS_TESTSUITES

config CM_SYSCALL_TEST
bool "enbale syscall test"
default n
depends on TESTS_TESTSUITES

config CM_MM_TEST
bool "enbale MM test"
default n
depends on TESTS_TESTSUITES

config CM_KVDB_TEST
bool "enbale kvdb test"
default n
depends on TESTS_TESTSUITES

config CM_TIME_TEST
bool "enbale time test"
default n
depends on TESTS_TESTSUITES

config CM_SOCKET_TEST
bool "enbale socket test"
default n
depends on TESTS_TESTSUITES

config CM_PTHREAD_TEST
bool "enbale pthread test"
default n
depends on TESTS_TESTSUITES

config CM_MUTEX_TEST
bool "enbale mutex test"
default n
depends on TESTS_TESTSUITES

config TEST_TELEPHONY
bool "enbale telephony test"
default n
depends on TESTS_TESTSUITES

if TEST_TELEPHONY
config TEST_PHONE_NUMBER
string "test phone number"
default "10086"
endif

config CM_DFX_TEST
bool "enbale dfx test"
default n
depends on TESTS_TESTSUITES

endif # TESTS_TESTSUITES
24 changes: 24 additions & 0 deletions testing/testsuites/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
############################################################################
# apps/testing/testsuites/Make.defs
#
# 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.
#
#
############################################################################

ifneq ($(CONFIG_TESTS_TESTSUITES),)
CONFIGURED_APPS += $(APPDIR)/testing/testsuites
endif
Loading

0 comments on commit 30b3d77

Please sign in to comment.