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
39 changes: 39 additions & 0 deletions testing/libc/ring/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ##############################################################################
# apps/testing/libc/ring/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_RING)
nuttx_add_application(
NAME
${CONFIG_TESTING_RING_PROGNAME}
PRIORITY
${CONFIG_TESTING_RING_PRIORITY}
STACKSIZE
${CONFIG_TESTING_RING_STACKSIZE}
MODULE
${CONFIG_TESTING_RING}
SRCS
ring_main.c
ring_spsc.c
ring_mpsc.c
ring_spmc.c
ring_mpmc.c)
endif()
30 changes: 30 additions & 0 deletions testing/libc/ring/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

config TESTING_RING
tristate "cmocka ring queue test"
default n
depends on TESTING_CMOCKA
---help---
Enable the lock-free ring queue testing using cmocka framework.

if TESTING_RING

config TESTING_RING_PROGNAME
string "Program name"
default "ring_test"
---help---
This is the name of the program that will be used when the NSH ELF
program is installed.

config TESTING_RING_PRIORITY
int "Ring test task priority"
default 100

config TESTING_RING_STACKSIZE
int "Ring test stack size"
default 8192

endif
25 changes: 25 additions & 0 deletions testing/libc/ring/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
############################################################################
# apps/testing/libc/ring/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_RING),)
CONFIGURED_APPS += $(APPDIR)/testing/libc/ring
endif
37 changes: 37 additions & 0 deletions testing/libc/ring/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
############################################################################
# apps/testing/libc/ring/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

# Ring test built-in application info

PROGNAME = $(CONFIG_TESTING_RING_PROGNAME)
PRIORITY = $(CONFIG_TESTING_RING_PRIORITY)
STACKSIZE = $(CONFIG_TESTING_RING_STACKSIZE)
MODULE = $(CONFIG_TESTING_RING)

# Ring test sources

CSRCS = ring_spsc.c ring_mpsc.c ring_spmc.c ring_mpmc.c
MAINSRC = ring_main.c

include $(APPDIR)/Application.mk
42 changes: 42 additions & 0 deletions testing/libc/ring/ring_main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/****************************************************************************
* apps/testing/libc/ring/ring_main.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include "ring_test.h"

/****************************************************************************
* Public Functions
****************************************************************************/

int main(int argc, FAR char *argv[])
{
int fail = 0;

fail += ring_test_spsc_local();
fail += ring_test_mpsc_local();
fail += ring_test_spmc_local();
fail += ring_test_mpmc_local();
return fail;
}
Loading
Loading