From d82ac0a69a90df8a74e44e2090e68ae86e930bc1 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 22 Mar 2016 08:53:10 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9145 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/rt/configuration.xml | 143 ++++++++++++++++++++++---------------- 1 file changed, 82 insertions(+), 61 deletions(-) diff --git a/test/rt/configuration.xml b/test/rt/configuration.xml index 7c59e5014..7b4bf469f 100644 --- a/test/rt/configuration.xml +++ b/test/rt/configuration.xml @@ -69,9 +69,9 @@ union test_buffers { THD_WORKING_AREA(T4, THREADS_STACK_SIZE); } wa; uint8_t buffer[WA_SIZE * 5]; -}; - -void test_terminate_threads(void); +}; + +void test_terminate_threads(void); void test_wait_threads(void);]]> @@ -90,30 +90,30 @@ thread_t *threads[MAX_THREADS]; * Pointers to the working areas. */ void * ROMCONST wa[5] = {test.wa.T0, test.wa.T1, test.wa.T2, - test.wa.T3, test.wa.T4}; - -/* - * Sets a termination request in all the test-spawned threads. - */ -void test_terminate_threads(void) { - int i; - - for (i = 0; i < MAX_THREADS; i++) - if (threads[i]) - chThdTerminate(threads[i]); -} - -/* - * Waits for the completion of all the test-spawned threads. - */ -void test_wait_threads(void) { - int i; - - for (i = 0; i < MAX_THREADS; i++) - if (threads[i] != NULL) { - chThdWait(threads[i]); - threads[i] = NULL; - } + test.wa.T3, test.wa.T4}; + +/* + * Sets a termination request in all the test-spawned threads. + */ +void test_terminate_threads(void) { + int i; + + for (i = 0; i < MAX_THREADS; i++) + if (threads[i]) + chThdTerminate(threads[i]); +} + +/* + * Waits for the completion of all the test-spawned threads. + */ +void test_wait_threads(void) { + int i; + + for (i = 0; i < MAX_THREADS; i++) + if (threads[i] != NULL) { + chThdWait(threads[i]); + threads[i] = NULL; + } }]]> @@ -128,6 +128,9 @@ void test_wait_threads(void) { The functionality of the system layer and port interface is tested. Basic RT functionality is taken for granted or this test suite could not even be executed. Errors in implementation are detected by executing this sequence with the state checker enabled (CH_DBG_STATE_CHECKER=TRUE). + + + This sequence tests the ChibiOS/NIL functionalities related to threading. + + + - @@ -546,12 +552,12 @@ test_assert_time_window(time + 100, - @@ -563,12 +569,12 @@ test_assert_sequence("ABCDE");]]> - @@ -580,12 +586,12 @@ test_assert_sequence("ABCDE");]]> - @@ -603,6 +609,9 @@ test_assert_sequence("ABCDE");]]> This sequence tests the ChibiOS/NIL functionalities related to counter semaphores. + + CH_CFG_USE_SEMAPHORES + Wait, Signal and Reset primitives are tested. The testing thread does not trigger a state change. - CH_CFG_USE_SEMAPHORES + @@ -680,7 +689,7 @@ test_assert_lock(chSemGetCounterI(&sem1) == 2, "wrong counter value");]]>Wait, Signal and Reset primitives are tested. The testing thread triggers a state change. - CH_CFG_USE_SEMAPHORES + @@ -734,7 +743,7 @@ test_assert(MSG_RESET == msg, "wrong returned message");]]> Timeout on semaphores is tested. - CH_CFG_USE_SEMAPHORES + @@ -797,6 +806,9 @@ test_assert(MSG_TIMEOUT == msg, "wrong timeout message");]]> This sequence tests the ChibiOS/NIL functionalities related to threads suspend/resume and event flags. + + + @@ -943,6 +955,9 @@ test_assert((eventmask_t)0 == events, "wrong events mask");]]> This sequence tests the ChibiOS/NIL functionalities related to mailboxes. + + CH_CFG_USE_MAILBOXES + The mailbox normal API is tested without triggering blocking conditions. - CH_CFG_USE_MAILBOXES + @@ -1083,7 +1098,7 @@ test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]>The mailbox I-Class API is tested without triggering blocking conditions. - CH_CFG_USE_MAILBOXES + @@ -1215,7 +1230,7 @@ test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]>The mailbox API is tested for timeouts. - CH_CFG_USE_MAILBOXES + @@ -1307,6 +1322,9 @@ test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]> This sequence tests the ChibiOS/NIL functionalities related to memory pools. + + CH_CFG_USE_MEMPOOLS + The memory pool functionality is tested by loading and empting it, all conditions are tested. - CH_CFG_USE_MEMPOOLS + @@ -1436,7 +1454,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]> The memory pool functionality is tested by loading and empting it, all conditions are tested. - (CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES) + CH_CFG_USE_SEMAPHORES @@ -1529,7 +1547,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]> The timeout features for the Guarded Memory Pools is tested. - (CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES) + CH_CFG_USE_SEMAPHORES @@ -1568,6 +1586,9 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]> This sequence tests the ChibiOS/NIL functionalities related to memory heaps. + + CH_CFG_USE_HEAP + Series of allocations/deallocations are performed in carefully designed sequences in order to stimulate all the possible code paths inside the allocator. The test expects to find the heap back to the initial status after each sequence. - CH_CFG_USE_HEAP + @@ -1762,7 +1783,7 @@ test_assert(n == sz, "size changed");]]> The default heap is pre-allocated in the system. We test base functionality. - CH_CFG_USE_HEAP +