added documentation

corrections in block tests
added Makefile.am
This commit is contained in:
Thomas Doerfler
2009-11-30 12:41:10 +00:00
parent 47c23279bd
commit f9925bcc24
17 changed files with 280 additions and 19 deletions
+11
View File
@@ -1,3 +1,14 @@
2009-11-30 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
* block05/init.c: Check block size. Improved output.
* block01/init.c: Free ramdisk before exit.
* block01/block01.doc, block02/block02.doc, block03/block03.doc,
block04/block04.doc, block05/block05.doc, block06/block06.doc,
block07/block07.doc: New files.
* block01/Makefile.am, block02/Makefile.am, block03/Makefile.am,
block04/Makefile.am, block05/Makefile.am, block06/Makefile.am,
block07/Makefile.am: Add new files.
2009-11-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* block02/.cvsignore, block03/.cvsignore, block04/.cvsignore,
+1 -1
View File
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block01
block01_SOURCES = init.c
dist_rtems_tests_DATA = block01.scn
dist_rtems_tests_DATA = block01.scn block01.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
+32
View File
@@ -0,0 +1,32 @@
#
# $Id$
#
# Copyright (c) 2009
# embedded brains GmbH
# Obere Lagerstr. 30
# D-82178 Puchheim
# Germany
# <rtems@embedded-brains.de>
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
# http://www.rtems.com/license/LICENSE.
#
This file describes the directives and concepts tested by this test set.
test set name: block01
directives:
rtems_disk_create_log
rtems_disk_create_phys
rtems_disk_delete
rtems_disk_io_done
rtems_disk_io_initialize
rtems_disk_release
concepts:
+ Check error conditions.
+ Create and delete physical and logical disks.
+4
View File
@@ -17,6 +17,8 @@
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#include <stdio.h>
@@ -153,6 +155,8 @@ static void test_diskdevs(void)
sc = rtems_io_unregister_driver(major);
ASSERT_SC(sc);
ramdisk_free(rd);
sc = rtems_disk_io_done();
ASSERT_SC(sc);
}
+1 -1
View File
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block02
block02_SOURCES = init.c
dist_rtems_tests_DATA = block02.scn
dist_rtems_tests_DATA = block02.scn block02.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
+26
View File
@@ -0,0 +1,26 @@
#
# $Id$
#
# Copyright (c) 2009
# embedded brains GmbH
# Obere Lagerstr. 30
# D-82178 Puchheim
# Germany
# <rtems@embedded-brains.de>
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
# http://www.rtems.com/license/LICENSE.
#
This file describes the directives and concepts tested by this test set.
test set name: block02
directives:
rtems_bdbuf_get
concepts:
+ Check a special wake-up condition with two disks of different block sizes.
+1 -1
View File
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block03
block03_SOURCES = init.c
dist_rtems_tests_DATA = block03.scn
dist_rtems_tests_DATA = block03.scn block03.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
+26
View File
@@ -0,0 +1,26 @@
#
# $Id$
#
# Copyright (c) 2009
# embedded brains GmbH
# Obere Lagerstr. 30
# D-82178 Puchheim
# Germany
# <rtems@embedded-brains.de>
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
# http://www.rtems.com/license/LICENSE.
#
This file describes the directives and concepts tested by this test set.
test set name: block03
directives:
rtems_bdbuf_get
concepts:
+ Check a special wake-up condition with one disks and different blocks.
+1 -1
View File
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block04
block04_SOURCES = init.c
dist_rtems_tests_DATA = block04.scn
dist_rtems_tests_DATA = block04.scn block04.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
+31
View File
@@ -0,0 +1,31 @@
#
# $Id$
#
# Copyright (c) 2009
# embedded brains GmbH
# Obere Lagerstr. 30
# D-82178 Puchheim
# Germany
# <rtems@embedded-brains.de>
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
# http://www.rtems.com/license/LICENSE.
#
This file describes the directives and concepts tested by this test set.
test set name: block04
directives:
concepts:
directives:
rtems_bdbuf_get
rtems_bdbuf_sync
concepts:
+ Check a special wake-up condition with one disk.
+1 -1
View File
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block05
block05_SOURCES = init.c
dist_rtems_tests_DATA = block05.scn
dist_rtems_tests_DATA = block05.scn block05.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
+44
View File
@@ -0,0 +1,44 @@
#
# $Id$
#
# Copyright (c) 2009
# embedded brains GmbH
# Obere Lagerstr. 30
# D-82178 Puchheim
# Germany
# <rtems@embedded-brains.de>
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
# http://www.rtems.com/license/LICENSE.
#
This file describes the directives and concepts tested by this test set.
test set name: block05
directives:
rtems_bdbuf_get
rtems_bdbuf_read
rtems_bdbuf_release
rtems_bdbuf_release_modified
rtems_bdbuf_sync
concepts:
+ State machine test.
State changes count during this test:
| PREVIOUS STATE
------+-------------------------------------------------------------------
| EM FR CA AC AM MO SY TR
| EM 6480 0 5040 0 0 0 0 0
| FR 5041 0 23040 0 0 0 0 0
| CA 0 0 0 22212 0 0 0 31608
NEW | AC 0 17569 25739 0 0 0 0 0
STATE | AM 0 0 0 0 0 3348 0 0
| MO 0 0 0 10548 2232 0 0 0
| SY 0 0 0 10548 1116 0 0 0
| TR 0 10512 0 0 0 9432 11664 0
+52 -12
View File
@@ -49,6 +49,7 @@
#define BLOCK_COUNT_B 1
/* In case of trouble change this to 1 or 2 for more output */
static unsigned output_level = 0;
static dev_t dev_a;
@@ -73,27 +74,49 @@ static volatile enum resume_style {
} resume;
static volatile enum trig_style {
SUSP,
NO_SUSP
SUSP = 0,
CONT
} trig;
static volatile enum get_type {
GET,
GET = 0,
READ
} trig_get, low_get, high_get;
static volatile enum blk_kind {
BLK_A0,
BLK_A0 = 0,
BLK_A1,
BLK_B0
} trig_blk, low_blk, high_blk;
static volatile enum rel_type {
REL,
REL = 0,
REL_MOD,
SYNC
} trig_rel, low_rel, high_rel;
static const char trig_style_desc [] = {
'S',
'C'
};
static const char get_type_desc [] = {
'G',
'R'
};
static const char *blk_kind_desc [] = {
"A0",
"A1",
"B0"
};
static const char rel_type_desc [] = {
'R',
'M',
'S'
};
static void print(unsigned level, const char *fmt, ...)
{
if (level <= output_level) {
@@ -122,19 +145,23 @@ static rtems_bdbuf_buffer *get(enum get_type type, enum blk_kind kind)
rtems_status_code (*get_bd)(dev_t, rtems_blkdev_bnum, rtems_bdbuf_buffer **)
= NULL;
dev_t dev = 0;
size_t bds_per_group = 0;
switch (kind) {
case BLK_A0:
dev = dev_a;
blk_index = 0;
bds_per_group = 2;
break;
case BLK_A1:
dev = dev_a;
blk_index = 1;
bds_per_group = 2;
break;
case BLK_B0:
dev = dev_b;
blk_index = 0;
bds_per_group = 1;
break;
default:
assert(false);
@@ -154,7 +181,12 @@ static rtems_bdbuf_buffer *get(enum get_type type, enum blk_kind kind)
}
sc = (*get_bd)(dev, blk_index, &bd);
assert(sc == RTEMS_SUCCESSFUL && bd->dev == dev && bd->block == blk_index);
assert(
sc == RTEMS_SUCCESSFUL
&& bd->dev == dev
&& bd->block == blk_index
&& bd->group->bds_per_group == bds_per_group
);
return bd;
}
@@ -252,10 +284,18 @@ static void execute_test(unsigned i)
print(
1,
"[%05u]T%i,TG%i,TB%i,TR%i,LG%i,LB%i,LR%i,HG%i,HB%i,HR%i\n",
i, trig, trig_get, trig_blk, trig_rel,
low_get, low_blk, low_rel,
high_get, high_blk, high_rel
"[%05u]T(%c,%c,%s,%c)L(%c,%s,%c)H(%c,%s,%c)\n",
i,
trig_style_desc [trig],
get_type_desc [trig_get],
blk_kind_desc [trig_blk],
rel_type_desc [trig_rel],
get_type_desc [low_get],
blk_kind_desc [low_blk],
rel_type_desc [low_rel],
get_type_desc [high_get],
blk_kind_desc [high_blk],
rel_type_desc [high_rel]
);
set_task_prio(task_id_low, PRIORITY_LOW);
@@ -279,7 +319,7 @@ static void execute_test(unsigned i)
case SUSP:
suspend = true;
break;
case NO_SUSP:
case CONT:
suspend = false;
break;
default:
@@ -432,7 +472,7 @@ static rtems_task Init(rtems_task_argument argument)
sc = rtems_task_suspend(task_id_high);
ASSERT_SC(sc);
for (trig = SUSP; trig <= NO_SUSP; ++trig) {
for (trig = SUSP; trig <= CONT; ++trig) {
for (trig_get = GET; trig_get <= READ; ++trig_get) {
for (low_get = GET; low_get <= READ; ++low_get) {
for (high_get = GET; high_get <= READ; ++high_get) {
+1 -1
View File
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block06
block06_SOURCES = init.c
dist_rtems_tests_DATA = block06.scn
dist_rtems_tests_DATA = block06.scn block06.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
+21
View File
@@ -0,0 +1,21 @@
#
# $Id$
#
# Copyright 2008 Chris Johns (chrisj@rtems.org)
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
# http://www.rtems.com/license/LICENSE.
#
This file describes the directives and concepts tested by this test set.
test set name: block06
directives:
TODO
concepts:
TODO
+1 -1
View File
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block07
block07_SOURCES = init.c
dist_rtems_tests_DATA = block07.scn
dist_rtems_tests_DATA = block07.scn block07.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
+26
View File
@@ -0,0 +1,26 @@
#
# $Id$
#
# Copyright (c) 2009
# embedded brains GmbH
# Obere Lagerstr. 30
# D-82178 Puchheim
# Germany
# <rtems@embedded-brains.de>
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
# http://www.rtems.com/license/LICENSE.
#
This file describes the directives and concepts tested by this test set.
test set name: block07
directives:
rtems_bdbuf_get
concepts:
+ Test block size change condition.