Skip to content

apps/testing: Move irtest/sensortest/resmonitor/monkey to apps/system #2976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2025
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
12 changes: 6 additions & 6 deletions testing/irtest/CMakeLists.txt → system/irtest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ##############################################################################
# apps/testing/irtest/CMakeLists.txt
# apps/system/irtest/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
Expand All @@ -20,19 +20,19 @@
#
# ##############################################################################

if(CONFIG_TESTING_IRTEST)
if(CONFIG_SYSTEM_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}
${CONFIG_SYSTEM_IRTEST_PROGNAME}
PRIORITY
${CONFIG_TESTING_IRTEST_PRIORITY}
${CONFIG_SYSTEM_IRTEST_PRIORITY}
STACKSIZE
${CONFIG_TESTING_IRTEST_STACKSIZE}
${CONFIG_SYSTEM_IRTEST_STACKSIZE}
MODULE
${CONFIG_TESTING_IRTEST}
${CONFIG_SYSTEM_IRTEST}
SRCS
${SRCS})
endif()
14 changes: 7 additions & 7 deletions testing/irtest/Kconfig → system/irtest/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
# see the file kconfig-language.txt in the NuttX tools repository.
#

config TESTING_IRTEST
config SYSTEM_IRTEST
tristate "IR driver test"
default n
depends on DRIVERS_RC
---help---
Enable the IR driver test

if TESTING_IRTEST
if SYSTEM_IRTEST

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

config TESTING_IRTEST_PRIORITY
config SYSTEM_IRTEST_PRIORITY
int "IR driver test task priority"
default 100

config TESTING_IRTEST_STACKSIZE
config SYSTEM_IRTEST_STACKSIZE
int "IR driver test stack size"
default DEFAULT_TASK_STACKSIZE

config TESTING_IRTEST_MAX_NIRDEV
config SYSTEM_IRTEST_MAX_NIRDEV
int "The Maximum number of IR devices supported"
default 2

config TESTING_IRTEST_MAX_SIRDATA
config SYSTEM_IRTEST_MAX_SIRDATA
int "The Maximum size of sending data in unsigned int"
default 64

Expand Down
4 changes: 2 additions & 2 deletions testing/irtest/Make.defs → system/irtest/Make.defs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################
# apps/testing/irtest/Make.defs
# apps/system/irtest/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
Expand All @@ -20,6 +20,6 @@
#
############################################################################

ifneq ($(CONFIG_TESTING_IRTEST),)
ifneq ($(CONFIG_SYSTEM_IRTEST),)
CONFIGURED_APPS += $(APPDIR)/testing/irtest
endif
10 changes: 5 additions & 5 deletions testing/irtest/Makefile → system/irtest/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################
# apps/testing/irtest/Makefile
# apps/system/irtest/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
Expand All @@ -22,10 +22,10 @@

include $(APPDIR)/Make.defs

PROGNAME = $(CONFIG_TESTING_IRTEST_PROGNAME)
PRIORITY = $(CONFIG_TESTING_IRTEST_PRIORITY)
STACKSIZE = $(CONFIG_TESTING_IRTEST_STACKSIZE)
MODULE = $(CONFIG_TESTING_IRTEST)
PROGNAME = $(CONFIG_SYSTEM_IRTEST_PROGNAME)
PRIORITY = $(CONFIG_SYSTEM_IRTEST_PRIORITY)
STACKSIZE = $(CONFIG_SYSTEM_IRTEST_STACKSIZE)
MODULE = $(CONFIG_SYSTEM_IRTEST)

MAINSRC = main.cxx
CXXSRCS = $(filter-out $(MAINSRC), $(wildcard *.cxx))
Expand Down
54 changes: 27 additions & 27 deletions testing/irtest/cmd.cxx → system/irtest/cmd.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* apps/testing/irtest/cmd.cxx
* apps/system/irtest/cmd.cxx
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -46,7 +46,7 @@

static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
static int g_irdevs[CONFIG_TESTING_IRTEST_MAX_NIRDEV];
static int g_irdevs[CONFIG_SYSTEM_IRTEST_MAX_NIRDEV];

