git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10893 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
Giovanni Di Sirio 2017-10-24 12:16:46 +00:00
parent 2b8e64aada
commit 99b4f26a65
12 changed files with 150 additions and 19 deletions

View File

@ -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>

View File

@ -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
};

View File

@ -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">

View File

@ -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
};

View File

@ -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>

View File

@ -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>

View File

@ -24,6 +24,7 @@
* - @subpage oslib_test_sequence_001
* - @subpage oslib_test_sequence_002
* - @subpage oslib_test_sequence_003
* - @subpage oslib_test_sequence_004
* .
*/
@ -53,6 +54,9 @@ const testsequence_t * const oslib_test_suite_array[] = {
#endif
#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
};

View File

@ -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__)

View File

@ -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) */

View File

@ -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 */

View File

@ -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);

View File

@ -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
};