Test improvements.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11139 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2017-12-10 14:41:27 +00:00
parent d430fa4e4f
commit 1036f4a853
6 changed files with 359 additions and 161 deletions

View File

@ -33,7 +33,7 @@
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/> <intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> <stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/> <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;contentList&gt;&lt;content id=&quot;r1-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;r0-(format)&quot; val=&quot;4&quot;/&gt;&lt;/contentList&gt;"/> <stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;contentList&gt;&lt;content id=&quot;r0-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;r1-(format)&quot; val=&quot;4&quot;/&gt;&lt;/contentList&gt;"/>
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;globalVariableList/&gt;&#10;"/> <stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;globalVariableList/&gt;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList/&gt;&#10;"/> <stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList/&gt;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/> <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>

View File

@ -1,44 +1,69 @@
*** ChibiOS/NIL Test Suite *** ChibiOS/NIL Test Suite
*** ***
*** Compiled: Sep 19 2017 - 11:23:47 *** Compiled: Dec 10 2017 - 15:34:01
*** Platform: STM32F746 Very High Performance with DSP and FPU *** Platform: STM32F746 Very High Performance with DSP and FPU
*** Test Board: STMicroelectronics STM32F746G-Discovery *** Test Board: STMicroelectronics STM32F746G-Discovery
============================================================================
=== Test Sequence 1 (Information)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 1.1 (Kernel Info) --- Test Case 1.1 (Port Info)
--- Product: ChibiOS/NIL --- Architecture: ARMv7E-M
--- Stable Flag: 1 --- Core Variant: Cortex-M7
--- Version String: 2.0.1 --- Compiler: GCC 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496]
--- Major Number: 2 --- Port Info: Advanced kernel mode
--- Minor Number: 0 --- Natural alignment: 4
--- Patch Number: 1 --- Stack alignment: 8
--- Working area alignment: 8
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 1.2 (Kernel Settings) --- Test Case 1.2 (Kernel Info)
--- CH_CFG_NUM_THREADS: 3 --- Product: ChibiOS/NIL
--- CH_CFG_ST_RESOLUTION: 32 --- Stable Flag: 0
--- CH_CFG_ST_FREQUENCY: 5000 --- Version String: 3.0.0
--- CH_CFG_ST_TIMEDELTA: 2 --- Major Number: 3
--- CH_CFG_USE_SEMAPHORES: 1 --- Minor Number: 0
--- CH_CFG_USE_MUTEXES: 0 --- Patch Number: 0
--- CH_CFG_USE_EVENTS: 1
--- CH_CFG_USE_MAILBOXES: 1
--- CH_CFG_USE_MEMCORE: 1
--- CH_CFG_USE_HEAP: 1
--- CH_CFG_USE_MEMPOOLS: 1
--- CH_DBG_STATISTICS: 0
--- CH_DBG_SYSTEM_STATE_CHECK: 1
--- CH_DBG_ENABLE_CHECKS: 1
--- CH_DBG_ENABLE_ASSERTS: 1
--- CH_DBG_ENABLE_STACK_CHECK: 1
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 1.3 (Kernel Settings)
--- CH_CFG_NUM_THREADS: 3
--- CH_CFG_ST_RESOLUTION: 16
--- CH_CFG_ST_FREQUENCY: 10000
--- CH_CFG_ST_TIMEDELTA: 2
--- CH_CFG_USE_SEMAPHORES: 1
--- CH_CFG_USE_MUTEXES: 0
--- CH_CFG_USE_EVENTS: 1
--- CH_CFG_USE_MAILBOXES: 1
--- CH_CFG_USE_MEMCORE: 1
--- CH_CFG_USE_HEAP: 1
--- CH_CFG_USE_MEMPOOLS: 1
--- CH_CFG_USE_OBJ_FIFOS: 1
--- CH_CFG_MEMCORE_SIZE: 0
--- CH_CFG_USE_FACTORY: 1
--- CH_CFG_FACTORY_MAX_NAMES_LENGTH: 8
--- CH_CFG_FACTORY_OBJECTS_REGISTRY: 1
--- CH_CFG_FACTORY_GENERIC_BUFFERS: 1
--- CH_CFG_FACTORY_SEMAPHORES: 1
--- CH_CFG_FACTORY_MAILBOXES: 1
--- CH_CFG_FACTORY_OBJ_FIFOS: 1
--- CH_DBG_STATISTICS: 0
--- CH_DBG_SYSTEM_STATE_CHECK: 1
--- CH_DBG_ENABLE_CHECKS: 1
--- CH_DBG_ENABLE_ASSERTS: 1
--- CH_DBG_ENABLE_STACK_CHECK: 1
--- Result: SUCCESS
============================================================================
=== Test Sequence 2 (Threads Functionality)
----------------------------------------------------------------------------
--- Test Case 2.1 (System Tick Counter functionality) --- Test Case 2.1 (System Tick Counter functionality)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 2.2 (Thread Sleep functionality) --- Test Case 2.2 (Thread Sleep functionality)
--- Result: SUCCESS --- Result: SUCCESS
============================================================================
=== Test Sequence 3 (Semaphores)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 3.1 (Semaphore primitives, no state change) --- Test Case 3.1 (Semaphore primitives, no state change)
--- Result: SUCCESS --- Result: SUCCESS
@ -48,6 +73,8 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 3.3 (Semaphores timeout) --- Test Case 3.3 (Semaphores timeout)
--- Result: SUCCESS --- Result: SUCCESS
============================================================================
=== Test Sequence 4 (Suspend/Resume and Event Flags)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 4.1 (Suspend and Resume functionality) --- Test Case 4.1 (Suspend and Resume functionality)
--- Result: SUCCESS --- Result: SUCCESS
@ -55,28 +82,61 @@
--- Test Case 4.2 (Events Flags functionality) --- Test Case 4.2 (Events Flags functionality)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 5.1 (Mailbox normal API, non-blocking tests)
Final result: SUCCESS
*** ChibiOS OS Library Test Suite
***
*** Compiled: Dec 10 2017 - 15:34:01
*** Platform: STM32F746 Very High Performance with DSP and FPU
*** Test Board: STMicroelectronics STM32F746G-Discovery
============================================================================
=== Test Sequence 1 (Mailboxes)
----------------------------------------------------------------------------
--- Test Case 1.1 (Mailbox normal API, non-blocking tests)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 5.2 (Mailbox I-Class API, non-blocking tests) --- Test Case 1.2 (Mailbox I-Class API, non-blocking tests)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 5.3 (Mailbox timeouts) --- Test Case 1.3 (Mailbox timeouts)
--- Result: SUCCESS
============================================================================
=== Test Sequence 2 (Memory Pools)
----------------------------------------------------------------------------
--- Test Case 2.1 (Loading and emptying a memory pool)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 6.1 (Loading and emptying a memory pool) --- Test Case 2.2 (Loading and emptying a guarded memory pool without waiting)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 6.2 (Loading and emptying a guarded memory pool without waiting) --- Test Case 2.3 (Guarded Memory Pools timeout)
--- Result: SUCCESS
============================================================================
=== Test Sequence 3 (Memory Heaps)
----------------------------------------------------------------------------
--- Test Case 3.1 (Allocation and fragmentation)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 6.3 (Guarded Memory Pools timeout) --- Test Case 3.2 (Default Heap)
--- Result: SUCCESS
============================================================================
=== Test Sequence 4 (Objects Factory)
----------------------------------------------------------------------------
--- Test Case 4.1 (Objects Registry)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 7.1 (Allocation and fragmentation) --- Test Case 4.2 (Dynamic Buffers Factory)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 7.2 (Default Heap) --- Test Case 4.3 (Dynamic Semaphores Factory)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 4.4 (Dynamic Mailboxes Factory)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 4.5 (Dynamic Objects FIFOs Factory)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------

