aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-03-22 08:53:10 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-03-22 08:53:10 +0000
commitd82ac0a69a90df8a74e44e2090e68ae86e930bc1 (patch)
treef2f24acfce42e18ade899f0e9bb6accab4c1d3f9 /test
parent6795208ee66ef38fa24316dd5137b4540a46bf62 (diff)
downloadChibiOS-d82ac0a69a90df8a74e44e2090e68ae86e930bc1.tar.gz
ChibiOS-d82ac0a69a90df8a74e44e2090e68ae86e930bc1.tar.bz2
ChibiOS-d82ac0a69a90df8a74e44e2090e68ae86e930bc1.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9145 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test')
-rw-r--r--test/rt/configuration.xml143
1 files 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);]]></value>
</global_definitions>
<global_code>
@@ -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;
+ }
}]]></value>
</global_code>
</global_data_and_code>
@@ -128,6 +128,9 @@ void test_wait_threads(void) {
<description>
<value>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).</value>
</description>
+ <condition>
+ <value />
+ </condition>
<shared_code>
<value><![CDATA[#include "ch.h"
@@ -408,12 +411,15 @@ while (time == chVTGetSystemTimeX()) {
<description>
<value>This sequence tests the ChibiOS/NIL functionalities related to threading.</value>
</description>
+ <condition>
+ <value />
+ </condition>
<shared_code>
- <value><![CDATA[#include "ch.h"
-
-static THD_FUNCTION(thread, p) {
-
- test_emit_token(*(char *)p);
+ <value><![CDATA[#include "ch.h"
+
+static THD_FUNCTION(thread, p) {
+
+ test_emit_token(*(char *)p);
}]]></value>
</shared_code>
<cases>
@@ -546,12 +552,12 @@ test_assert_time_window(time + 100,
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
-threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
-test_wait_threads();
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
+threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
+test_wait_threads();
test_assert_sequence("ABCDE");]]></value>
</code>
</step>
@@ -563,12 +569,12 @@ test_assert_sequence("ABCDE");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
-threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
-test_wait_threads();
+ <value><![CDATA[threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
+threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
+test_wait_threads();
test_assert_sequence("ABCDE");]]></value>
</code>
</step>
@@ -580,12 +586,12 @@ test_assert_sequence("ABCDE");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
-threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
-threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
-test_wait_threads();
+ <value><![CDATA[threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
+threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
+threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
+test_wait_threads();
test_assert_sequence("ABCDE");]]></value>
</code>
</step>
@@ -603,6 +609,9 @@ test_assert_sequence("ABCDE");]]></value>
<description>
<value>This sequence tests the ChibiOS/NIL functionalities related to counter semaphores.</value>
</description>
+ <condition>
+ <value>CH_CFG_USE_SEMAPHORES</value>
+ </condition>
<shared_code>
<value><![CDATA[#include "ch.h"
@@ -617,7 +626,7 @@ static semaphore_t sem1;]]></value>
<value>Wait, Signal and Reset primitives are tested. The testing thread does not trigger a state change.</value>
</description>
<condition>
- <value>CH_CFG_USE_SEMAPHORES</value>
+ <value />
</condition>
<various_code>
<setup_code>
@@ -680,7 +689,7 @@ test_assert_lock(chSemGetCounterI(&sem1) == 2, "wrong counter value");]]></value
<value>Wait, Signal and Reset primitives are tested. The testing thread triggers a state change.</value>
</description>
<condition>
- <value>CH_CFG_USE_SEMAPHORES</value>
+ <value />
</condition>
<various_code>
<setup_code>
@@ -734,7 +743,7 @@ test_assert(MSG_RESET == msg, "wrong returned message");]]></value>
<value>Timeout on semaphores is tested.</value>
</description>
<condition>
- <value>CH_CFG_USE_SEMAPHORES</value>
+ <value />
</condition>
<various_code>
<setup_code>
@@ -797,6 +806,9 @@ test_assert(MSG_TIMEOUT == msg, "wrong timeout message");]]></value>
<description>
<value>This sequence tests the ChibiOS/NIL functionalities related to threads suspend/resume and event flags.</value>
</description>
+ <condition>
+ <value />
+ </condition>
<shared_code>
<value><![CDATA[static thread_reference_t tr1;]]></value>
</shared_code>
@@ -943,6 +955,9 @@ test_assert((eventmask_t)0 == events, "wrong events mask");]]></value>
<description>
<value>This sequence tests the ChibiOS/NIL functionalities related to mailboxes.</value>
</description>
+ <condition>
+ <value>CH_CFG_USE_MAILBOXES</value>
+ </condition>
<shared_code>
<value><![CDATA[#define ALLOWED_DELAY MS2ST(5)
#define MB_SIZE 4
@@ -959,7 +974,7 @@ static MAILBOX_DECL(mb1, mb_buffer, MB_SIZE);]]></value>
<value>The mailbox normal API is tested without triggering blocking conditions.</value>
</description>
<condition>
- <value>CH_CFG_USE_MAILBOXES</value>
+ <value />
</condition>
<various_code>
<setup_code>
@@ -1083,7 +1098,7 @@ test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></va
<value>The mailbox I-Class API is tested without triggering blocking conditions.</value>
</description>
<condition>
- <value>CH_CFG_USE_MAILBOXES</value>
+ <value />
</condition>
<various_code>
<setup_code>
@@ -1215,7 +1230,7 @@ test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></va
<value>The mailbox API is tested for timeouts.</value>
</description>
<condition>
- <value>CH_CFG_USE_MAILBOXES</value>
+ <value />
</condition>
<various_code>
<setup_code>
@@ -1307,6 +1322,9 @@ test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value>
<description>
<value>This sequence tests the ChibiOS/NIL functionalities related to memory pools.</value>
</description>
+ <condition>
+ <value>CH_CFG_USE_MEMPOOLS</value>
+ </condition>
<shared_code>
<value><![CDATA[#define MEMORY_POOL_SIZE 4
@@ -1331,7 +1349,7 @@ static void *null_provider(size_t size, unsigned align) {
<value>The memory pool functionality is tested by loading and empting it, all conditions are tested.</value>
</description>
<condition>
- <value>CH_CFG_USE_MEMPOOLS</value>
+ <value />
</condition>
<various_code>
<setup_code>
@@ -1436,7 +1454,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value>The memory pool functionality is tested by loading and empting it, all conditions are tested.</value>
</description>
<condition>
- <value>(CH_CFG_USE_MEMPOOLS &amp;&amp; CH_CFG_USE_SEMAPHORES)</value>
+ <value>CH_CFG_USE_SEMAPHORES</value>
</condition>
<various_code>
<setup_code>
@@ -1529,7 +1547,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value>The timeout features for the Guarded Memory Pools is tested.</value>
</description>
<condition>
- <value>(CH_CFG_USE_MEMPOOLS &amp;&amp; CH_CFG_USE_SEMAPHORES)</value>
+ <value>CH_CFG_USE_SEMAPHORES</value>
</condition>
<various_code>
<setup_code>
@@ -1568,6 +1586,9 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<description>
<value>This sequence tests the ChibiOS/NIL functionalities related to memory heaps.</value>
</description>
+ <condition>
+ <value>CH_CFG_USE_HEAP</value>
+ </condition>
<shared_code>
<value><![CDATA[#define ALLOC_SIZE 16
#define HEAP_SIZE (ALLOC_SIZE * 8)
@@ -1584,7 +1605,7 @@ static CH_HEAP_AREA(myheap, HEAP_SIZE);]]></value>
<value>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.</value>
</description>
<condition>
- <value>CH_CFG_USE_HEAP</value>
+ <value />
</condition>
<various_code>
<setup_code>
@@ -1762,7 +1783,7 @@ test_assert(n == sz, "size changed");]]></value>
<value>The default heap is pre-allocated in the system. We test base functionality.</value>
</description>
<condition>
- <value>CH_CFG_USE_HEAP</value>
+ <value />
</condition>
<various_code>
<setup_code>