/****************************************************************************
* Private Functions
Expand Down Expand Up @@ -190,7 +190,7 @@ CMD1(open_device, const char *, file_name)
}

int index = 0;
for (; index < CONFIG_TESTING_IRTEST_MAX_NIRDEV; index++)
for (; index < CONFIG_SYSTEM_IRTEST_MAX_NIRDEV; index++)
{
if (g_irdevs[index] == -1)
{
Expand All @@ -199,7 +199,7 @@ CMD1(open_device, const char *, file_name)
}
}

if (index == CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index == CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -209,7 +209,7 @@ CMD1(open_device, const char *, file_name)

CMD1(close_device, size_t, index)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -226,15 +226,15 @@ CMD1(close_device, size_t, index)

CMD1(write_data, size_t, index)
{
unsigned int data[CONFIG_TESTING_IRTEST_MAX_SIRDATA];
unsigned int data[CONFIG_SYSTEM_IRTEST_MAX_SIRDATA];

if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}

int size = 0;
for (; size < CONFIG_TESTING_IRTEST_MAX_SIRDATA; size++)
for (; size < CONFIG_SYSTEM_IRTEST_MAX_SIRDATA; size++)
{
unsigned int tmp = get_next_arg < unsigned int > ();
if (tmp == 0)
Expand Down Expand Up @@ -263,7 +263,7 @@ CMD1(write_data, size_t, index)

CMD2(read_data, size_t, index, size_t, size)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand Down Expand Up @@ -291,7 +291,7 @@ CMD2(read_data, size_t, index, size_t, size)

CMD1(get_features, size_t, index)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -308,7 +308,7 @@ CMD1(get_features, size_t, index)

CMD1(get_send_mode, size_t, index)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -325,7 +325,7 @@ CMD1(get_send_mode, size_t, index)

CMD1(get_rec_mode, size_t, index)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -342,7 +342,7 @@ CMD1(get_rec_mode, size_t, index)

CMD1(get_rec_resolution, size_t, index)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -359,7 +359,7 @@ CMD1(get_rec_resolution, size_t, index)

CMD1(get_min_timeout, size_t, index)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -376,7 +376,7 @@ CMD1(get_min_timeout, size_t, index)

CMD1(get_max_timeout, size_t, index)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -393,7 +393,7 @@ CMD1(get_max_timeout, size_t, index)

CMD1(get_length, size_t, index)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -410,7 +410,7 @@ CMD1(get_length, size_t, index)

CMD2(set_send_mode, size_t, index, unsigned int, mode)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -420,7 +420,7 @@ CMD2(set_send_mode, size_t, index, unsigned int, mode)

CMD2(set_rec_mode, size_t, index, unsigned int, mode)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -430,7 +430,7 @@ CMD2(set_rec_mode, size_t, index, unsigned int, mode)

CMD2(set_send_carrier, size_t, index, unsigned int, carrier)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -440,7 +440,7 @@ CMD2(set_send_carrier, size_t, index, unsigned int, carrier)

CMD2(set_rec_carrier, size_t, index, unsigned int, carrier)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -450,7 +450,7 @@ CMD2(set_rec_carrier, size_t, index, unsigned int, carrier)

CMD2(set_send_duty_cycle, size_t, index, unsigned int, duty_cycle)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -460,7 +460,7 @@ CMD2(set_send_duty_cycle, size_t, index, unsigned int, duty_cycle)

CMD2(set_transmitter_mask, size_t, index, unsigned int, mask)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -470,7 +470,7 @@ CMD2(set_transmitter_mask, size_t, index, unsigned int, mask)

CMD2(set_rec_timeout, size_t, index, unsigned int, timeout)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -480,7 +480,7 @@ CMD2(set_rec_timeout, size_t, index, unsigned int, timeout)

CMD2(set_rec_timeout_reports, size_t, index, unsigned int, enable)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -490,7 +490,7 @@ CMD2(set_rec_timeout_reports, size_t, index, unsigned int, enable)

CMD2(set_measure_carrier_mode, size_t, index, unsigned int, enable)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -500,7 +500,7 @@ CMD2(set_measure_carrier_mode, size_t, index, unsigned int, enable)

CMD2(set_rec_carrier_range, size_t, index, unsigned int, carrier)
{
if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV)
if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV)
{
return ERROR;
}
Expand All @@ -514,7 +514,7 @@ CMD2(set_rec_carrier_range, size_t, index, unsigned int, carrier)

void init_device()
{
for (int i = 0; i < CONFIG_TESTING_IRTEST_MAX_NIRDEV; i++)
for (int i = 0; i < CONFIG_SYSTEM_IRTEST_MAX_NIRDEV; i++)
g_irdevs[i] = -1;
}

Expand Down
8 changes: 4 additions & 4 deletions testing/irtest/cmd.hpp → system/irtest/cmd.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* apps/testing/irtest/cmd.hpp
* apps/system/irtest/cmd.hpp
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -20,8 +20,8 @@
*
****************************************************************************/

#ifndef __APPS_TESTING_IRTEST_CMD_HPP
#define __APPS_TESTING_IRTEST_CMD_HPP
#ifndef __APPS_SYSTEM_IRTEST_CMD_HPP
#define __APPS_SYSTEM_IRTEST_CMD_HPP

/****************************************************************************
* Included Files
Expand Down Expand Up @@ -179,4 +179,4 @@ inline float get_next_arg()

void init_device();

#endif /* __APPS_TESTING_IRTEST_CMD_H */
#endif /* __APPS_SYSTEM_IRTEST_CMD_H */
2 changes: 1 addition & 1 deletion testing/irtest/enum.cxx → system/irtest/enum.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* apps/testing/irtest/enum.cxx
* apps/system/irtest/enum.cxx
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down
8 changes: 4 additions & 4 deletions testing/irtest/enum.hpp → system/irtest/enum.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* apps/testing/irtest/enum.hpp
* apps/system/irtest/enum.hpp
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -20,8 +20,8 @@
*
****************************************************************************/

#ifndef __APPS_TESTING_IRTEST_ENUM_HPP
#define __APPS_TESTING_IRTEST_ENUM_HPP
#ifndef __APPS_SYSTEM_IRTEST_ENUM_HPP
#define __APPS_SYSTEM_IRTEST_ENUM_HPP

/****************************************************************************
* Included Files
Expand Down Expand Up @@ -71,4 +71,4 @@ struct enum_type

extern const struct enum_type *g_enum_table[];

#endif /* __APPS_TESTING_IRTEST_ENUM_H */
#endif /* __APPS_SYSTEM_IRTEST_ENUM_H */
Loading
Loading