blob: 4095a093a2769688f42cdb7f850d7d6ad221c312 [file] [log] [blame]
Jaakko Hannikainen9167a032016-08-22 14:51:46 +03001# Copyright (c) 2016 Intel Corporation
David B. Kinderac74d8b2017-01-18 17:01:01 -08002# SPDX-License-Identifier: Apache-2.0
Jaakko Hannikainen9167a032016-08-22 14:51:46 +03003
Ulf Magnusson9964cf22019-03-18 15:03:35 +01004menu "Testing"
Jaakko Hannikainen9167a032016-08-22 14:51:46 +03005
Anas Nashifccad9d02019-02-19 15:45:18 -05006source "subsys/testsuite/ztest/Kconfig"
Jaakko Hannikainen9167a032016-08-22 14:51:46 +03007
Anas Nashif829598b2018-01-06 16:15:53 -05008config TEST
9 bool "Mark project as a test"
Paul Sokolovsky2a798bb2019-03-13 22:56:51 +030010 # For tests, store thread names in binary and dump them on crash to
11 # ease debugging.
12 select THREAD_NAME
Anas Nashif829598b2018-01-06 16:15:53 -050013 help
14 Mark a project or an application as a test. This will enable a few
15 test defaults.
16
Anas Nashifcd910382018-10-18 10:06:01 -040017config TEST_SHELL
18 bool "Enable various shells for testing"
19 select GPIO_SHELL if GPIO
Anas Nashifcd910382018-10-18 10:06:01 -040020 help
21 Enable various platform and driver related shells for testing.
22
Mazen NEIFER47135752017-01-31 23:05:18 +010023config TEST_EXTRA_STACKSIZE
Ramakrishna Pallala275d16d2018-01-30 21:09:12 +053024 int "Test function extra thread stack size"
Wentong Wub9919622019-04-04 17:50:30 +080025 default 2048 if COVERAGE_GCOV
Mazen NEIFER47135752017-01-31 23:05:18 +010026 default 768 if XTENSA
Ulf Magnussonec3eff52018-07-30 10:57:47 +020027 default 0
Anas Nashifa2eaae52018-01-07 11:54:38 -050028 help
29 Additional stack for tests on some platform where default is not
30 enough.
Mazen NEIFER47135752017-01-31 23:05:18 +010031
Adithya Baglody76ee02b2018-08-31 15:13:36 +053032config HAS_COVERAGE_SUPPORT
33 bool
34 help
35 The code coverage report generation is only available on boards
Alberto Escolar Piedrasee3403a2019-02-11 16:44:51 +010036 with enough spare RAM to buffer the coverage data, or on boards
37 based on the POSIX ARCH.
Adithya Baglody76ee02b2018-08-31 15:13:36 +053038
Anas Nashif72fe0972017-11-22 08:28:52 -050039config COVERAGE
40 bool "Create coverage data"
Adithya Baglody76ee02b2018-08-31 15:13:36 +053041 depends on HAS_COVERAGE_SUPPORT
Anas Nashif72fe0972017-11-22 08:28:52 -050042 help
43 This option will build your application with the -coverage option
44 which will generate data that can be used to create coverage reports.
Alberto Escolar Piedras02ec7a02019-09-12 14:31:00 +020045 For more information see
46 https://docs.zephyrproject.org/latest/guides/coverage.html
Adithya Baglodya47f14a2018-03-19 14:17:55 +053047
Adithya Baglodye223cfa2018-08-29 17:31:46 +053048if COVERAGE
49config COVERAGE_GCOV
50 bool "Create Coverage data from hardware platform"
Adithya Baglodye223cfa2018-08-29 17:31:46 +053051 depends on !NATIVE_APPLICATION
52 default y
53 help
54 This option will select the custom gcov library. The reports will
55 be available over serial. This serial dump can be passed to
56 gen_gcov_files.py which creates the required .gcda files. These
57 can be read by gcov utility. For more details see gcovr.com .
58endif
59
Anas Nashif471ffbe2020-01-30 08:44:10 -050060config COVERAGE_DUMP
61 bool "Dump coverage data on exit"
62 depends on COVERAGE_GCOV
63 help
64 Dump collected coverage information to console on exit.
65
Adithya Baglodya47f14a2018-03-19 14:17:55 +053066config TEST_USERSPACE
Andrew Boie7b1ee5c2019-04-05 15:39:50 -070067 bool "Indicate that this test exercises user mode"
68 help
69 This option indicates that a test case puts threads in user mode,
Marc Herbert4afcc0f2019-05-21 16:09:35 -070070 and that the build system will [override and] enable USERSPACE
71 if the platform supports it. It should be set in a .conf file on
72 a per-test basis and is not meant to be used outside test cases.
73 Tests with this option should also have the "userspace" filtering
74 tag in their testcase.yaml file.
Andrew Boie7b1ee5c2019-04-05 15:39:50 -070075
76 The userspace APIs are no-ops if userspace is not enabled, so it is
77 OK to enable this even if the test will run on platforms which do
78 not support userspace. The test should still run on those platforms,
79 just with all threads in supervisor mode.
80
81 If a test *requires* that userspace be enabled in order to
Marc Herbert4afcc0f2019-05-21 16:09:35 -070082 pass, CONFIG_ARCH_HAS_USERSPACE should be filtered in its
Andrew Boie7b1ee5c2019-04-05 15:39:50 -070083 testcase.yaml.
84
Andrew Boie21924992019-08-08 12:26:55 -070085config TEST_LOGGING_DEFAULTS
86 bool "Enable test case logging defaults"
87 depends on TEST
88 select LOG
Andrew Boie7e29c9d2019-09-22 16:44:43 -070089 select LOG_MINIMAL
Andrew Boie21924992019-08-08 12:26:55 -070090 default y
91 help
92 Option which implements default policy of enabling logging in
Andrew Boie7e29c9d2019-09-22 16:44:43 -070093 minimal mode for all test cases. For tests that need alternate
Andrew Boie21924992019-08-08 12:26:55 -070094 logging configuration, or no logging at all, disable this
95 in the project-level defconfig.
96
Andrew Boie7b1ee5c2019-04-05 15:39:50 -070097config TEST_ENABLE_USERSPACE
98 bool
99 depends on TEST_USERSPACE
Adithya Baglodya47f14a2018-03-19 14:17:55 +0530100 depends on ARCH_HAS_USERSPACE
101 select USERSPACE
Andrew Boieefe0c4b2018-05-21 12:44:38 -0700102 select DYNAMIC_OBJECTS
103 default y
Adithya Baglodya47f14a2018-03-19 14:17:55 +0530104 help
Marc Herbert4afcc0f2019-05-21 16:09:35 -0700105 This hidden option implements the TEST_USERSPACE logic. It turns on
106 USERSPACE when CONFIG_ARCH_HAS_USERSPACE is set and the test
Andrew Boie7b1ee5c2019-04-05 15:39:50 -0700107 case itself indicates that it exercises user mode via
Anas Nashif073e0172019-04-07 09:02:37 -0400108 CONFIG_TEST_USERSPACE.
Andrew Boieba2c44e2018-05-24 22:14:20 -0700109
Ioannis Glaropoulos912c5582019-08-26 12:44:03 +0200110config TEST_USERSPACE_WITHOUT_HW_STACK_PROTECTION
111 bool "Run User Mode tests without additionally enabling stack protection"
112 depends on TEST_ENABLE_USERSPACE
Ioannis Glaropoulos861fc232019-08-26 12:40:31 +0200113 default y if SOC_SERIES_KINETIS_KE1XF
Ioannis Glaropoulos912c5582019-08-26 12:44:03 +0200114 help
115 A HW platform might not have sufficient MPU/MMU capabilities to support
116 running all test cases with User Mode and HW Stack Protection features
117 simultaneously enabled. For this platforms we execute the User Mode-
118 related tests without enabling HW stack protection.
119
Andrew Boieba2c44e2018-05-24 22:14:20 -0700120config TEST_HW_STACK_PROTECTION
121 bool "Enable hardware-based stack overflow detection if available"
122 depends on ARCH_HAS_STACK_PROTECTION
123 depends on TEST
124 select HW_STACK_PROTECTION
Ioannis Glaropoulos912c5582019-08-26 12:44:03 +0200125 default y if !TEST_USERSPACE_WITHOUT_HW_STACK_PROTECTION
Andrew Boieba2c44e2018-05-24 22:14:20 -0700126 help
127 This option will enable hardware-based stack protection by default
128 for all test cases if the hardware supports it.
Adithya Baglody43775402018-04-02 15:56:55 +0530129
130config TEST_FLASH_DRIVERS
131 bool "Test flash drivers"
132 depends on BOARD_QEMU_X86
133 select FLASH_HAS_DRIVER_ENABLED
134 select FLASH_HAS_PAGE_LAYOUT
Adithya Baglody43775402018-04-02 15:56:55 +0530135 help
136 This option will help test the flash drivers. This should be enabled
137 only when using qemu_x86.
Ulf Magnusson9964cf22019-03-18 15:03:35 +0100138
Ioannis Glaropoulosa3ee56f2019-08-08 14:56:53 +0200139config TEST_ARM_CORTEX_M
140 bool
141 depends on CPU_CORTEX_M
142 default y
143 select ARM_SECURE_BUSFAULT_HARDFAULT_NMI if ARM_SECURE_FIRMWARE
144 help
145 ARM Cortex-M configuration required when testing.
146
147 Currently, this option is only utilized, to force routing
148 BusFault, HardFault, and NMI exceptions to Secure State,
149 when building a Secure ARMv8-M firmware. This will allow
150 the testing suite to utilize these exceptions, in tests.
151 Note that by default, when building with ARM_SECURE_FIRMWARE
152 set, these exceptions are set to target the Non-Secure state.
153
Jaakko Hannikainen9167a032016-08-22 14:51:46 +0300154endmenu