2016-08-22 13:51:46 +02:00
|
|
|
# Copyright (c) 2016 Intel Corporation
|
2017-01-19 02:01:01 +01:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2016-08-22 13:51:46 +02:00
|
|
|
|
2019-03-18 15:03:35 +01:00
|
|
|
menu "Testing"
|
2016-08-22 13:51:46 +02:00
|
|
|
|
2019-02-19 21:45:18 +01:00
|
|
|
source "subsys/testsuite/ztest/Kconfig"
|
2016-08-22 13:51:46 +02:00
|
|
|
|
2018-01-06 22:15:53 +01:00
|
|
|
config TEST
|
|
|
|
bool "Mark project as a test"
|
2019-03-13 20:56:51 +01:00
|
|
|
# For tests, store thread names in binary and dump them on crash to
|
|
|
|
# ease debugging.
|
|
|
|
select THREAD_NAME
|
2018-01-06 22:15:53 +01:00
|
|
|
help
|
|
|
|
Mark a project or an application as a test. This will enable a few
|
|
|
|
test defaults.
|
|
|
|
|
2017-01-31 23:05:18 +01:00
|
|
|
config TEST_EXTRA_STACKSIZE
|
2018-01-30 16:39:12 +01:00
|
|
|
int "Test function extra thread stack size"
|
2019-04-04 11:50:30 +02:00
|
|
|
default 2048 if COVERAGE_GCOV
|
2017-01-31 23:05:18 +01:00
|
|
|
default 768 if XTENSA
|
Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.
There are at least three problems with the patch:
1. It's inconsistent with how Kconfig works in other projects, which
might confuse newcomers.
2. Due to oversights, earlier 'range' properties are still preferred,
as well as earlier 'default' properties on choices.
In addition to being inconsistent, this makes it impossible to
override 'range' properties and choice 'default' properties if the
base definition of the symbol/choice already has 'range'/'default'
properties.
I've seen errors caused by the inconsistency, and I suspect there
are more.
3. A fork of Kconfiglib that adds the patch needs to be maintained.
Get rid of the patch and go back to standard Kconfig behavior, as
follows:
1. Include the Kconfig.defconfig files first instead of last in
Kconfig.zephyr.
2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
last in arch/Kconfig.
3. Include arch/<arch>/soc/*/Kconfig first instead of last in
arch/<arch>/Kconfig.
4. Swap a few other 'source's to preserve behavior for some scattered
symbols with multiple definitions.
Swap 'source's in some no-op cases too, where it might match the
intent.
5. Reverse the defaults on symbol definitions that have more than one
default.
Skip defaults that are mutually exclusive, e.g. where each default
has an 'if <some board>' condition. They are already safe.
6. Remove the prefer-later-defaults patch from Kconfiglib.
Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions
As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).
This commit includes some default-related cleanups as well:
- Simplify some symbol definitions, e.g. where a default has 'if FOO'
when the symbol already has 'depends on FOO'.
- Remove some redundant 'default ""' for string symbols. This is the
implicit default.
Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).
Piggyback some fixes for style nits too, e.g. unindented help texts.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-30 10:57:47 +02:00
|
|
|
default 0
|
2018-01-07 17:54:38 +01:00
|
|
|
help
|
|
|
|
Additional stack for tests on some platform where default is not
|
|
|
|
enough.
|
2017-01-31 23:05:18 +01:00
|
|
|
|
2018-08-31 11:43:36 +02:00
|
|
|
config HAS_COVERAGE_SUPPORT
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
The code coverage report generation is only available on boards
|
2019-02-11 16:44:51 +01:00
|
|
|
with enough spare RAM to buffer the coverage data, or on boards
|
|
|
|
based on the POSIX ARCH.
|
2018-08-31 11:43:36 +02:00
|
|
|
|
2017-11-22 14:28:52 +01:00
|
|
|
config COVERAGE
|
|
|
|
bool "Create coverage data"
|
2018-08-31 11:43:36 +02:00
|
|
|
depends on HAS_COVERAGE_SUPPORT
|
2017-11-22 14:28:52 +01:00
|
|
|
help
|
|
|
|
This option will build your application with the -coverage option
|
|
|
|
which will generate data that can be used to create coverage reports.
|
2019-09-12 14:31:00 +02:00
|
|
|
For more information see
|
|
|
|
https://docs.zephyrproject.org/latest/guides/coverage.html
|
2018-03-19 09:47:55 +01:00
|
|
|
|
2018-08-29 14:01:46 +02:00
|
|
|
config COVERAGE_GCOV
|
|
|
|
bool "Create Coverage data from hardware platform"
|
|
|
|
default y
|
kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.
There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.
The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).
Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.
Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.
Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.
The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.
(Everything above is true for choices, menus, and comments as well.)
Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 03:45:50 +01:00
|
|
|
depends on COVERAGE
|
|
|
|
depends on !NATIVE_APPLICATION
|
2018-08-29 14:01:46 +02:00
|
|
|
help
|
|
|
|
This option will select the custom gcov library. The reports will
|
|
|
|
be available over serial. This serial dump can be passed to
|
|
|
|
gen_gcov_files.py which creates the required .gcda files. These
|
|
|
|
can be read by gcov utility. For more details see gcovr.com .
|
|
|
|
|
2020-01-30 14:44:10 +01:00
|
|
|
config COVERAGE_DUMP
|
|
|
|
bool "Dump coverage data on exit"
|
|
|
|
depends on COVERAGE_GCOV
|
|
|
|
help
|
|
|
|
Dump collected coverage information to console on exit.
|
|
|
|
|
2018-03-19 09:47:55 +01:00
|
|
|
config TEST_USERSPACE
|
2019-04-06 00:39:50 +02:00
|
|
|
bool "Indicate that this test exercises user mode"
|
|
|
|
help
|
|
|
|
This option indicates that a test case puts threads in user mode,
|
2019-05-22 01:09:35 +02:00
|
|
|
and that the build system will [override and] enable USERSPACE
|
|
|
|
if the platform supports it. It should be set in a .conf file on
|
|
|
|
a per-test basis and is not meant to be used outside test cases.
|
|
|
|
Tests with this option should also have the "userspace" filtering
|
|
|
|
tag in their testcase.yaml file.
|
2019-04-06 00:39:50 +02:00
|
|
|
|
|
|
|
The userspace APIs are no-ops if userspace is not enabled, so it is
|
|
|
|
OK to enable this even if the test will run on platforms which do
|
|
|
|
not support userspace. The test should still run on those platforms,
|
|
|
|
just with all threads in supervisor mode.
|
|
|
|
|
|
|
|
If a test *requires* that userspace be enabled in order to
|
2019-05-22 01:09:35 +02:00
|
|
|
pass, CONFIG_ARCH_HAS_USERSPACE should be filtered in its
|
2019-04-06 00:39:50 +02:00
|
|
|
testcase.yaml.
|
|
|
|
|
2019-08-08 21:26:55 +02:00
|
|
|
config TEST_LOGGING_DEFAULTS
|
|
|
|
bool "Enable test case logging defaults"
|
|
|
|
depends on TEST
|
|
|
|
select LOG
|
2020-04-20 12:30:10 +02:00
|
|
|
imply LOG_MINIMAL
|
2019-08-08 21:26:55 +02:00
|
|
|
default y
|
|
|
|
help
|
|
|
|
Option which implements default policy of enabling logging in
|
2019-09-23 01:44:43 +02:00
|
|
|
minimal mode for all test cases. For tests that need alternate
|
2019-08-08 21:26:55 +02:00
|
|
|
logging configuration, or no logging at all, disable this
|
|
|
|
in the project-level defconfig.
|
|
|
|
|
2019-04-06 00:39:50 +02:00
|
|
|
config TEST_ENABLE_USERSPACE
|
|
|
|
bool
|
|
|
|
depends on TEST_USERSPACE
|
2018-03-19 09:47:55 +01:00
|
|
|
depends on ARCH_HAS_USERSPACE
|
|
|
|
select USERSPACE
|
2018-05-21 21:44:38 +02:00
|
|
|
select DYNAMIC_OBJECTS
|
|
|
|
default y
|
2018-03-19 09:47:55 +01:00
|
|
|
help
|
2019-05-22 01:09:35 +02:00
|
|
|
This hidden option implements the TEST_USERSPACE logic. It turns on
|
|
|
|
USERSPACE when CONFIG_ARCH_HAS_USERSPACE is set and the test
|
2019-04-06 00:39:50 +02:00
|
|
|
case itself indicates that it exercises user mode via
|
2019-04-07 15:02:37 +02:00
|
|
|
CONFIG_TEST_USERSPACE.
|
2018-05-25 07:14:20 +02:00
|
|
|
|
2019-08-26 12:44:03 +02:00
|
|
|
config TEST_USERSPACE_WITHOUT_HW_STACK_PROTECTION
|
|
|
|
bool "Run User Mode tests without additionally enabling stack protection"
|
|
|
|
depends on TEST_ENABLE_USERSPACE
|
2019-08-26 12:40:31 +02:00
|
|
|
default y if SOC_SERIES_KINETIS_KE1XF
|
2019-08-26 12:44:03 +02:00
|
|
|
help
|
|
|
|
A HW platform might not have sufficient MPU/MMU capabilities to support
|
|
|
|
running all test cases with User Mode and HW Stack Protection features
|
|
|
|
simultaneously enabled. For this platforms we execute the User Mode-
|
|
|
|
related tests without enabling HW stack protection.
|
|
|
|
|
2018-05-25 07:14:20 +02:00
|
|
|
config TEST_HW_STACK_PROTECTION
|
|
|
|
bool "Enable hardware-based stack overflow detection if available"
|
|
|
|
depends on ARCH_HAS_STACK_PROTECTION
|
|
|
|
depends on TEST
|
|
|
|
select HW_STACK_PROTECTION
|
2019-08-26 12:44:03 +02:00
|
|
|
default y if !TEST_USERSPACE_WITHOUT_HW_STACK_PROTECTION
|
2018-05-25 07:14:20 +02:00
|
|
|
help
|
|
|
|
This option will enable hardware-based stack protection by default
|
|
|
|
for all test cases if the hardware supports it.
|
2018-04-02 12:26:55 +02:00
|
|
|
|
|
|
|
config TEST_FLASH_DRIVERS
|
|
|
|
bool "Test flash drivers"
|
|
|
|
depends on BOARD_QEMU_X86
|
|
|
|
select FLASH_HAS_DRIVER_ENABLED
|
|
|
|
select FLASH_HAS_PAGE_LAYOUT
|
|
|
|
help
|
|
|
|
This option will help test the flash drivers. This should be enabled
|
|
|
|
only when using qemu_x86.
|
2019-03-18 15:03:35 +01:00
|
|
|
|
2019-08-08 14:56:53 +02:00
|
|
|
config TEST_ARM_CORTEX_M
|
|
|
|
bool
|
|
|
|
depends on CPU_CORTEX_M
|
|
|
|
default y
|
|
|
|
select ARM_SECURE_BUSFAULT_HARDFAULT_NMI if ARM_SECURE_FIRMWARE
|
|
|
|
help
|
|
|
|
ARM Cortex-M configuration required when testing.
|
|
|
|
|
|
|
|
Currently, this option is only utilized, to force routing
|
|
|
|
BusFault, HardFault, and NMI exceptions to Secure State,
|
|
|
|
when building a Secure ARMv8-M firmware. This will allow
|
|
|
|
the testing suite to utilize these exceptions, in tests.
|
|
|
|
Note that by default, when building with ARM_SECURE_FIRMWARE
|
|
|
|
set, these exceptions are set to target the Non-Secure state.
|
|
|
|
|
2016-08-22 13:51:46 +02:00
|
|
|
endmenu
|