tests: Add and use <rtems/testopts.h>

Add the build option RTEMS_TEST_VERBOSITY to control the verbosity of
test suites using the RTEMS Test Framework.
This commit is contained in:
Sebastian Huber
2020-09-26 11:53:07 +02:00
parent cb1b8260fc
commit 2d8802b519
5 changed files with 53 additions and 2 deletions

View File

@@ -62,6 +62,8 @@ links:
uid: tmtests/grp
- role: build-dependency
uid: validation/grp
- role: build-dependency
uid: testopts
type: build
use-after:
- rtemscpu

View File

@@ -0,0 +1,34 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
actions:
- get-string: null
- script: |
verbosities = {
"Verbose": "T_VERBOSE",
"Normal": "T_NORMAL",
"Quiet": "T_QUIET",
}
name = self.data["name"]
try:
conf.define(name, verbosities[value], quote=False)
except KeyError:
conf.fatal("The value of {} shall be one of {}".format(
name, verbosities.keys()))
build-type: option
copyrights:
- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
default: Normal
default-by-variant: []
description: |
Sets the test verbosity of the RTEMS Test Framework. Valid values are
"Verbose", "Normal", and "Quiet". For normal tests runs you can use a
verbosity of "Normal". If you need a more detailed output, then you can set
it to "Verbose". For example, in case a regression ocurred. Reducing the
verbosity level can significantly reduce the test duration especially on
targets with a slow serial output device. All verbosity levels produce
enough output to notice failed test cases. In particular, the begin and end
of test information is not affected by the verbosity level.
enabled-by: true
format: '{}'
links: []
name: RTEMS_TEST_VERBOSITY
type: build

View File

@@ -0,0 +1,13 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
build-type: config-header
copyrights:
- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
enabled-by: true
guard: _RTEMS_TESTOPTS_H
include-headers: []
install-path: ${BSP_INCLUDEDIR}/rtems
links:
- role: build-dependency
uid: optverbosity
target: cpukit/include/rtems/testopts.h
type: build

View File

@@ -34,6 +34,7 @@
#include <string.h>
#include <rtems/test.h>
#include <rtems/testopts.h>
#include <tmacros.h>
#define CPU_COUNT 32
@@ -43,7 +44,7 @@ const char rtems_test_name[] = "SMPMULTICAST 1";
static const T_config config = {
.name = "SMPMultiCast",
.putchar = T_putchar_default,
.verbosity = T_VERBOSE,
.verbosity = RTEMS_TEST_VERBOSITY,
.now = T_now_clock
};

View File

@@ -49,6 +49,7 @@
#include <rtems/sysinit.h>
#include <rtems/test.h>
#include <rtems/testopts.h>
/**
* @defgroup RTEMSTestSuiteTestsuitesValidation0 spec:/testsuites/validation-0
@@ -88,7 +89,7 @@ static const T_config test_config = {
.buf = buffer,
.buf_size = sizeof( buffer ),
.putchar = rtems_put_char,
.verbosity = T_VERBOSE,
.verbosity = RTEMS_TEST_VERBOSITY,
.now = T_now_clock,
.action_count = T_ARRAY_SIZE( actions ),
.actions = actions