aboutsummaryrefslogtreecommitdiffstats
path: root/test/oslib
diff options
context:
space:
mode:
Diffstat (limited to 'test/oslib')
-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
6 files changed, 130 insertions, 5 deletions
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 */