diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-12-09 15:58:14 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-03-24 11:10:48 +0100 |
commit | 212b0ca440d6bb2f3e5d2638508227c2a7106a57 (patch) | |
tree | db12bd4dac059eb7871bbca4aa96555e5bd57791 /testsuites | |
parent | validation: Improve support library (diff) | |
download | rtems-212b0ca440d6bb2f3e5d2638508227c2a7106a57.tar.bz2 |
validation: Add test suites
The test source code is generated from specification items
by the "./spec2modules.py" script contained in the
git://git.rtems.org/rtems-central.git Git repository.
Please read the "How-To" section in the "Software Requirements Engineering"
chapter of the RTEMS Software Engineering manual to get more information about
the process.
Update #3716.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/validation/ts-acfg.h | 81 | ||||
-rw-r--r-- | testsuites/validation/ts-default.h | 167 | ||||
-rw-r--r-- | testsuites/validation/ts-idle.h | 98 | ||||
-rw-r--r-- | testsuites/validation/ts-performance-no-clock-0.c (renamed from testsuites/validation/ts-performance-0.c) | 12 | ||||
-rw-r--r-- | testsuites/validation/ts-validation-1.c | 10 | ||||
-rw-r--r-- | testsuites/validation/ts-validation-no-clock-0.c | 81 | ||||
-rw-r--r-- | testsuites/validation/ts-validation-non-smp.c | 75 | ||||
-rw-r--r-- | testsuites/validation/ts-validation-one-cpu-0.c | 80 | ||||
-rw-r--r-- | testsuites/validation/ts-validation-smp-only-0.c | 78 | ||||
-rw-r--r-- | testsuites/validation/ts-validation-smp-only-1.c | 94 |
10 files changed, 740 insertions, 36 deletions
diff --git a/testsuites/validation/ts-acfg.h b/testsuites/validation/ts-acfg.h new file mode 100644 index 0000000000..3ee9951ebd --- /dev/null +++ b/testsuites/validation/ts-acfg.h @@ -0,0 +1,81 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @brief This header file provides a validation test suite runner for + * validation test cases specific to the application configuration. + */ + +/* + * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <rtems.h> +#include <rtems/bspIo.h> +#include <rtems/test.h> +#include <rtems/test-info.h> +#include <rtems/testopts.h> + +static char buffer[ 512 ]; + +static const T_action actions[] = { + T_report_hash_sha256 +}; + +static const T_config test_config = { + .name = rtems_test_name, + .buf = buffer, + .buf_size = sizeof( buffer ), + .putchar = rtems_put_char, + .verbosity = RTEMS_TEST_VERBOSITY, + .now = T_now_tick, + .allocate = T_memory_allocate, + .deallocate = T_memory_deallocate, + .action_count = T_ARRAY_SIZE( actions ), + .actions = actions +}; + +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 0 + +#define CONFIGURE_DISABLE_NEWLIB_REENTRANCY + +#define CONFIGURE_APPLICATION_DISABLE_FILESYSTEM + +RTEMS_NO_RETURN static void RunTestSuite( void ) +{ + int exit_code; + + rtems_test_begin( rtems_test_name, TEST_STATE ); + T_register(); + exit_code = T_main( &test_config ); + + if ( exit_code == 0 ) { + rtems_test_end( rtems_test_name ); + } + + rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, (uint32_t) exit_code ); +} diff --git a/testsuites/validation/ts-default.h b/testsuites/validation/ts-default.h index addf1866f5..9f317abf80 100644 --- a/testsuites/validation/ts-default.h +++ b/testsuites/validation/ts-default.h @@ -32,23 +32,29 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <rtems.h> +#include <bsp.h> #include <rtems/bspIo.h> #include <rtems/chain.h> #include <rtems/test-info.h> #include <rtems/testopts.h> #include <rtems/test.h> +#include <rtems/test-scheduler.h> -#define MAX_TLS_SIZE RTEMS_ALIGN_UP( 64, RTEMS_TASK_STORAGE_ALIGNMENT ) +#include "ts-config.h" +#include "tx-support.h" -#define MAX_TASKS 32 +#if !defined( MAX_TLS_SIZE ) +#define MAX_TLS_SIZE TEST_MAXIMUM_TLS_SIZE +#endif + +#define MAX_TASKS ( TEST_MAXIMUM_TASKS - 1 ) #define TASK_ATTRIBUTES RTEMS_FLOATING_POINT #define TASK_STORAGE_SIZE \ RTEMS_TASK_STORAGE_SIZE( \ - MAX_TLS_SIZE + RTEMS_MINIMUM_STACK_SIZE + \ + MAX_TLS_SIZE + TEST_MINIMUM_STACK_SIZE + \ CPU_STACK_ALIGNMENT - CPU_HEAP_ALIGNMENT, \ TASK_ATTRIBUTES \ ) @@ -75,7 +81,11 @@ static const T_config test_config = { .buf_size = sizeof( buffer ), .putchar = rtems_put_char, .verbosity = RTEMS_TEST_VERBOSITY, +#if defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) .now = T_now_clock, +#else + .now = T_now_tick, +#endif .allocate = T_memory_allocate, .deallocate = T_memory_deallocate, .action_count = T_ARRAY_SIZE( actions ), @@ -91,11 +101,29 @@ static union { rtems_chain_node node; } task_storage[ MAX_TASKS ]; -static void Init( rtems_task_argument arg ) +rtems_task_argument test_runner_argument; + +rtems_task_priority test_runner_initial_priority; + +rtems_mode test_runner_initial_modes; + +static void Runner( rtems_task_argument arg ) { int exit_code; - (void) arg; + test_runner_argument = arg; + + (void) rtems_task_mode( + RTEMS_ASR, + RTEMS_ASR_MASK, + &test_runner_initial_modes + ); + + (void) rtems_task_set_priority( + RTEMS_SELF, + PRIO_DEFAULT, + &test_runner_initial_priority + ); rtems_chain_initialize( &free_task_storage, @@ -115,16 +143,18 @@ static void Init( rtems_task_argument arg ) rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, (uint32_t) exit_code ); } -static void *task_stack_allocate( size_t size ) +void *test_task_stack_allocate( size_t size ) { if ( size > sizeof( task_storage[ 0 ] ) ) { return NULL; } + T_quiet_ge_sz( size, TEST_MINIMUM_STACK_SIZE ); + return rtems_chain_get_unprotected( &free_task_storage ); } -static void task_stack_deallocate( void *stack ) +void test_task_stack_deallocate( void *stack ) { rtems_chain_append_unprotected( &free_task_storage, @@ -132,28 +162,36 @@ static void task_stack_deallocate( void *stack ) ); } +#if !defined( CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER ) #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#endif + +#define CONFIGURE_MINIMUM_TASK_STACK_SIZE TEST_MINIMUM_STACK_SIZE + +#define CONFIGURE_INTERRUPT_STACK_SIZE TEST_INTERRUPT_STACK_SIZE -#define CONFIGURE_MAXIMUM_BARRIERS 3 +#define CONFIGURE_MAXIMUM_BARRIERS TEST_MAXIMUM_BARRIERS -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 3 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES TEST_MAXIMUM_MESSAGE_QUEUES -#define CONFIGURE_MAXIMUM_PARTITIONS 3 +#define CONFIGURE_MAXIMUM_PARTITIONS TEST_MAXIMUM_PARTITIONS -#define CONFIGURE_MAXIMUM_PERIODS 3 +#define CONFIGURE_MAXIMUM_PERIODS TEST_MAXIMUM_PERIODS -#define CONFIGURE_MAXIMUM_SEMAPHORES 3 +#define CONFIGURE_MAXIMUM_SEMAPHORES TEST_MAXIMUM_SEMAPHORES -#define CONFIGURE_MAXIMUM_TASKS ( 1 + MAX_TASKS ) +#define CONFIGURE_MAXIMUM_TASKS TEST_MAXIMUM_TASKS #define CONFIGURE_MINIMUM_TASKS_WITH_USER_PROVIDED_STORAGE \ CONFIGURE_MAXIMUM_TASKS -#define CONFIGURE_MAXIMUM_TIMERS 3 +#define CONFIGURE_MAXIMUM_TIMERS TEST_MAXIMUM_TIMERS -#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 3 +#define CONFIGURE_MAXIMUM_USER_EXTENSIONS TEST_MAXIMUM_USER_EXTENSIONS -#define CONFIGURE_MICROSECONDS_PER_TICK 1000 +#define CONFIGURE_MICROSECONDS_PER_TICK TEST_MICROSECONDS_PER_TICK + +#define CONFIGURE_TICKS_PER_TIMESLICE TEST_TICKS_PER_TIMESLICE #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 0 @@ -165,35 +203,67 @@ static void task_stack_deallocate( void *stack ) #define CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE -#define CONFIGURE_TASK_STACK_ALLOCATOR task_stack_allocate +#define CONFIGURE_TASK_STACK_ALLOCATOR test_task_stack_allocate -#define CONFIGURE_TASK_STACK_DEALLOCATOR task_stack_deallocate +#define CONFIGURE_TASK_STACK_DEALLOCATOR test_task_stack_deallocate #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_ATTRIBUTES TASK_ATTRIBUTES +#define CONFIGURE_INIT_TASK_ARGUMENTS TEST_RUNNER_ARGUMENT -#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES +#define CONFIGURE_INIT_TASK_ATTRIBUTES ( RTEMS_SYSTEM_TASK | TASK_ATTRIBUTES ) #define CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE TASK_STORAGE_SIZE +#define CONFIGURE_INIT_TASK_ENTRY_POINT Runner + +#define CONFIGURE_INIT_TASK_INITIAL_MODES TEST_RUNNER_INITIAL_MODES + +#define CONFIGURE_INIT_TASK_NAME TEST_RUNNER_NAME + +#define CONFIGURE_INIT_TASK_PRIORITY 0 + +#if !defined( CONFIGURE_INITIAL_EXTENSIONS ) +#define CONFIGURE_INITIAL_EXTENSIONS { .fatal = FatalInitialExtension } +#endif + #if defined( RTEMS_SMP ) && \ ( CONFIGURE_MAXIMUM_PROCESSORS == 4 || CONFIGURE_MAXIMUM_PROCESSORS == 5 ) +#include <rtems/score/scheduleredfsmp.h> + +const Scheduler_Operations +T_scheduler_operations[ CONFIGURE_MAXIMUM_PROCESSORS ] = { + SCHEDULER_EDF_SMP_ENTRY_POINTS, + SCHEDULER_EDF_SMP_ENTRY_POINTS, + SCHEDULER_EDF_SMP_ENTRY_POINTS, +#if CONFIGURE_MAXIMUM_PROCESSORS >= 5 + SCHEDULER_EDF_SMP_ENTRY_POINTS, +#endif + SCHEDULER_EDF_SMP_ENTRY_POINTS +}; + +#undef SCHEDULER_EDF_SMP_ENTRY_POINTS + +#define SCHEDULER_EDF_SMP_ENTRY_POINTS T_SCHEDULER_ENTRY_POINTS + #define CONFIGURE_SCHEDULER_EDF_SMP #include <rtems/scheduler.h> -RTEMS_SCHEDULER_EDF_SMP(a); +RTEMS_SCHEDULER_EDF_SMP( a ); + +RTEMS_SCHEDULER_EDF_SMP( b ); -RTEMS_SCHEDULER_EDF_SMP(b); +RTEMS_SCHEDULER_EDF_SMP( c ); -RTEMS_SCHEDULER_EDF_SMP(c); +RTEMS_SCHEDULER_EDF_SMP( d ); #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \ - RTEMS_SCHEDULER_TABLE_EDF_SMP(a, rtems_build_name('A', ' ', ' ', ' ')), \ - RTEMS_SCHEDULER_TABLE_EDF_SMP(b, rtems_build_name('B', ' ', ' ', ' ')), \ - RTEMS_SCHEDULER_TABLE_EDF_SMP(c, rtems_build_name('C', ' ', ' ', ' ')) + RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME ), \ + RTEMS_SCHEDULER_TABLE_EDF_SMP( b, TEST_SCHEDULER_B_NAME ), \ + RTEMS_SCHEDULER_TABLE_EDF_SMP( c, TEST_SCHEDULER_C_NAME ), \ + RTEMS_SCHEDULER_TABLE_EDF_SMP( d, TEST_SCHEDULER_D_NAME ) #if CONFIGURE_MAXIMUM_PROCESSORS == 5 #define CONFIGURE_SCHEDULER_ASSIGNMENTS \ @@ -210,7 +280,48 @@ RTEMS_SCHEDULER_EDF_SMP(c); RTEMS_SCHEDULER_ASSIGN(2, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL) #endif -#endif /* RTEMS_SMP */ +#elif !defined( CONFIGURE_SCHEDULER_ASSIGNMENTS ) + +#include <rtems/score/schedulerpriority.h> + +#undef CONFIGURE_MAXIMUM_PROCESSORS +#define CONFIGURE_MAXIMUM_PROCESSORS 1 + +const Scheduler_Operations +T_scheduler_operations[ CONFIGURE_MAXIMUM_PROCESSORS ] = { + SCHEDULER_PRIORITY_ENTRY_POINTS +}; + +#undef SCHEDULER_PRIORITY_ENTRY_POINTS + +#define SCHEDULER_PRIORITY_ENTRY_POINTS T_SCHEDULER_ENTRY_POINTS + +#define CONFIGURE_SCHEDULER_NAME TEST_SCHEDULER_A_NAME + +#define CONFIGURE_SCHEDULER_PRIORITY + +#define CONFIGURE_MAXIMUM_PRIORITY 127 + +#endif + +#define CONFIGURE_IDLE_TASK_STACK_SIZE TEST_IDLE_STACK_SIZE + +static char test_idle_stacks[ CONFIGURE_MAXIMUM_PROCESSORS ][ + ( TEST_IDLE_STACK_SIZE + CPU_IDLE_TASK_IS_FP * CONTEXT_FP_SIZE ) +] +RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT ) +RTEMS_SECTION( ".rtemsstack.idle" ); + +void *test_idle_task_stack_allocate( uint32_t cpu_index, size_t size ) +{ + if ( size > sizeof( test_idle_stacks[ 0 ] ) ) { + rtems_fatal( RTEMS_FATAL_SOURCE_APPLICATION, 0xABAD1DEA ); + } + + return &test_idle_stacks[ cpu_index ][0]; +} + +#define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE test_idle_task_stack_allocate #define CONFIGURE_INIT diff --git a/testsuites/validation/ts-idle.h b/testsuites/validation/ts-idle.h new file mode 100644 index 0000000000..071209b5ef --- /dev/null +++ b/testsuites/validation/ts-idle.h @@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @brief This header file provides a configurable validation test suite runner + * and application configuration for tests which should run within an idle + * task without a user initialization task. + */ + +/* + * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <rtems.h> +#include <rtems/bspIo.h> +#include <rtems/test-info.h> +#include <rtems/testopts.h> + +#include <rtems/test.h> + +#include "tx-support.h" + +static char buffer[ 512 ]; + +static const T_action actions[] = { + T_report_hash_sha256 +}; + +static const T_config test_config = { + .name = rtems_test_name, + .buf = buffer, + .buf_size = sizeof( buffer ), + .putchar = rtems_put_char, + .verbosity = RTEMS_TEST_VERBOSITY, + .now = T_now_tick, + .allocate = T_memory_allocate, + .deallocate = T_memory_deallocate, + .action_count = T_ARRAY_SIZE( actions ), + .actions = actions +}; + +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 0 + +#define CONFIGURE_DISABLE_NEWLIB_REENTRANCY + +#define CONFIGURE_APPLICATION_DISABLE_FILESYSTEM + +#define CONFIGURE_INITIAL_EXTENSIONS \ + { .fatal = FatalInitialExtension } + +#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION + +void *IdleBody( uintptr_t ignored ) +{ + int exit_code; + + (void) ignored; + + rtems_test_begin( rtems_test_name, TEST_STATE ); + T_register(); + exit_code = T_main( &test_config ); + + if ( exit_code == 0 ) { + rtems_test_end( rtems_test_name ); + } + + rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, (uint32_t) exit_code ); +} + +#define CONFIGURE_IDLE_TASK_BODY IdleBody + +#define CONFIGURE_INIT + +#include <rtems/confdefs.h> diff --git a/testsuites/validation/ts-performance-0.c b/testsuites/validation/ts-performance-no-clock-0.c index 1fb15ecfce..e43b3a6327 100644 --- a/testsuites/validation/ts-performance-0.c +++ b/testsuites/validation/ts-performance-no-clock-0.c @@ -3,7 +3,7 @@ /** * @file * - * @ingroup RTEMSTestSuiteTestsuitesPerformance0 + * @ingroup RTEMSTestSuiteTestsuitesPerformanceNoClock0 */ /* @@ -57,8 +57,8 @@ #include <rtems/test.h> /** - * @defgroup RTEMSTestSuiteTestsuitesPerformance0 \ - * spec:/testsuites/performance-0 + * @defgroup RTEMSTestSuiteTestsuitesPerformanceNoClock0 \ + * spec:/testsuites/performance-no-clock-0 * * @ingroup RTEMSTestSuites * @@ -71,7 +71,11 @@ * @{ */ -const char rtems_test_name[] = "Performance0"; +const char rtems_test_name[] = "PerformanceNoClock0"; + +#define CONFIGURE_MAXIMUM_PROCESSORS 4 + +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER #include "ts-default.h" diff --git a/testsuites/validation/ts-validation-1.c b/testsuites/validation/ts-validation-1.c index 11bef51fb7..6f396dc873 100644 --- a/testsuites/validation/ts-validation-1.c +++ b/testsuites/validation/ts-validation-1.c @@ -7,7 +7,7 @@ */ /* - * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -60,15 +60,17 @@ * @ingroup RTEMSTestSuites * * @brief This general purpose validation test suite provides enough resources - * to run basic tests for all specified managers and functions in a - * configuration with exactly one processor. + * to run basic tests for all specified managers and functions. + * + * In SMP configurations, up to three scheduler instances using the SMP EDF + * scheduler are provided using up to four processors. * * @{ */ const char rtems_test_name[] = "Validation1"; -#define CONFIGURE_MAXIMUM_PROCESSORS 1 +#define CONFIGURE_MAXIMUM_PROCESSORS 5 #include "ts-default.h" diff --git a/testsuites/validation/ts-validation-no-clock-0.c b/testsuites/validation/ts-validation-no-clock-0.c new file mode 100644 index 0000000000..5ff630b6c3 --- /dev/null +++ b/testsuites/validation/ts-validation-no-clock-0.c @@ -0,0 +1,81 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestSuiteTestsuitesValidationNoClock0 + */ + +/* + * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <rtems/test.h> + +/** + * @defgroup RTEMSTestSuiteTestsuitesValidationNoClock0 \ + * spec:/testsuites/validation-no-clock-0 + * + * @ingroup RTEMSTestSuites + * + * @brief This general purpose validation test suite provides enough resources + * to run basic tests without a Clock Driver for all specified managers and + * functions. + * + * In SMP configurations, up to three scheduler instances using the SMP EDF + * scheduler are provided using up to four processors. + * + * @{ + */ + +const char rtems_test_name[] = "ValidationNoClock0"; + +#define CONFIGURE_MAXIMUM_PROCESSORS 5 + +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#include "ts-default.h" + +/** @} */ diff --git a/testsuites/validation/ts-validation-non-smp.c b/testsuites/validation/ts-validation-non-smp.c new file mode 100644 index 0000000000..163223f18b --- /dev/null +++ b/testsuites/validation/ts-validation-non-smp.c @@ -0,0 +1,75 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestSuiteTestsuitesValidationNonSmp + */ + +/* + * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <rtems/test.h> + +/** + * @defgroup RTEMSTestSuiteTestsuitesValidationNonSmp \ + * spec:/testsuites/validation-non-smp + * + * @ingroup RTEMSTestSuites + * + * @brief This test suite for non-SMP test cases provides enough resources to + * run basic tests for all specified managers and functions. + * + * @{ + */ + +const char rtems_test_name[] = "ValidationNonSMP"; + +#define CONFIGURE_MAXIMUM_PROCESSORS 1 + +#include "ts-default.h" + +/** @} */ diff --git a/testsuites/validation/ts-validation-one-cpu-0.c b/testsuites/validation/ts-validation-one-cpu-0.c new file mode 100644 index 0000000000..d281b59d01 --- /dev/null +++ b/testsuites/validation/ts-validation-one-cpu-0.c @@ -0,0 +1,80 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestSuiteTestsuitesValidationOneCpu0 + */ + +/* + * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <rtems/test.h> + +/** + * @defgroup RTEMSTestSuiteTestsuitesValidationOneCpu0 \ + * spec:/testsuites/validation-one-cpu-0 + * + * @ingroup RTEMSTestSuites + * + * @brief This general purpose validation test suite provides enough resources + * to run basic tests with exactly one processor and without a Clock Driver. + * + * Two test suites of this configuration are provided to limit test run + * duration. + * + * @{ + */ + +const char rtems_test_name[] = "ValidationOneCpu0"; + +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_PROCESSORS 1 + +#include "ts-default.h" + +/** @} */ diff --git a/testsuites/validation/ts-validation-smp-only-0.c b/testsuites/validation/ts-validation-smp-only-0.c new file mode 100644 index 0000000000..9907365cd9 --- /dev/null +++ b/testsuites/validation/ts-validation-smp-only-0.c @@ -0,0 +1,78 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestSuiteTestsuitesValidationSmpOnly0 + */ + +/* + * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <rtems/test.h> + +/** + * @defgroup RTEMSTestSuiteTestsuitesValidationSmpOnly0 \ + * spec:/testsuites/validation-smp-only-0 + * + * @ingroup RTEMSTestSuites + * + * @brief This test suite for SMP-only test cases provides enough resources to + * run basic tests for all specified managers and functions. + * + * Up to three scheduler instances using the SMP EDF scheduler are provided + * using up to four processors. + * + * @{ + */ + +const char rtems_test_name[] = "ValidationSMPOnly0"; + +#define CONFIGURE_MAXIMUM_PROCESSORS 5 + +#include "ts-default.h" + +/** @} */ diff --git a/testsuites/validation/ts-validation-smp-only-1.c b/testsuites/validation/ts-validation-smp-only-1.c new file mode 100644 index 0000000000..a1f9eeb413 --- /dev/null +++ b/testsuites/validation/ts-validation-smp-only-1.c @@ -0,0 +1,94 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup RTEMSTestSuiteTestsuitesValidationSmpOnly1 + */ + +/* + * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "ts-config.h" + +#include <rtems/test.h> + +/** + * @defgroup RTEMSTestSuiteTestsuitesValidationSmpOnly1 \ + * spec:/testsuites/validation-smp-only-1 + * + * @ingroup RTEMSTestSuites + * + * @brief This SMP-only test suite validates the clustered scheduler + * configuration through an application configuration with a processor + * maximum of two, however, only the first processor has a scheduler + * assigned. + * + * @{ + */ + +const char rtems_test_name[] = "ValidationSMPOnly1"; + +#define CONFIGURE_MAXIMUM_PROCESSORS 2 + +#include <rtems/score/scheduleredfsmp.h> + +#define CONFIGURE_SCHEDULER_EDF_SMP + +#include <rtems/scheduler.h> + +RTEMS_SCHEDULER_EDF_SMP( a ); + +#define CONFIGURE_SCHEDULER_TABLE_ENTRIES \ + RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME ) + +#define CONFIGURE_SCHEDULER_ASSIGNMENTS \ + RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \ + RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER + +#include "ts-default.h" + +/** @} */ |