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

This commit is contained in:
gdisirio 2009-05-07 15:24:47 +00:00
parent fcd92814ce
commit aea323e121
22 changed files with 239 additions and 36 deletions

View File

@ -573,10 +573,11 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ../src/include \
INPUT = ../docs/src \
../src/include \
../src/templates \
../src \
../docs/src \
../test \
../src/lib \
../ports/ARM7 \
../ports/ARM7/crt0.s \
@ -637,7 +638,7 @@ FILE_PATTERNS = *.c \
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = YES
RECURSIVE = NO
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
@ -1298,17 +1299,12 @@ PREDEFINED = __DOXYGEN__ \
CH_USE_CONDVARS_TIMEOUT=1 \
CH_USE_EVENTS=1 \
CH_USE_EVENTS_TIMEOUT=1 \
CH_USE_EXIT_EVENT=1 \
CH_USE_QUEUES=1 \
CH_USE_QUEUES_TIMEOUT=1 \
CH_USE_QUEUES_HALFDUPLEX=1 \
CH_USE_SERIAL_FULLDUPLEX=1 \
CH_USE_SERIAL_HALFDUPLEX=1 \
CH_USE_HEAP=1 \
CH_USE_MEMPOOLS=1 \
CH_USE_MESSAGES=1 \
CH_USE_MAILBOXES=1 \
CH_USE_MESSAGES_EVENT=1 \
CH_USE_DYNAMIC=1 \
CH_DBG_ENABLE_ASSERTS=1 \
CH_DBG_ENABLE_CHECKS=1 \

View File

@ -19,7 +19,6 @@
/**
* @page articles Articles
* @{
* ChibiOS/RT Articles and Code Examples:
* - @subpage article_stacks
* - @subpage article_mutual_exclusion
@ -32,4 +31,3 @@
* - @subpage article_design
* .
*/
/** @} */

View File

@ -19,7 +19,6 @@
/**
* @page article_atomic Invoking multiple primitives as a single atomic operation
* @{
* It is often necessary to invoke multiple operations involving a
* reschedulation as a single atomic operation.<br>
* ChibiOS/RT already implements APIs that perform complex operations, as
@ -56,4 +55,3 @@
* API. An extra @p chSchRescheduleS() can be present at the very end of the
* block, it only reschedules if a reschedulation is still required.
*/
/** @} */

View File

@ -19,7 +19,6 @@
/**
* @page concepts Concepts and Architecture
* @{
* @brief ChibiOS/RT Concepts and Architecture
* - @ref naming
* - @ref api_suffixes
@ -261,4 +260,3 @@
* extra layers, this is just not part of the kernel architecture but part of
* the overall system design.
*/
/** @} */

View File

@ -19,7 +19,6 @@
/**
* @page article_design Designing an embedded application
* @{
* ChibiOS/RT offers a variety of mechanisms and primitives, often it is
* better to focus on a single approach for the system design and use only
* part of the available subsystems.<br>
@ -109,4 +108,3 @@
* it. The OS is a toolbox that offers a lot of tools but you don't have
* to use them all necessarily.
*/
/** @} */

View File

@ -19,7 +19,6 @@
/**
* @page goals Project Goals
* @{
* <h2>Another RTOS?</h2>
* The first question to be answered is: there was really the need for YET
* ANOTHER RTOS?<br>
@ -87,4 +86,3 @@
* code is released as well, all the included demos are capable of executing
* the test suite and the OS benchmarks.
*/
/** @} */

View File

@ -19,7 +19,6 @@
/**
* @page article_interrupts Writing interrupt handlers under ChibiOS/RT
* @{
* Since version 1.1.0 ChibiOS/RT offers a cross-platform method for writing
* interrupt handlers. Port-related and compiler-related details are
* encapsulated within standard system macros.<br>
@ -50,5 +49,4 @@ CH_IRQ_HANDLER(myIRQ) {
* please read about it in the ARM7 port section: @ref ARM7_IH
* .
*/
/** @} */

View File

@ -19,7 +19,6 @@
/**
* @page article_jitter Response Time and Jitter
* @{
* Response time jitter is one of the most sneaky source of problems when
* designing a real time system. When using a RTOS like ChibiOS/RT one must
* be aware of what the jitter is and how it can affect the performance of the
@ -134,4 +133,3 @@
* subsystem can improve the overall response time and reduce jitter but it is
* not a magic wand, a proper system design comes first.
*/
/** @} */

View File

@ -19,7 +19,6 @@
/**
* @page lic_faq License and F.A.Q.
* @{
* ChibiOS/RT is a <a href="http://www.gnu.org/licenses" target="_top">
* GPL3</a>-licensed product but it offers a linking exception in its stable
* releases.<br>
@ -89,5 +88,4 @@ Program code and other code used in conjunction with the Program except the
Non-GPL Code covered by this exception.
*
*/
/** @} */

View File

