aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-10-24 12:16:46 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-10-24 12:16:46 +0000
commit99b4f26a6513bf2ab68a10165d786f2dbd7ccc50 (patch)
treee7a146d97723502b37b79587d82c3258ba096eca
parent2b8e64aada976519f7a6d7f6c84b2eb7a6b2b779 (diff)
downloadChibiOS-99b4f26a6513bf2ab68a10165d786f2dbd7ccc50.tar.gz
ChibiOS-99b4f26a6513bf2ab68a10165d786f2dbd7ccc50.tar.bz2
ChibiOS-99b4f26a6513bf2ab68a10165d786f2dbd7ccc50.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10893 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--test/nasa_osal/configuration.xml3
-rw-r--r--test/nasa_osal/source/test/nasa_osal_test_root.c2
-rw-r--r--test/nil/configuration.xml6
-rw-r--r--test/nil/source/test/nil_test_root.c2
-rw-r--r--test/oslib/.cproject2
-rw-r--r--test/oslib/configuration.xml27
-rw-r--r--test/oslib/source/test/oslib_test_root.c6
-rw-r--r--test/oslib/source/test/oslib_test_root.h1
-rw-r--r--test/oslib/source/test/oslib_test_sequence_004.c72
-rw-r--r--test/oslib/source/test/oslib_test_sequence_004.h27
-rw-r--r--test/rt/configuration.xml19
-rw-r--r--test/rt/source/test/rt_test_root.c2
12 files changed, 150 insertions, 19 deletions
diff --git a/test/nasa_osal/configuration.xml b/test/nasa_osal/configuration.xml
index 24a01ea67..f1b2a3aa2 100644
--- a/test/nasa_osal/configuration.xml
+++ b/test/nasa_osal/configuration.xml
@@ -9,6 +9,9 @@
<instance locked="false" id="org.chibios.spc5.components.portable.generic_startup" />
<instance locked="false" id="org.chibios.spc5.components.portable.chibios_unitary_tests_engine">
<description>
+ <brief>
+ <value>NASA OSAL Test Suite.</value>
+ </brief>
<copyright>
<value><![CDATA[/* Copyright statement.*/]]></value>
</copyright>
diff --git a/test/nasa_osal/source/test/nasa_osal_test_root.c b/test/nasa_osal/source/test/nasa_osal_test_root.c
index 9245eb8a7..2e6df7739 100644
--- a/test/nasa_osal/source/test/nasa_osal_test_root.c
+++ b/test/nasa_osal/source/test/nasa_osal_test_root.c
@@ -47,7 +47,7 @@ const testsequence_t * const nasa_osal_test_suite_array[] = {
* @brief Test suite root structure.
*/
const testsuite_t nasa_osal_test_suite = {
- "Test specification for the NASA OSAL ChibiOS extension.",
+ "NASA OSAL Test Suite",
nasa_osal_test_suite_array
};
diff --git a/test/nil/configuration.xml b/test/nil/configuration.xml
index c18e8f181..3ed8e5892 100644
--- a/test/nil/configuration.xml
+++ b/test/nil/configuration.xml
@@ -9,6 +9,9 @@
<instance locked="false" id="org.chibios.spc5.components.portable.generic_startup" />
<instance locked="false" id="org.chibios.spc5.components.portable.chibios_unitary_tests_engine">
<description>
+ <brief>
+ <value>ChibiOS/NIL Test Suite.</value>
+ </brief>
<copyright>
<value><![CDATA[/*
ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
@@ -100,9 +103,6 @@ THD_FUNCTION(test_support, arg) {
}]]></value>
</global_code>
</global_data_and_code>
- <code_prefix>
- <value>nil_</value>
- </code_prefix>
<sequences>
<sequence>
<type index="0">
diff --git a/test/nil/source/test/nil_test_root.c b/test/nil/source/test/nil_test_root.c
index 4974bad56..a1590e012 100644
--- a/test/nil/source/test/nil_test_root.c
+++ b/test/nil/source/test/nil_test_root.c
@@ -59,7 +59,7 @@ const testsequence_t * const nil_test_suite_array[] = {
* @brief Test suite root structure.
*/
const testsuite_t nil_test_suite = {
- "Test Specification for ChibiOS/NIL.",
+ "ChibiOS/NIL Test Suite",
nil_test_suite_array
};
diff --git a/test/oslib/.cproject b/test/oslib/.cproject
index 8168c2d37..3aa7e6222 100644
--- a/test/oslib/.cproject
+++ b/test/oslib/.cproject
@@ -36,8 +36,8 @@
</toolChain>
</folderInfo>
<sourceEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="source"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="components"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="source"/>
</sourceEntries>
</configuration>
</storageModule>
diff --git a/test/oslib/configuration.xml b/test/oslib/configuration.xml
index 1fcb47218..54f56fd90 100644
--- a/test/oslib/configuration.xml
+++ b/test/oslib/configuration.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<SPC5-Config version="1.0.0">
- <application name="ChibiOS/RT Test Suite" version="1.0.0" standalone="true" locked="false">
- <description>ChibiOS OS Library Test Suite.</description>
+ <application name="ChibiOS OS Library Test Suite" version="1.0.0" standalone="true" locked="false">
+ <description>Test Specification for ChibiOS OS Library.</description>
<component id="org.chibios.spc5.components.portable.generic_startup">
<component id="org.chibios.spc5.components.portable.chibios_unitary_tests_engine" />
</component>
@@ -9,6 +9,9 @@
<instance locked="false" id="org.chibios.spc5.components.portable.generic_startup" />
<instance locked="false" id="org.chibios.spc5.components.portable.chibios_unitary_tests_engine">
<description>
+ <brief>
+ <value>ChibiOS OS Library Test Suite.</value>
+ </brief>
<copyright>
<value><![CDATA[/*
ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
@@ -711,7 +714,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value><![CDATA[#define ALLOC_SIZE 16
#define HEAP_SIZE (ALLOC_SIZE * 8)
-static memory_heap_t test_heap;
+static memory_heap_t test_heap;
static uint8_t test_heap_buffer[HEAP_SIZE];]]></value>
</shared_code>
<cases>
@@ -946,6 +949,24 @@ test_assert(p1 == NULL, "allocation not failed");]]></value>
</case>
</cases>
</sequence>
+ <sequence>
+ <type index="0">
+ <value>Internal Tests</value>
+ </type>
+ <brief>
+ <value>Objects Factory.</value>
+ </brief>
+ <description>
+ <value>This sequence tests the ChibiOS library functionalities related to the object factory.</value>
+ </description>
+ <condition>
+ <value>(CH_CFG_USE_FACTORY == TRUE) &amp;&amp; (CH_CFG_USE_MEMPOOLS == TRUE) &amp;&amp; (CH_CFG_USE_HEAP == TRUE)</value>
+ </condition>
+ <shared_code>
+ <value />
+ </shared_code>
+ <cases />
+ </sequence>
</sequences>
</instance>
</instances>
diff --git a/test/oslib/source/test/oslib_test_root.c b/test/oslib/source/test/oslib_test_root.c
index 4da5bc8fb..e222dcd06 100644
--- a/test/oslib/source/test/oslib_test_root.c
+++ b/test/oslib/source/test/oslib_test_root.c
@@ -24,6 +24,7 @@
* - @subpage oslib_test_sequence_001
* - @subpage oslib_test_sequence_002
* - @subpage oslib_test_sequence_003
+ * - @subpage oslib_test_sequence_004
* .
*/
@@ -54,6 +55,9 @@ const testsequence_t * const oslib_test_suite_array[] = {
#if (CH_CFG_USE_HEAP) || defined(__DOXYGEN__)
&oslib_test_sequence_003,
#endif
+#if ((CH_CFG_USE_FACTORY == TRUE) && (CH_CFG_USE_MEMPOOLS == TRUE) && (CH_CFG_USE_HEAP == TRUE)) || defined(__DOXYGEN__)
+ &oslib_test_sequence_004,
+#endif
NULL
};
@@ -61,7 +65,7 @@ const testsequence_t * const oslib_test_suite_array[] = {
* @brief Test suite root structure.
*/
const testsuite_t oslib_test_suite = {
- "ChibiOS OS Library Test Suite.",
+ "ChibiOS OS Library Test Suite",
oslib_test_suite_array
};
diff --git a/test/oslib/source/test/oslib_test_root.h b/test/oslib/source/test/oslib_test_root.h
index 6fa8fe58e..760ccddc8 100644
--- a/test/oslib/source/test/oslib_test_root.h
+++ b/test/oslib/source/test/oslib_test_root.h
@@ -27,6 +27,7 @@
#include "oslib_test_sequence_001.h"
#include "oslib_test_sequence_002.h"
#include "oslib_test_sequence_003.h"
+#include "oslib_test_sequence_004.h"
#if !defined(__DOXYGEN__)
diff --git a/test/oslib/source/test/oslib_test_sequence_004.c b/test/oslib/source/test/oslib_test_sequence_004.c
new file mode 100644
index 000000000..d43b9165f
--- /dev/null
+++ b/test/oslib/source/test/oslib_test_sequence_004.c
@@ -0,0 +1,72 @@
+/*
+ ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#include "hal.h"
+#include "oslib_test_root.h"
+
+/**
+ * @file oslib_test_sequence_004.c
+ * @brief Test Sequence 004 code.
+ *
+ * @page oslib_test_sequence_004 [4] Objects Factory
+ *
+ * File: @ref oslib_test_sequence_004.c
+ *
+ * <h2>Description</h2>
+ * This sequence tests the ChibiOS library functionalities related to
+ * the object factory.
+ *
+ * <h2>Conditions</h2>
+ * This sequence is only executed if the following preprocessor condition
+ * evaluates to true:
+ * - (CH_CFG_USE_FACTORY == TRUE) && (CH_CFG_USE_MEMPOOLS == TRUE) && (CH_CFG_USE_HEAP == TRUE)
+ * .
+ *
+ * <h2>Test Cases</h2>
+ * No test cases defined in the test sequence.
+ */
+
+#if ((CH_CFG_USE_FACTORY == TRUE) && (CH_CFG_USE_MEMPOOLS == TRUE) && (CH_CFG_USE_HEAP == TRUE)) || defined(__DOXYGEN__)
+
+/****************************************************************************
+ * Shared code.
+ ****************************************************************************/
+
+
+/****************************************************************************
+ * Test cases.
+ ****************************************************************************/
+
+/****************************************************************************
+ * Exported data.
+ ****************************************************************************/
+
+/**
+ * @brief Array of test cases.
+ */
+const testcase_t * const oslib_test_sequence_004_array[] = {
+ NULL
+};
+
+/**
+ * @brief Objects Factory.
+ */
+const testsequence_t oslib_test_sequence_004 = {
+ "Objects Factory",
+ oslib_test_sequence_004_array
+};
+
+#endif /* (CH_CFG_USE_FACTORY == TRUE) && (CH_CFG_USE_MEMPOOLS == TRUE) && (CH_CFG_USE_HEAP == TRUE) */
diff --git a/test/oslib/source/test/oslib_test_sequence_004.h b/test/oslib/source/test/oslib_test_sequence_004.h
new file mode 100644
index 000000000..c301863f2
--- /dev/null
+++ b/test/oslib/source/test/oslib_test_sequence_004.h
@@ -0,0 +1,27 @@
+/*
+ ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+/**
+ * @file oslib_test_sequence_004.h
+ * @brief Test Sequence 004 header.
+ */
+
+#ifndef OSLIB_TEST_SEQUENCE_004_H
+#define OSLIB_TEST_SEQUENCE_004_H
+
+extern const testsequence_t oslib_test_sequence_004;
+
+#endif /* OSLIB_TEST_SEQUENCE_004_H */
diff --git a/test/rt/configuration.xml b/test/rt/configuration.xml
index 7a39164d0..c25e56405 100644
--- a/test/rt/configuration.xml
+++ b/test/rt/configuration.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<SPC5-Config version="1.0.0">
<application name="ChibiOS/RT Test Suite" version="1.0.0" standalone="true" locked="false">
- <description>ChibiOS/RT Test Suite.</description>
+ <description>Test Specification for ChibiOS/RT.</description>
<component id="org.chibios.spc5.components.portable.generic_startup">
<component id="org.chibios.spc5.components.portable.chibios_unitary_tests_engine" />
</component>
@@ -9,6 +9,9 @@
<instance locked="false" id="org.chibios.spc5.components.portable.generic_startup" />
<instance locked="false" id="org.chibios.spc5.components.portable.chibios_unitary_tests_engine">
<description>
+ <brief>
+ <value>ChibiOS/RT Test Suite.</value>
+ </brief>
<copyright>
<value><![CDATA[/*
ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
@@ -1293,7 +1296,7 @@ for (i = 0; i < 5; i++) {
test_assert(sem1.cnt == 0, "counter not zero");
}
test_assert_sequence("ABCDE", "invalid sequence");
-test_assert_time_window(target_time,
+test_assert_time_window(target_time,
chTimeAddX(target_time, ALLOWED_DELAY),
"out of time window");]]></value>
</code>
@@ -1835,7 +1838,7 @@ test_assert_sequence("ABC", "invalid sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_time_window(chTimeAddX(time, TIME_MS2I(100)),
+ <value><![CDATA[test_assert_time_window(chTimeAddX(time, TIME_MS2I(100)),
chTimeAddX(time, TIME_MS2I(100) + ALLOWED_DELAY),
"out of time window");]]></value>
</code>
@@ -1901,7 +1904,7 @@ test_assert_sequence("ABCDE", "invalid sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_time_window(chTimeAddX(time, TIME_MS2I(110)),
+ <value><![CDATA[test_assert_time_window(chTimeAddX(time, TIME_MS2I(110)),
chTimeAddX(time, TIME_MS2I(110) + ALLOWED_DELAY),
"out of time window");]]></value>
</code>
@@ -2821,7 +2824,7 @@ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
</tags>
<code>
<value><![CDATA[m = chEvtWaitOne(ALL_EVENTS);
-test_assert_time_window(target_time,
+test_assert_time_window(target_time,
chTimeAddX(target_time, ALLOWED_DELAY),
"out of time window");
test_assert(m == 1, "event flag error");
@@ -2902,7 +2905,7 @@ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
</tags>
<code>
<value><![CDATA[m = chEvtWaitAny(ALL_EVENTS);
-test_assert_time_window(target_time,
+test_assert_time_window(target_time,
chTimeAddX(target_time, ALLOWED_DELAY),
"out of time window");
test_assert(m == 1, "event flag error");
@@ -2994,7 +2997,7 @@ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
</tags>
<code>
<value><![CDATA[m = chEvtWaitAll(5);
-test_assert_time_window(target_time,
+test_assert_time_window(target_time,
chTimeAddX(target_time, ALLOWED_DELAY),
"out of time window");
test_assert(m == 5, "event flags error");
@@ -3121,7 +3124,7 @@ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
</tags>
<code>
<value><![CDATA[m = chEvtWaitAll(5);
-test_assert_time_window(target_time,
+test_assert_time_window(target_time,
chTimeAddX(target_time, ALLOWED_DELAY),
"out of time window");
m = chEvtGetAndClearEvents(ALL_EVENTS);
diff --git a/test/rt/source/test/rt_test_root.c b/test/rt/source/test/rt_test_root.c
index 0349fc1e6..5de8d38aa 100644
--- a/test/rt/source/test/rt_test_root.c
+++ b/test/rt/source/test/rt_test_root.c
@@ -79,7 +79,7 @@ const testsequence_t * const rt_test_suite_array[] = {
* @brief Test suite root structure.
*/
const testsuite_t rt_test_suite = {
- "ChibiOS/RT Test Suite.",
+ "ChibiOS/RT Test Suite",
rt_test_suite_array
};