Skip to content
Open
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
8 changes: 4 additions & 4 deletions testing/ostest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ if(CONFIG_TESTING_OSTEST)
list(APPEND SRCS sporadic.c sporadic2.c)
endif()

if(CONFIG_SCHED_WORKQUEUE)
list(APPEND SRCS wqueue.c)
endif()

if(CONFIG_PRIORITY_INHERITANCE)
list(APPEND SRCS prioinherit.c)
endif() # CONFIG_PRIORITY_INHERITANCE
endif() # CONFIG_DISABLE_PTHREAD

if(CONFIG_TESTING_OSTEST_WQUEUE)
list(APPEND SRCS wqueue.c)
endif()

if(NOT CONFIG_DISABLE_MQUEUE)
if(NOT CONFIG_DISABLE_PTHREAD)
list(APPEND SRCS timedmqueue.c)
Expand Down
10 changes: 10 additions & 0 deletions testing/ostest/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ config TESTING_OSTEST_AIOPATH

endif

config TESTING_OSTEST_WQUEUE
bool "Work queue tests"
default y
depends on (BUILD_FLAT && !DISABLE_PTHREAD && SCHED_WORKQUEUE) || LIBC_USRWORK

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sqaush into the first patch

---help---
Enables the work queue tests. In non-flat builds, the tests run in
user space and require the libc user work queue implementation. If
pthread support is disabled, only the predefined USRWORK queue is
tested because dynamically allocated queues require pthread support.

config TESTING_OSTEST_RR_RANGE
int "Round-robin test - end of search range"
default 30000
Expand Down
8 changes: 4 additions & 4 deletions testing/ostest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ ifeq ($(CONFIG_SCHED_SPORADIC),y)
CSRCS += sporadic.c sporadic2.c
endif

ifeq ($(CONFIG_SCHED_WORKQUEUE),y)
CSRCS += wqueue.c
endif

ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
CSRCS += prioinherit.c
endif
endif # CONFIG_DISABLE_PTHREAD

ifeq ($(CONFIG_TESTING_OSTEST_WQUEUE),y)
CSRCS += wqueue.c
endif

ifneq ($(CONFIG_DISABLE_MQUEUE),y)
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
CSRCS += timedmqueue.c
Expand Down
2 changes: 1 addition & 1 deletion testing/ostest/ostest.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int chroot_test(void);

/* wqueue.c *****************************************************************/

#if defined(CONFIG_SCHED_LPWORK) || defined(CONFIG_SCHED_HPWORK)
#ifdef CONFIG_TESTING_OSTEST_WQUEUE
void wqueue_test(void);
#endif

Expand Down
36 changes: 22 additions & 14 deletions testing/ostest/ostest_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ static void show_variable(const char *var_name, const char *exptd_value,
bool var_valid)
{
char *actual_value = getenv(var_name);

if (actual_value)
{
if (var_valid)
Expand Down Expand Up @@ -302,19 +303,19 @@ static int user_main(int argc, char *argv[])

#if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS) && \
defined(CONFIG_ENABLE_ALL_SIGNALS)
{
struct sigaction sa;
int ret;
{
struct sigaction sa;
int ret;

sa.sa_handler = SIG_IGN;
sa.sa_flags = SA_NOCLDWAIT;
ret = sigaction(SIGCHLD, &sa, NULL);
if (ret < 0)
{
printf("user_main: ERROR: sigaction failed: %d\n", errno);
ASSERT(false);
}
}
sa.sa_handler = SIG_IGN;
sa.sa_flags = SA_NOCLDWAIT;
ret = sigaction(SIGCHLD, &sa, NULL);
if (ret < 0)
{
printf("user_main: ERROR: sigaction failed: %d\n", errno);
ASSERT(false);
}
}
#endif

#ifndef CONFIG_DISABLE_ENVIRON
Expand Down Expand Up @@ -430,8 +431,7 @@ static int user_main(int argc, char *argv[])
check_test_memory_usage();
#endif

#if !defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_BUILD_FLAT) && \
defined(CONFIG_SCHED_WORKQUEUE)
#if defined(CONFIG_TESTING_OSTEST_WQUEUE) && defined(CONFIG_BUILD_FLAT)
/* Check work queues */

printf("\nuser_main: wqueue test\n");
Expand Down Expand Up @@ -770,6 +770,14 @@ int main(int argc, FAR char **argv)
}
#endif

#ifdef CONFIG_TESTING_OSTEST_WQUEUE
if (argc == 2 && strcmp(argv[1], "wqueue") == 0)
{
wqueue_test();
return EXIT_SUCCESS;
}
#endif

/* Verify that stdio works first */

stdio_test();
Expand Down
Loading
Loading