@ -64,6 +64,27 @@
* .
*/
/**
* @page TEST_SUITE Tests Description
* <h2>Descriptions</h2>
* Most of the ChibiOS/RT demos link a set of software modules (test suite) in
* order to verify the proper working of the kernel, the port and the demo
* itself.<br>
* Each Test Module performs a series of tests on a specified subbsystem or
* subsystems and can report a failure/success status and/or a performance
* index as the test suite output.<br>
* The test suite is usually activated in the demo applications by pressing a
* button on the target board, see the readme into the various demos
* directories. The test suite output is usually sent through a serial port and
* can be examined by using a terminal emulator program.
*
* <h2>Test Modules</h2>
* - @subpage test_threads
* - @subpage test_queues
* - @subpage test_serial
* .
*/
/**
* @defgroup Ports Ports
* This section describes the technical details for the various supported

View File

@ -19,7 +19,6 @@
/**
* @page article_mutual_exclusion Mutual Exclusion guide
* @{
* The most common problem when writing multithreaded code is the
* synchronization on the shared resources/services.<br>
* ChibiOS/RT offers a rich variety of mechanisms that apparently solve the
@ -209,4 +208,3 @@
* - Requires a dedicated thread as server.
* .
*/
/** @} */

View File

@ -19,7 +19,6 @@
/**
* @page article_portguide Porting ChibiOS/RT for Dummies
* @{
* Porting the operating system on a new platform is one of the most common
* tasks. The difficulty can range from easy to very difficult depending
* on several factors.<br>
@ -111,4 +110,3 @@
* the OS template files, the hardest part is decide the correct and efficient
* way to implement the context switching.
*/
/** @} */

View File

@ -19,7 +19,6 @@
/**
* @page article_saveram Saving RAM by declaring thread functions "noreturn"
* @{
* One of the problems, when writing embedded multi-threaded applications,
* is that the thread functions do save the registers in the function
* entry code even if the system does not require it, exiting such
@ -80,4 +79,3 @@ main() {
* need to save registers. The code will be a bit less readable and less
* portable on other compilers however.
*/
/** @} */

View File

@ -19,7 +19,6 @@
/**
* @page article_stacks Stacks and stack sizes
* @{
* In a RTOS like ChibiOS/RT there are several dedicated stacks, each stack
* has a dedicated RAM space that must have a correctly sized assigned area.
* <h2>The stacks</h2>
@ -104,4 +103,3 @@
* end of your development cycle.
* .
*/
/** @} */

View File

@ -19,7 +19,6 @@
/**
* @page article_timing Reliable timings using Threads
* @{
* One common task is to have threads do something at regular, scheduled,
* intervals.
* An obvious solution is to write something like this:
@ -58,4 +57,3 @@ msg_t my_thread(void *param) {
* deadline time and the error will not accumulate over time regardless of
* the execution time and delays inserted by other threads.
*/
/** @} */

View File

@ -228,6 +228,7 @@
* If specified then the Asynchronous Messages (Mailboxes) APIs are included
* in the kernel.
* @note The default is @p TRUE.
* @note Requires @p CH_USE_SEMAPHORES.
*/
#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__)
#define CH_USE_MAILBOXES TRUE

View File

