2011-03-20 19:18:19 +01:00
|
|
|
/****************************************************************************
|
2018-12-12 23:37:38 +01:00
|
|
|
* apps/testing/ostest/ostest.h
|
2011-03-20 19:18:19 +01:00
|
|
|
*
|
2021-03-18 20:41:20 +01:00
|
|
|
* 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
|
2011-03-20 19:18:19 +01:00
|
|
|
*
|
2021-03-18 20:41:20 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-03-20 19:18:19 +01:00
|
|
|
*
|
2021-03-18 20:41:20 +01:00
|
|
|
* 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.
|
2011-03-20 19:18:19 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2018-12-12 23:37:38 +01:00
|
|
|
#ifndef __APPS_TESTING_OSTEST_OSTEST_H
|
|
|
|
#define __APPS_TESTING_OSTEST_OSTEST_H
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
/****************************************************************************
|
2015-10-02 22:06:11 +02:00
|
|
|
* Pre-processor Definitions
|
2011-03-20 19:18:19 +01:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* The task_create task size can be specified in the defconfig file */
|
|
|
|
|
2018-12-12 23:37:38 +01:00
|
|
|
#ifdef CONFIG_TESTING_OSTEST_STACKSIZE
|
|
|
|
# define STACKSIZE CONFIG_TESTING_OSTEST_STACKSIZE
|
2011-03-20 19:18:19 +01:00
|
|
|
#else
|
|
|
|
# define STACKSIZE 8192
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* The number of times to execute the test can be specified in the defconfig
|
|
|
|
* file.
|
|
|
|
*/
|
|
|
|
|
2018-12-12 23:37:38 +01:00
|
|
|
#ifndef CONFIG_TESTING_OSTEST_LOOPS
|
|
|
|
# define CONFIG_TESTING_OSTEST_LOOPS 1
|
2011-03-20 19:18:19 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* This is the number of threads that are created in the barrier test.
|
|
|
|
* A smaller number should be selected on systems without sufficient memory
|
|
|
|
* to start so many threads.
|
|
|
|
*/
|
|
|
|
|
2018-12-12 23:37:38 +01:00
|
|
|
#ifndef CONFIG_TESTING_OSTEST_NBARRIER_THREADS
|
|
|
|
# define CONFIG_TESTING_OSTEST_NBARRIER_THREADS 8
|
2011-03-20 19:18:19 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Priority inheritance */
|
|
|
|
|
2016-06-11 22:13:39 +02:00
|
|
|
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_PRIORITY_INHERITANCE) && defined(CONFIG_SEM_PHDEBUG)
|
2011-03-20 19:18:19 +01:00
|
|
|
# define dump_nfreeholders(s) printf(s " nfreeholders: %d\n", sem_nfreeholders())
|
|
|
|
#else
|
|
|
|
# define dump_nfreeholders(s)
|
|
|
|
#endif
|
|
|
|
|
2011-05-28 23:42:18 +02:00
|
|
|
/* If CONFIG_STDIO_LINEBUFFER is defined, the STDIO buffer will be flushed
|
|
|
|
* on each new line. Otherwise, STDIO needs to be explicitly flushed to
|
|
|
|
* see the output in context.
|
|
|
|
*/
|
|
|
|
|
2018-04-22 23:29:59 +02:00
|
|
|
#ifndef CONFIG_STDIO_BUFFER_SIZE
|
|
|
|
# define CONFIG_STDIO_BUFFER_SIZE 0
|
|
|
|
#endif
|
|
|
|
|
2020-08-13 16:17:42 +02:00
|
|
|
#if defined(CONFIG_FILE_STREAM) && CONFIG_STDIO_BUFFER_SIZE > 0 && \
|
2019-02-11 20:10:10 +01:00
|
|
|
!defined(CONFIG_STDIO_LINEBUFFER)
|
2011-05-28 23:42:18 +02:00
|
|
|
# define FFLUSH() fflush(stdout)
|
|
|
|
#else
|
|
|
|
# define FFLUSH()
|
|
|
|
#endif
|
|
|
|
|
2011-03-20 19:18:19 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2016-02-22 01:15:00 +01:00
|
|
|
* Public Data
|
2011-03-20 19:18:19 +01:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
2021-04-01 22:17:07 +02:00
|
|
|
/* getopt.c *****************************************************************/
|
|
|
|
|
|
|
|
int getopt_test(void);
|
|
|
|
|
2017-02-09 17:58:51 +01:00
|
|
|
/* setvbuf.c ****************************************************************/
|
|
|
|
|
|
|
|
#ifndef CONFIG_STDIO_DISABLE_BUFFERING
|
|
|
|
int setvbuf_test(void);
|
|
|
|
#endif
|
|
|
|
|
2011-03-20 19:18:19 +01:00
|
|
|
/* dev_null.c ***************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
int dev_null(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
2012-02-24 22:34:55 +01:00
|
|
|
/* fpu.c ********************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void fpu_test(void);
|
2013-02-06 16:43:28 +01:00
|
|
|
|
2014-10-05 21:57:55 +02:00
|
|
|
/* aio.c ********************************************************************/
|
|
|
|
|
2018-12-12 23:37:38 +01:00
|
|
|
#ifdef CONFIG_TESTING_OSTEST_AIO
|
2014-10-05 21:57:55 +02:00
|
|
|
void aio_test(void);
|
|
|
|
#endif
|
|
|
|
|
2013-02-06 16:43:28 +01:00
|
|
|
/* restart.c ****************************************************************/
|
|
|
|
|
|
|
|
void restart_test(void);
|
2013-01-13 19:53:00 +01:00
|
|
|
|
|
|
|
/* waitpid.c ****************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_SCHED_WAITPID
|
|
|
|
int waitpid_test(void);
|
|
|
|
#endif
|
2012-02-24 22:34:55 +01:00
|
|
|
|
2011-03-20 19:18:19 +01:00
|
|
|
/* mutex.c ******************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void mutex_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
2019-02-24 22:43:45 +01:00
|
|
|
/* timedmutex.c *************************************************************/
|
|
|
|
|
|
|
|
void timedmutex_test(void);
|
|
|
|
|
2017-04-10 15:20:48 +02:00
|
|
|
/* rmutex.c *****************************************************************/
|
2011-03-20 19:18:19 +01:00
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void recursive_mutex_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
/* sem.c ********************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void sem_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
2014-09-26 15:04:34 +02:00
|
|
|
/* semtimed.c ***************************************************************/
|
|
|
|
|
|
|
|
void semtimed_test(void);
|
|
|
|
|
2014-12-06 14:33:40 +01:00
|
|
|
/* nsem.c *******************************************************************/
|
|
|
|
|
|
|
|
void nsem_test(void);
|
|
|
|
|
2011-03-20 19:18:19 +01:00
|
|
|
/* cond.c *******************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void cond_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
2018-12-28 21:17:40 +01:00
|
|
|
/* specific.c ***************************************************************/
|
|
|
|
|
|
|
|
void specific_test(void);
|
|
|
|
|
2011-03-20 19:18:19 +01:00
|
|
|
/* mqueue.c *****************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void mqueue_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
/* timedmqueue.c ************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void timedmqueue_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
/* cancel.c *****************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void cancel_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
2017-03-26 22:45:48 +02:00
|
|
|
/* robust.c *****************************************************************/
|
|
|
|
|
2017-03-27 14:55:51 +02:00
|
|
|
#ifndef CONFIG_PTHREAD_MUTEX_UNSAFE
|
2017-03-26 22:45:48 +02:00
|
|
|
void robust_test(void);
|
2017-03-27 14:55:51 +02:00
|
|
|
#endif
|
2017-03-26 22:45:48 +02:00
|
|
|
|
2011-03-20 19:18:19 +01:00
|
|
|
/* timedwait.c **************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void timedwait_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
2017-04-10 15:20:48 +02:00
|
|
|
/* sigprocmask.c ************************************************************/
|
2015-04-09 23:53:59 +02:00
|
|
|
|
|
|
|
void sigprocmask_test(void);
|
|
|
|
|
2011-03-20 19:18:19 +01:00
|
|
|
/* sighand.c ****************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void sighand_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
2015-05-12 20:39:21 +02:00
|
|
|
/* signest.c ****************************************************************/
|
|
|
|
|
2015-05-13 04:58:22 +02:00
|
|
|
void signest_test(void);
|
2015-05-12 20:39:21 +02:00
|
|
|
|
2018-08-30 20:00:41 +02:00
|
|
|
/* suspend.c ****************************************************************/
|
|
|
|
|
|
|
|
void suspend_test(void);
|
|
|
|
|
2011-03-20 19:18:19 +01:00
|
|
|
/* posixtimers.c ************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void timer_test(void);
|
2015-12-30 23:29:21 +01:00
|
|
|
void sigev_thread_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
/* roundrobin.c *************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void rr_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
2017-04-10 15:20:48 +02:00
|
|
|
/* sporadic.c ***************************************************************/
|
2015-07-24 21:50:31 +02:00
|
|
|
|
|
|
|
void sporadic_test(void);
|
|
|
|
|
2021-03-18 20:41:20 +01:00
|
|
|
/* sporadic2.c **************************************************************/
|
|
|
|
|
|
|
|
void sporadic2_test(void);
|
|
|
|
|
2016-03-11 21:02:00 +01:00
|
|
|
/* tls.c ********************************************************************/
|
|
|
|
|
|
|
|
void tls_test(void);
|
|
|
|
|
2017-04-10 15:20:48 +02:00
|
|
|
/* pthread_rwlock.c *********************************************************/
|
2017-04-07 15:23:14 +02:00
|
|
|
|
|
|
|
void pthread_rwlock_test(void);
|
|
|
|
|
2017-04-10 15:20:48 +02:00
|
|
|
/* pthread_rwlock_cancel.c **************************************************/
|
|
|
|
|
|
|
|
void pthread_rwlock_cancel_test(void);
|
|
|
|
|
|
|
|
/* pthread_cleanup.c ********************************************************/
|
|
|
|
|
|
|
|
void pthread_cleanup_test(void);
|
|
|
|
|
2011-03-20 19:18:19 +01:00
|
|
|
/* barrier.c ****************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void barrier_test(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
|
|
|
/* prioinherit.c ************************************************************/
|
|
|
|
|
2013-01-13 19:53:00 +01:00
|
|
|
void priority_inheritance(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
|
2013-01-07 22:41:20 +01:00
|
|
|
/* vfork.c ******************************************************************/
|
|
|
|
|
2017-01-24 16:15:42 +01:00
|
|
|
#if defined(CONFIG_ARCH_HAVE_VFORK) && defined(CONFIG_SCHED_WAITPID)
|
2013-01-13 19:53:00 +01:00
|
|
|
int vfork_test(void);
|
2013-01-07 22:41:20 +01:00
|
|
|
#endif
|
|
|
|
|
2011-03-20 19:18:19 +01:00
|
|
|
/* APIs exported (conditionally) by the OS specifically for testing of
|
|
|
|
* priority inheritance
|
|
|
|
*/
|
|
|
|
|
2016-06-11 22:13:39 +02:00
|
|
|
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_PRIORITY_INHERITANCE) && defined(CONFIG_SEM_PHDEBUG)
|
2013-01-13 19:53:00 +01:00
|
|
|
void sem_enumholders(FAR sem_t *sem);
|
|
|
|
int sem_nfreeholders(void);
|
2011-03-20 19:18:19 +01:00
|
|
|
#else
|
|
|
|
# define sem_enumholders(sem)
|
|
|
|
# define sem_nfreeholders()
|
|
|
|
#endif
|
|
|
|
|
2018-12-12 23:37:38 +01:00
|
|
|
#endif /* __APPS_TESTING_OSTEST_OSTEST_H */
|