Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions testing/nuts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ##############################################################################
# apps/testing/nuts/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# 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_NUTS)

set(SRCS)

if(CONFIG_TESTING_NUTS_DSTRUCTS)
file(GLOB DSTRUCTS dstructs/*.c)
list(APPEND SRCS ${DSTRUCTS})
endif() # CONFIG_TESTING_NUTS_DSTRUCTS

if(CONFIG_TESTING_NUTS_DEVICES)
file(GLOB DEVICES devices/*.c)
list(APPEND SRCS ${DEVICES})
endif() # CONFIG_TESTING_NUTS_DEVICES

set(NUTS_SRCS nuts_main.c ${SRCS})
nuttx_add_application(NAME ${CONFIG_TESTING_NUTS_PROGNAME} SRCS ${NUTS_SRCS})

endif()
104 changes: 104 additions & 0 deletions testing/nuts/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

config TESTING_NUTS
tristate "NuttX Unit Test Selection (NUTS)"
depends on TESTING_CMOCKA
default n
---help---
Enable the NuttX unit test selection, based on the cmocka test framework.

if TESTING_NUTS

comment "Program options"

config TESTING_NUTS_PROGNAME
string "Program name"
default "nuts"
---help---
The name of the program.

config TESTING_NUTS_STACKSIZE
int "Stack size"
default 1024
---help---
Size of the stack used to create the task.

menu "Test suites"

comment "Data structures"

config TESTING_NUTS_DSTRUCTS
bool "Collections tests"
default n
---help---
Enable test suites for collections.

if TESTING_NUTS_DSTRUCTS

config TESTING_NUTS_DSTRUCTS_LIST
bool "List testing"
default y
---help---
Enable list test cases.

config TESTING_NUTS_DSTRUCTS_CBUF
bool "Circular buffer testing"
default y
---help---
Enable circular buffer test cases.

endif # TESTING_NUTS_DSTRUCTS

comment "Devices"

config TESTING_NUTS_DEVICES
bool "Device tests"
default n
---help---
Enable test suites for devices.

if TESTING_NUTS_DEVICES

config TESTING_NUTS_DEVICES_DEVNULL
bool "/dev/null test"
depends on DEV_NULL
default y
---help---
Enable test cases for /dev/null device.

config TESTING_NUTS_DEVICES_DEVZERO
bool "/dev/zero test"
depends on DEV_ZERO
default y
---help---
Enable test cases for /dev/zero device.

config TESTING_NUTS_DEVICES_DEVASCII
bool "/dev/ascii test"
depends on DEV_ASCII
default y
---help---
Enable test cases for /dev/ascii device.

config TESTING_NUTS_DEVICES_DEVCONSOLE
bool "/dev/console test"
depends on DEV_CONSOLE
default y
---help---
Enable test cases for /dev/console device.

config TESTING_NUTS_DEVICES_DEVURANDOM
bool "/dev/urandom test"
depends on DEV_URANDOM
default y
---help---
Enable test cases for /dev/urandom device.

endif # TESTING_NUTS_DEVICES

endmenu # Test suites

endif # TESTING_NUTS
25 changes: 25 additions & 0 deletions testing/nuts/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
############################################################################
# apps/testing/nuts/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# 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_TESTING_NUTS),)
CONFIGURED_APPS += $(APPDIR)/testing/nuts
endif
45 changes: 45 additions & 0 deletions testing/nuts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
############################################################################
# apps/testing/nuts/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# 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.
#
############################################################################

include $(APPDIR)/Make.defs

# Application info

PROGNAME = $(CONFIG_TESTING_NUTS_PROGNAME)
PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = $(CONFIG_TESTING_NUTS_STACKSIZE)
MODULE = $(CONFIG_TESTING_OSTEST)

# Source inclusion

MAINSRC = nuts_main.c
CSRCS =

ifeq ($(CONFIG_TESTING_NUTS_DSTRUCTS),y)
CSRCS += $(wildcard $(CURDIR)/dstructs/*.c)
endif # CONFIG_TESTING_NUTS_DSTRUCTS

ifeq ($(CONFIG_TESTING_NUTS_DEVICES),y)
CSRCS += $(wildcard $(CURDIR)/devices/*.c)
endif # CONFIG_TESTING_NUTS_DEVICES

include $(APPDIR)/Application.mk
Loading
Loading