@ -30,6 +30,7 @@
#include "testpools.h"
#include "testdyn.h"
#include "testqueues.h"
#include "testserial.h"
#include "testbmk.h"
/*
@ -46,6 +47,7 @@ static const struct testcase **patterns[] = {
patternpools,
patterndyn,
patternqueues,
patternserial,
patternbmk,
NULL
};

View File

@ -4,7 +4,8 @@ TESTSRC = ../../test/test.c ../../test/testthd.c \
../../test/testmsg.c ../../test/testmbox.c \
../../test/testevt.c ../../test/testheap.c \
../../test/testpools.c ../../test/testdyn.c \
../../test/testqueues.c ../../test/testbmk.c
../../test/testqueues.c ../../test/testserial.c \
../../test/testbmk.c
# Required include directories
TESTINC = ../../test

View File

@ -21,10 +21,51 @@
#include "test.h"
/**
* @page test_queues I/O Queues test
*
* <h2>Description</h2>
* This module implements the test sequence for the @ref IOQueues subsystem.
* The tests are performed by inserting and removing data from queues and by
* checking both the queues status and the correct sequence of the extracted
* data.
*
* <h2>Objective</h2>
* Objective of the test module is to cover 100% of the @ref IOQueues code
* as a necessary step in order to assess its readyness.<br>
* Note that the @ref IOQueues subsystem depends on the @ref Semaphores
* subsystem that has to met its testing objectives as well.
*
* <h2>Preconditions</h2>
* The module requires the following kernel options:
* - @p CH_USE_QUEUES (and dependent options)
* .
* In case of the required options are not enabled some or all tests may be
* skipped.
*
* <h2>Waivers</h2>
* None.
*
* <h2>Test Cases</h2>
* - @subpage test_queues_001
* - @subpage test_queues_002
* .
* @file testqueues.c
* @file testqueues.h
*/
#if CH_USE_QUEUES
#define TEST_QUEUES_SIZE 4
/**
* @page test_queues_001 Input Queues functionality and APIs
*
* <h2>Description</h2>
* This test case tests sysnchronos and asynchronous operations on an
* @p InputQueue object including timeouts. The queue state must remain
* consistent through the whole test.
*/
static void notify(void) {}
static char *queues1_gettest(void) {
@ -81,6 +122,14 @@ const struct testcase testqueues1 = {
queues1_execute
};
/**
* @page test_queues_002 Output Queues functionality and APIs
*
* <h2>Description</h2>
* This test case tests sysnchronos and asynchronous operations on an
* @p OutputQueue object including timeouts. The queue state must remain
* consistent through the whole test.
*/
static char *queues2_gettest(void) {
return "Queues, output queues";

65
test/testserial.c Normal file
View File

@ -0,0 +1,65 @@
/*
ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <ch.h>
#include "test.h"
/**
* @page test_serial Serial Driver test
*
* <h2>Description</h2>
* This module implements the test sequence for the @ref Serial subsystem.
* The tests are performed on a loopback software serial driver where a
* dedicated thread echoes back in the input queue the data read from the
* output queue at a fixed rate.
*
* <h2>Objective</h2>
* Objective of the test module is to cover 100% of the @ref Serial code
* as a necessary step in order to assess its readyness.<br>
* Note that the @ref Serial subsystem depends on the @ref Semaphores and
* @ref Events subsystems that have to met their testing objectives as well.
*
* <h2>Preconditions</h2>
* The module requires the following kernel options:
* - @p CH_USE_SERIAL_FULLDUPLEX (and dependent options)
* .
* In case of the required options are not enabled some or all tests may be
* skipped.
*
* <h2>Waivers</h2>
* None.
*
* @file testserial.c
* @file testserial.h
*/
#if CH_USE_SERIAL_FULLDUPLEX
#endif /* CH_USE_SERIAL_FULLDUPLEX */
/*
* Test sequence for queues pattern.
*/
const struct testcase * const patternserial[] = {
#if CH_USE_SERIAL_FULLDUPLEX
&testserial1,
#endif
NULL
};

25
test/testserial.h Normal file
View File

@ -0,0 +1,25 @@
/*
ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TESTSERIAL_H_
#define _TESTSERIAL_H_
extern const struct testcase *patternserial[];
#endif /* _TESTSERIAL_H_ */

View File

@ -21,6 +21,47 @@
#include "test.h"
/**
* @page test_threads Threads and Scheduler test
*
* <h2>Description</h2>
* This module implements the test sequence for the @ref Scheduler,
* @ref Threads and @ref Time subsystems.<br>
* Note that the tests on those subsystems are formally required but most of
* their functionality is already demostrated because the test suite itself
* depends on them, anyway doublecheck is good.
*
* <h2>Objective</h2>
* Objective of the test module is to cover 100% of the subsystems code
* as a necessary step in order to assess their readyness.<br>
*
* <h2>Preconditions</h2>
* None.
*
* <h2>Waivers</h2>
* - The @p chThdExit() API is not code 100% covered because it cannot return.
* It must work this way by design.
* .
* <h2>Test Cases</h2>
* - @subpage test_threads_001
* - @subpage test_threads_002
* - @subpage test_threads_003
* - @subpage test_threads_004
* .
* @file testthd.c
* @file testthd.h
*/
/**
* @page test_threads_001 Ready List functionality #1
*
* <h2>Description</h2>
* Five threads, with increasing priority, are enqueued in the ready list
* and atomically executed.<br>
* The test expects the threads to perform their operations in increasing
* priority order redardless of the initial order.
*/
static msg_t thread(void *p) {
test_emit_token(*(char *)p);
@ -50,6 +91,16 @@ const struct testcase testthd1 = {
thd1_execute
};
/**
* @page test_threads_002 Ready List functionality #2
*
* <h2>Description</h2>
* Five threads, with pseudo-random priority, are enqueued in the ready list
* and atomically executed.<br>
* The test expects the threads to perform their operations in increasing
* priority order redardless of the initial order.
*/
static char *thd2_gettest(void) {
return "Threads, enqueuing test #2";
@ -73,6 +124,16 @@ const struct testcase testthd2 = {
thd2_execute
};
/**
* @page test_threads_003 Threads priority change test
*
* <h2>Description</h2>
* A series of priority changes are performed on the current thread in order
* to verify that the priority change happens as expected.<br>
* If the @p CH_USE_MUTEXES option is enabled then the priority changes are
* also tested under priority inheritance boosted priority state.
*/
static char *thd3_gettest(void) {
return "Threads, priority change";
@ -133,6 +194,14 @@ const struct testcase testthd3 = {
thd3_execute
};
/**
* @page test_threads_004 Threads delays test
*
* <h2>Description</h2>
* Delay APIs and associated macros are tested, the invoking thread is verified
* to wake up at the exact expected time.
*/
static char *thd4_gettest(void) {
return "Threads, delays";
@ -172,7 +241,7 @@ const struct testcase testthd4 = {
};
/*
* Test sequence for ready list pattern.
* Test sequence for threads patterns.
*/
const struct testcase * const patternthd[] = {
&testthd1,