diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-04-03 10:18:35 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-04-03 10:18:35 +0000 |
commit | 8b133b8c181b0a0a5ba9e1f255c36a3b546c750c (patch) | |
tree | e535765dfb074b8851041196857580639782c97b /test | |
parent | 05b9eb553005fd070c6710d0245a1d67c21966e6 (diff) | |
download | ChibiOS-8b133b8c181b0a0a5ba9e1f255c36a3b546c750c.tar.gz ChibiOS-8b133b8c181b0a0a5ba9e1f255c36a3b546c750c.tar.bz2 ChibiOS-8b133b8c181b0a0a5ba9e1f255c36a3b546c750c.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9232 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test')
-rw-r--r-- | test/rt/configuration.xml | 22 | ||||
-rw-r--r-- | test/rt/source/test/test_sequence_005.c | 10 | ||||
-rw-r--r-- | test/rt/source/test/test_sequence_007.c | 10 | ||||
-rw-r--r-- | test/rt/source/test/test_sequence_012.c | 2 |
4 files changed, 34 insertions, 10 deletions
diff --git a/test/rt/configuration.xml b/test/rt/configuration.xml index 5c3342210..f934d120d 100644 --- a/test/rt/configuration.xml +++ b/test/rt/configuration.xml @@ -2202,7 +2202,7 @@ test_assert_sequence("ABCDE", "invalid sequence");]]></value> <value>This test case verifies the priority boost of a thread waiting on a conditional variable queue. It tests this very specific situation in order to improve code coverage. The created threads perform the following operations: TA{lock(M2), lock(M1), wait(C1), unlock(M1), unlock(M2)}, TB{lock(M2), wait(C1), unlock(M2)}. TC{lock(M1), unlock(M1)}.</value>
</description>
<condition>
- <value />
+ <value>CH_CFG_USE_CONDVARS</value>
</condition>
<various_code>
<setup_code>
@@ -2792,7 +2792,7 @@ test_wait_threads();]]></value> <value>Timeout functionality is tested for chEvtWaitOneTimeout(), chEvtWaitAnyTimeout() and chEvtWaitAllTimeout().</value>
</description>
<condition>
- <value />
+ <value>CH_CFG_USE_EVENTS_TIMEOUT</value>
</condition>
<various_code>
<setup_code>
@@ -3308,11 +3308,11 @@ test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value> <value><![CDATA[#define MEMORY_POOL_SIZE 4 static uint32_t objects[MEMORY_POOL_SIZE]; -static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), NULL);
+static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), NULL); -#if CH_CFG_USE_SEMAPHORES
+#if CH_CFG_USE_SEMAPHORES static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t)); -#endif
+#endif static void *null_provider(size_t size, unsigned align) { @@ -4139,12 +4139,14 @@ static THD_FUNCTION(bmk_thread4, p) { chSysUnlock(); } +#if CH_CFG_USE_SEMAPHORES static THD_FUNCTION(bmk_thread7, p) { (void)p; while (!chThdShouldTerminateX()) chSemWait(&sem1); } +#endif static THD_FUNCTION(bmk_thread8, p) { @@ -4548,12 +4550,12 @@ systime_t start, end;]]></value> <value><![CDATA[n = 0; start = test_wait_tick(); end = start + MS2ST(1000); -do {
+do { #if CH_CFG_USE_REGISTRY - chThdRelease(chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL));
-#else
- chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL);
-#endif
+ chThdRelease(chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL)); +#else + chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL); +#endif n++; #if defined(SIMULATOR) _sim_check_for_interrupts(); diff --git a/test/rt/source/test/test_sequence_005.c b/test/rt/source/test/test_sequence_005.c index f67832ca6..418e232cd 100644 --- a/test/rt/source/test/test_sequence_005.c +++ b/test/rt/source/test/test_sequence_005.c @@ -932,6 +932,7 @@ static const testcase_t test_005_008 = { };
#endif /* CH_CFG_USE_CONDVARS */
+#if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
/**
* @page test_005_009 [5.9] Condition Variable priority boost test
*
@@ -943,6 +944,12 @@ static const testcase_t test_005_008 = { * unlock(M2)}, TB{lock(M2), wait(C1), unlock(M2)}. TC{lock(M1),
* unlock(M1)}.
*
+ * <h2>Conditions</h2>
+ * This test is only executed if the following preprocessor condition
+ * evaluates to true:
+ * - CH_CFG_USE_CONDVARS
+ * .
+ *
* <h2>Test Steps</h2>
* - [5.9.1] Reading current base priority.
* - [5.9.2] Thread A is created at priority P(+1), it locks M2, locks
@@ -1023,6 +1030,7 @@ static const testcase_t test_005_009 = { NULL,
test_005_009_execute
};
+#endif /* CH_CFG_USE_CONDVARS */
/****************************************************************************
* Exported data.
@@ -1052,7 +1060,9 @@ const testcase_t * const test_sequence_005[] = { #if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
&test_005_008,
#endif
+#if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
&test_005_009,
+#endif
NULL
};
diff --git a/test/rt/source/test/test_sequence_007.c b/test/rt/source/test/test_sequence_007.c index 096d62b66..c1a40e643 100644 --- a/test/rt/source/test/test_sequence_007.c +++ b/test/rt/source/test/test_sequence_007.c @@ -406,6 +406,7 @@ static const testcase_t test_007_005 = { test_007_005_execute
};
+#if (CH_CFG_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
/**
* @page test_007_006 [7.6] Events Flags wait timeouts
*
@@ -413,6 +414,12 @@ static const testcase_t test_007_005 = { * Timeout functionality is tested for chEvtWaitOneTimeout(),
* chEvtWaitAnyTimeout() and chEvtWaitAllTimeout().
*
+ * <h2>Conditions</h2>
+ * This test is only executed if the following preprocessor condition
+ * evaluates to true:
+ * - CH_CFG_USE_EVENTS_TIMEOUT
+ * .
+ *
* <h2>Test Steps</h2>
* - [7.6.1] The functions are invoked first with TIME_IMMEDIATE
* timeout, the timeout condition is tested.
@@ -459,6 +466,7 @@ static const testcase_t test_007_006 = { NULL,
test_007_006_execute
};
+#endif /* CH_CFG_USE_EVENTS_TIMEOUT */
/**
* @page test_007_007 [7.7] Broadcasting using chEvtBroadcast()
@@ -551,7 +559,9 @@ const testcase_t * const test_sequence_007[] = { &test_007_003,
&test_007_004,
&test_007_005,
+#if (CH_CFG_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
&test_007_006,
+#endif
&test_007_007,
NULL
};
diff --git a/test/rt/source/test/test_sequence_012.c b/test/rt/source/test/test_sequence_012.c index 4405541e7..f224d45bd 100644 --- a/test/rt/source/test/test_sequence_012.c +++ b/test/rt/source/test/test_sequence_012.c @@ -112,12 +112,14 @@ static THD_FUNCTION(bmk_thread4, p) { chSysUnlock(); } +#if CH_CFG_USE_SEMAPHORES static THD_FUNCTION(bmk_thread7, p) { (void)p; while (!chThdShouldTerminateX()) chSemWait(&sem1); } +#endif static THD_FUNCTION(bmk_thread8, p) { |