View File

@ -40,8 +40,6 @@
<global_definitions> <global_definitions>
<value><![CDATA[#define TEST_SUITE_NAME "ChibiOS/NIL Test Suite" <value><![CDATA[#define TEST_SUITE_NAME "ChibiOS/NIL Test Suite"
#define TEST_REPORT_HOOK_HEADER test_print_port_info();
extern semaphore_t gsem1, gsem2; extern semaphore_t gsem1, gsem2;
extern thread_reference_t gtr1; extern thread_reference_t gtr1;
extern THD_WORKING_AREA(wa_test_support, 128); extern THD_WORKING_AREA(wa_test_support, 128);
@ -50,25 +48,7 @@ void test_print_port_info(void);
THD_FUNCTION(test_support, arg);]]></value> THD_FUNCTION(test_support, arg);]]></value>
</global_definitions> </global_definitions>
<global_code> <global_code>
<value><![CDATA[void test_print_port_info(void) { <value><![CDATA[semaphore_t gsem1, gsem2;
#ifdef PORT_COMPILER_NAME
test_print("*** Compiler: ");
test_println(PORT_COMPILER_NAME);
#endif
test_print("*** Architecture: ");
test_println(PORT_ARCHITECTURE_NAME);
#ifdef PORT_CORE_VARIANT_NAME
test_print("*** Core Variant: ");
test_println(PORT_CORE_VARIANT_NAME);
#endif
#ifdef PORT_INFO
test_print("*** Port Info: ");
test_println(PORT_INFO);
#endif
}
semaphore_t gsem1, gsem2;
thread_reference_t gtr1; thread_reference_t gtr1;
/* /*
@ -121,6 +101,71 @@ THD_FUNCTION(test_support, arg) {
<value><![CDATA[#include "ch.h"]]></value> <value><![CDATA[#include "ch.h"]]></value>
</shared_code> </shared_code>
<cases> <cases>
<case>
<brief>
<value>Port Info.</value>
</brief>
<description>
<value>Port-related info are reported.</value>
</description>
<condition>
<value />
</condition>
<various_code>
<setup_code>
<value />
</setup_code>
<teardown_code>
<value />
</teardown_code>
<local_variables>
<value />
</local_variables>
</various_code>
<steps>
<step>
<description>
<value>Prints the version string.</value>
</description>
<tags>
<value />
</tags>
<code>
<value><![CDATA[#if defined(PORT_ARCHITECTURE_NAME)
test_print("--- Architecture: ");
test_println(PORT_ARCHITECTURE_NAME);
#endif
#if defined(PORT_CORE_VARIANT_NAME)
test_print("--- Core Variant: ");
test_println(PORT_CORE_VARIANT_NAME);
#endif
#if defined(PORT_COMPILER_NAME)
test_print("--- Compiler: ");
test_println(PORT_COMPILER_NAME);
#endif
#if defined(PORT_INFO)
test_print("--- Port Info: ");
test_println(PORT_INFO);
#endif
#if defined(PORT_NATURAL_ALIGN)
test_print("--- Natural alignment: ");
test_printn(PORT_NATURAL_ALIGN);
test_println("");
#endif
#if defined(PORT_STACK_ALIGN)
test_print("--- Stack alignment: ");
test_printn(PORT_STACK_ALIGN);
test_println("");
#endif
#if defined(PORT_WORKING_AREA_ALIGN)
test_print("--- Working area alignment: ");
test_printn(PORT_WORKING_AREA_ALIGN);
test_println("");
#endif]]></value>
</code>
</step>
</steps>
</case>
<case> <case>
<brief> <brief>
<value>Kernel Info.</value> <value>Kernel Info.</value>
@ -151,19 +196,19 @@ THD_FUNCTION(test_support, arg) {
<value /> <value />
</tags> </tags>
<code> <code>
<value><![CDATA[test_println("--- Product: ChibiOS/NIL"); <value><![CDATA[test_println("--- Product: ChibiOS/NIL");
test_print("--- Stable Flag: "); test_print("--- Stable Flag: ");
test_printn(CH_KERNEL_STABLE); test_printn(CH_KERNEL_STABLE);
test_println(""); test_println("");
test_print("--- Version String: "); test_print("--- Version String: ");
test_println(CH_KERNEL_VERSION); test_println(CH_KERNEL_VERSION);
test_print("--- Major Number: "); test_print("--- Major Number: ");
test_printn(CH_KERNEL_MAJOR); test_printn(CH_KERNEL_MAJOR);
test_println(""); test_println("");
test_print("--- Minor Number: "); test_print("--- Minor Number: ");
test_printn(CH_KERNEL_MINOR); test_printn(CH_KERNEL_MINOR);
test_println(""); test_println("");
test_print("--- Patch Number: "); test_print("--- Patch Number: ");
test_printn(CH_KERNEL_PATCH); test_printn(CH_KERNEL_PATCH);
test_println("");]]></value> test_println("");]]></value>
</code> </code>
@ -200,52 +245,79 @@ test_println("");]]></value>
<value /> <value />
</tags> </tags>
<code> <code>
<value><![CDATA[test_print("--- CH_CFG_NUM_THREADS: "); <value><![CDATA[test_print("--- CH_CFG_NUM_THREADS: ");
test_printn(CH_CFG_NUM_THREADS); test_printn(CH_CFG_NUM_THREADS);
test_println(""); test_println("");
test_print("--- CH_CFG_ST_RESOLUTION: "); test_print("--- CH_CFG_ST_RESOLUTION: ");
test_printn(CH_CFG_ST_RESOLUTION); test_printn(CH_CFG_ST_RESOLUTION);
test_println(""); test_println("");
test_print("--- CH_CFG_ST_FREQUENCY: "); test_print("--- CH_CFG_ST_FREQUENCY: ");
test_printn(CH_CFG_ST_FREQUENCY); test_printn(CH_CFG_ST_FREQUENCY);
test_println(""); test_println("");
test_print("--- CH_CFG_ST_TIMEDELTA: "); test_print("--- CH_CFG_ST_TIMEDELTA: ");
test_printn(CH_CFG_ST_TIMEDELTA); test_printn(CH_CFG_ST_TIMEDELTA);
test_println(""); test_println("");
test_print("--- CH_CFG_USE_SEMAPHORES: "); test_print("--- CH_CFG_USE_SEMAPHORES: ");
test_printn(CH_CFG_USE_SEMAPHORES); test_printn(CH_CFG_USE_SEMAPHORES);
test_println(""); test_println("");
test_print("--- CH_CFG_USE_MUTEXES: "); test_print("--- CH_CFG_USE_MUTEXES: ");
test_printn(CH_CFG_USE_MUTEXES); test_printn(CH_CFG_USE_MUTEXES);
test_println(""); test_println("");
test_print("--- CH_CFG_USE_EVENTS: "); test_print("--- CH_CFG_USE_EVENTS: ");
test_printn(CH_CFG_USE_EVENTS); test_printn(CH_CFG_USE_EVENTS);
test_println(""); test_println("");
test_print("--- CH_CFG_USE_MAILBOXES: "); test_print("--- CH_CFG_USE_MAILBOXES: ");
test_printn(CH_CFG_USE_MAILBOXES); test_printn(CH_CFG_USE_MAILBOXES);
test_println(""); test_println("");
test_print("--- CH_CFG_USE_MEMCORE: "); test_print("--- CH_CFG_USE_MEMCORE: ");
test_printn(CH_CFG_USE_MEMCORE); test_printn(CH_CFG_USE_MEMCORE);
test_println(""); test_println("");
test_print("--- CH_CFG_USE_HEAP: "); test_print("--- CH_CFG_USE_HEAP: ");
test_printn(CH_CFG_USE_HEAP); test_printn(CH_CFG_USE_HEAP);
test_println(""); test_println("");
test_print("--- CH_CFG_USE_MEMPOOLS: "); test_print("--- CH_CFG_USE_MEMPOOLS: ");
test_printn(CH_CFG_USE_MEMPOOLS); test_printn(CH_CFG_USE_MEMPOOLS);
test_println(""); test_println("");
test_print("--- CH_DBG_STATISTICS: "); test_print("--- CH_CFG_USE_OBJ_FIFOS: ");
test_printn(CH_CFG_USE_OBJ_FIFOS);
test_println("");
test_print("--- CH_CFG_MEMCORE_SIZE: ");
test_printn(CH_CFG_MEMCORE_SIZE);
test_println("");
test_print("--- CH_CFG_USE_FACTORY: ");
test_printn(CH_CFG_USE_FACTORY);
test_println("");
test_print("--- CH_CFG_FACTORY_MAX_NAMES_LENGTH: ");
test_printn(CH_CFG_FACTORY_MAX_NAMES_LENGTH);
test_println("");
test_print("--- CH_CFG_FACTORY_OBJECTS_REGISTRY: ");
test_printn(CH_CFG_FACTORY_OBJECTS_REGISTRY);
test_println("");
test_print("--- CH_CFG_FACTORY_GENERIC_BUFFERS: ");
test_printn(CH_CFG_FACTORY_GENERIC_BUFFERS);
test_println("");
test_print("--- CH_CFG_FACTORY_SEMAPHORES: ");
test_printn(CH_CFG_FACTORY_SEMAPHORES);
test_println("");
test_print("--- CH_CFG_FACTORY_MAILBOXES: ");
test_printn(CH_CFG_FACTORY_MAILBOXES);
test_println("");
test_print("--- CH_CFG_FACTORY_OBJ_FIFOS: ");
test_printn(CH_CFG_FACTORY_OBJ_FIFOS);
test_println("");
test_print("--- CH_DBG_STATISTICS: ");
test_printn(CH_DBG_STATISTICS); test_printn(CH_DBG_STATISTICS);
test_println(""); test_println("");
test_print("--- CH_DBG_SYSTEM_STATE_CHECK: "); test_print("--- CH_DBG_SYSTEM_STATE_CHECK: ");
test_printn(CH_DBG_SYSTEM_STATE_CHECK); test_printn(CH_DBG_SYSTEM_STATE_CHECK);
test_println(""); test_println("");
test_print("--- CH_DBG_ENABLE_CHECKS: "); test_print("--- CH_DBG_ENABLE_CHECKS: ");
test_printn(CH_DBG_ENABLE_CHECKS); test_printn(CH_DBG_ENABLE_CHECKS);
test_println(""); test_println("");
test_print("--- CH_DBG_ENABLE_ASSERTS: "); test_print("--- CH_DBG_ENABLE_ASSERTS: ");
test_printn(CH_DBG_ENABLE_ASSERTS); test_printn(CH_DBG_ENABLE_ASSERTS);
test_println(""); test_println("");
test_print("--- CH_DBG_ENABLE_STACK_CHECK: "); test_print("--- CH_DBG_ENABLE_STACK_CHECK: ");
test_printn(CH_DBG_ENABLE_STACK_CHECK); test_printn(CH_DBG_ENABLE_STACK_CHECK);
test_println("");]]></value> test_println("");]]></value>
</code> </code>

View File

@ -67,24 +67,6 @@ const testsuite_t nil_test_suite = {
/* Shared code. */ /* Shared code. */
/*===========================================================================*/ /*===========================================================================*/
void test_print_port_info(void) {
#ifdef PORT_COMPILER_NAME
test_print("*** Compiler: ");
test_println(PORT_COMPILER_NAME);
#endif
test_print("*** Architecture: ");
test_println(PORT_ARCHITECTURE_NAME);
#ifdef PORT_CORE_VARIANT_NAME
test_print("*** Core Variant: ");
test_println(PORT_CORE_VARIANT_NAME);
#endif
#ifdef PORT_INFO
test_print("*** Port Info: ");
test_println(PORT_INFO);
#endif
}
semaphore_t gsem1, gsem2; semaphore_t gsem1, gsem2;
thread_reference_t gtr1; thread_reference_t gtr1;

View File

@ -50,8 +50,6 @@ extern "C" {
#define TEST_SUITE_NAME "ChibiOS/NIL Test Suite" #define TEST_SUITE_NAME "ChibiOS/NIL Test Suite"
#define TEST_REPORT_HOOK_HEADER test_print_port_info();
extern semaphore_t gsem1, gsem2; extern semaphore_t gsem1, gsem2;
extern thread_reference_t gtr1; extern thread_reference_t gtr1;
extern THD_WORKING_AREA(wa_test_support, 128); extern THD_WORKING_AREA(wa_test_support, 128);

View File

@ -32,6 +32,7 @@
* <h2>Test Cases</h2> * <h2>Test Cases</h2>
* - @subpage nil_test_001_001 * - @subpage nil_test_001_001
* - @subpage nil_test_001_002 * - @subpage nil_test_001_002
* - @subpage nil_test_001_003
* . * .
*/ */
@ -46,10 +47,10 @@
****************************************************************************/ ****************************************************************************/
/** /**
* @page nil_test_001_001 [1.1] Kernel Info * @page nil_test_001_001 [1.1] Port Info
* *
* <h2>Description</h2> * <h2>Description</h2>
* The version numbers are reported. * Port-related info are reported.
* *
* <h2>Test Steps</h2> * <h2>Test Steps</h2>
* - [1.1.1] Prints the version string. * - [1.1.1] Prints the version string.
@ -61,105 +62,189 @@ static void nil_test_001_001_execute(void) {
/* [1.1.1] Prints the version string.*/ /* [1.1.1] Prints the version string.*/
test_set_step(1); test_set_step(1);
{ {
test_println("--- Product: ChibiOS/NIL"); #if defined(PORT_ARCHITECTURE_NAME)
test_print("--- Stable Flag: "); test_print("--- Architecture: ");
test_printn(CH_KERNEL_STABLE); test_println(PORT_ARCHITECTURE_NAME);
#endif
#if defined(PORT_CORE_VARIANT_NAME)
test_print("--- Core Variant: ");
test_println(PORT_CORE_VARIANT_NAME);
#endif
#if defined(PORT_COMPILER_NAME)
test_print("--- Compiler: ");
test_println(PORT_COMPILER_NAME);
#endif
#if defined(PORT_INFO)
test_print("--- Port Info: ");
test_println(PORT_INFO);
#endif
#if defined(PORT_NATURAL_ALIGN)
test_print("--- Natural alignment: ");
test_printn(PORT_NATURAL_ALIGN);
test_println(""); test_println("");
test_print("--- Version String: "); #endif
test_println(CH_KERNEL_VERSION); #if defined(PORT_STACK_ALIGN)
test_print("--- Major Number: "); test_print("--- Stack alignment: ");
test_printn(CH_KERNEL_MAJOR); test_printn(PORT_STACK_ALIGN);
test_println(""); test_println("");
test_print("--- Minor Number: "); #endif
test_printn(CH_KERNEL_MINOR); #if defined(PORT_WORKING_AREA_ALIGN)
test_println(""); test_print("--- Working area alignment: ");
test_print("--- Patch Number: "); test_printn(PORT_WORKING_AREA_ALIGN);
test_printn(CH_KERNEL_PATCH);
test_println(""); test_println("");
#endif
} }
} }
static const testcase_t nil_test_001_001 = { static const testcase_t nil_test_001_001 = {
"Kernel Info", "Port Info",
NULL, NULL,
NULL, NULL,
nil_test_001_001_execute nil_test_001_001_execute
}; };
/** /**
* @page nil_test_001_002 [1.2] Kernel Settings * @page nil_test_001_002 [1.2] Kernel Info
* *
* <h2>Description</h2> * <h2>Description</h2>
* The static kernel settings are reported. * The version numbers are reported.
* *
* <h2>Test Steps</h2> * <h2>Test Steps</h2>
* - [1.2.1] Prints the configuration options settings. * - [1.2.1] Prints the version string.
* . * .
*/ */
static void nil_test_001_002_execute(void) { static void nil_test_001_002_execute(void) {
/* [1.2.1] Prints the configuration options settings.*/ /* [1.2.1] Prints the version string.*/
test_set_step(1); test_set_step(1);
{ {
test_print("--- CH_CFG_NUM_THREADS: "); test_println("--- Product: ChibiOS/NIL");
test_printn(CH_CFG_NUM_THREADS); test_print("--- Stable Flag: ");
test_printn(CH_KERNEL_STABLE);
test_println(""); test_println("");
test_print("--- CH_CFG_ST_RESOLUTION: "); test_print("--- Version String: ");
test_printn(CH_CFG_ST_RESOLUTION); test_println(CH_KERNEL_VERSION);
test_print("--- Major Number: ");
test_printn(CH_KERNEL_MAJOR);
test_println(""); test_println("");
test_print("--- CH_CFG_ST_FREQUENCY: "); test_print("--- Minor Number: ");
test_printn(CH_CFG_ST_FREQUENCY); test_printn(CH_KERNEL_MINOR);
test_println(""); test_println("");
test_print("--- CH_CFG_ST_TIMEDELTA: "); test_print("--- Patch Number: ");
test_printn(CH_CFG_ST_TIMEDELTA); test_printn(CH_KERNEL_PATCH);
test_println("");
test_print("--- CH_CFG_USE_SEMAPHORES: ");
test_printn(CH_CFG_USE_SEMAPHORES);
test_println("");
test_print("--- CH_CFG_USE_MUTEXES: ");
test_printn(CH_CFG_USE_MUTEXES);
test_println("");
test_print("--- CH_CFG_USE_EVENTS: ");
test_printn(CH_CFG_USE_EVENTS);
test_println("");
test_print("--- CH_CFG_USE_MAILBOXES: ");
test_printn(CH_CFG_USE_MAILBOXES);
test_println("");
test_print("--- CH_CFG_USE_MEMCORE: ");
test_printn(CH_CFG_USE_MEMCORE);
test_println("");
test_print("--- CH_CFG_USE_HEAP: ");
test_printn(CH_CFG_USE_HEAP);
test_println("");
test_print("--- CH_CFG_USE_MEMPOOLS: ");
test_printn(CH_CFG_USE_MEMPOOLS);
test_println("");
test_print("--- CH_DBG_STATISTICS: ");
test_printn(CH_DBG_STATISTICS);
test_println("");
test_print("--- CH_DBG_SYSTEM_STATE_CHECK: ");
test_printn(CH_DBG_SYSTEM_STATE_CHECK);
test_println("");
test_print("--- CH_DBG_ENABLE_CHECKS: ");
test_printn(CH_DBG_ENABLE_CHECKS);
test_println("");
test_print("--- CH_DBG_ENABLE_ASSERTS: ");
test_printn(CH_DBG_ENABLE_ASSERTS);
test_println("");
test_print("--- CH_DBG_ENABLE_STACK_CHECK: ");
test_printn(CH_DBG_ENABLE_STACK_CHECK);
test_println(""); test_println("");
} }
} }
static const testcase_t nil_test_001_002 = { static const testcase_t nil_test_001_002 = {
"Kernel Settings", "Kernel Info",
NULL, NULL,
NULL, NULL,
nil_test_001_002_execute nil_test_001_002_execute
}; };
/**
* @page nil_test_001_003 [1.3] Kernel Settings
*
* <h2>Description</h2>
* The static kernel settings are reported.
*
* <h2>Test Steps</h2>
* - [1.3.1] Prints the configuration options settings.
* .
*/
static void nil_test_001_003_execute(void) {
/* [1.3.1] Prints the configuration options settings.*/
test_set_step(1);
{
test_print("--- CH_CFG_NUM_THREADS: ");
test_printn(CH_CFG_NUM_THREADS);
test_println("");
test_print("--- CH_CFG_ST_RESOLUTION: ");
test_printn(CH_CFG_ST_RESOLUTION);
test_println("");
test_print("--- CH_CFG_ST_FREQUENCY: ");
test_printn(CH_CFG_ST_FREQUENCY);
test_println("");
test_print("--- CH_CFG_ST_TIMEDELTA: ");
test_printn(CH_CFG_ST_TIMEDELTA);
test_println("");
test_print("--- CH_CFG_USE_SEMAPHORES: ");
test_printn(CH_CFG_USE_SEMAPHORES);
test_println("");
test_print("--- CH_CFG_USE_MUTEXES: ");
test_printn(CH_CFG_USE_MUTEXES);
test_println("");
test_print("--- CH_CFG_USE_EVENTS: ");
test_printn(CH_CFG_USE_EVENTS);
test_println("");
test_print("--- CH_CFG_USE_MAILBOXES: ");
test_printn(CH_CFG_USE_MAILBOXES);
test_println("");
test_print("--- CH_CFG_USE_MEMCORE: ");
test_printn(CH_CFG_USE_MEMCORE);
test_println("");
test_print("--- CH_CFG_USE_HEAP: ");
test_printn(CH_CFG_USE_HEAP);
test_println("");
test_print("--- CH_CFG_USE_MEMPOOLS: ");
test_printn(CH_CFG_USE_MEMPOOLS);
test_println("");
test_print("--- CH_CFG_USE_OBJ_FIFOS: ");
test_printn(CH_CFG_USE_OBJ_FIFOS);
test_println("");
test_print("--- CH_CFG_MEMCORE_SIZE: ");
test_printn(CH_CFG_MEMCORE_SIZE);
test_println("");
test_print("--- CH_CFG_USE_FACTORY: ");
test_printn(CH_CFG_USE_FACTORY);
test_println("");
test_print("--- CH_CFG_FACTORY_MAX_NAMES_LENGTH: ");
test_printn(CH_CFG_FACTORY_MAX_NAMES_LENGTH);
test_println("");
test_print("--- CH_CFG_FACTORY_OBJECTS_REGISTRY: ");
test_printn(CH_CFG_FACTORY_OBJECTS_REGISTRY);
test_println("");
test_print("--- CH_CFG_FACTORY_GENERIC_BUFFERS: ");
test_printn(CH_CFG_FACTORY_GENERIC_BUFFERS);
test_println("");
test_print("--- CH_CFG_FACTORY_SEMAPHORES: ");
test_printn(CH_CFG_FACTORY_SEMAPHORES);
test_println("");
test_print("--- CH_CFG_FACTORY_MAILBOXES: ");
test_printn(CH_CFG_FACTORY_MAILBOXES);
test_println("");
test_print("--- CH_CFG_FACTORY_OBJ_FIFOS: ");
test_printn(CH_CFG_FACTORY_OBJ_FIFOS);
test_println("");
test_print("--- CH_DBG_STATISTICS: ");
test_printn(CH_DBG_STATISTICS);
test_println("");
test_print("--- CH_DBG_SYSTEM_STATE_CHECK: ");
test_printn(CH_DBG_SYSTEM_STATE_CHECK);
test_println("");
test_print("--- CH_DBG_ENABLE_CHECKS: ");
test_printn(CH_DBG_ENABLE_CHECKS);
test_println("");
test_print("--- CH_DBG_ENABLE_ASSERTS: ");
test_printn(CH_DBG_ENABLE_ASSERTS);
test_println("");
test_print("--- CH_DBG_ENABLE_STACK_CHECK: ");
test_printn(CH_DBG_ENABLE_STACK_CHECK);
test_println("");
}
}
static const testcase_t nil_test_001_003 = {
"Kernel Settings",
NULL,
NULL,
nil_test_001_003_execute
};
/**************************************************************************** /****************************************************************************
* Exported data. * Exported data.
****************************************************************************/ ****************************************************************************/
@ -170,6 +255,7 @@ static const testcase_t nil_test_001_002 = {
const testcase_t * const nil_test_sequence_001_array[] = { const testcase_t * const nil_test_sequence_001_array[] = {
&nil_test_001_001, &nil_test_001_001,
&nil_test_001_002, &nil_test_001_002,
&nil_test_001_003,
NULL NULL
}; };