Jaakko Hannikainen | 9167a03 | 2016-08-22 14:51:46 +0300 | [diff] [blame] | 1 | # Copyright (c) 2016 Intel Corporation |
David B. Kinder | ac74d8b | 2017-01-18 17:01:01 -0800 | [diff] [blame] | 2 | # SPDX-License-Identifier: Apache-2.0 |
Jaakko Hannikainen | 9167a03 | 2016-08-22 14:51:46 +0300 | [diff] [blame] | 3 | |
Ulf Magnusson | 9964cf2 | 2019-03-18 15:03:35 +0100 | [diff] [blame] | 4 | menu "Testing" |
Jaakko Hannikainen | 9167a03 | 2016-08-22 14:51:46 +0300 | [diff] [blame] | 5 | |
Anas Nashif | ccad9d0 | 2019-02-19 15:45:18 -0500 | [diff] [blame] | 6 | source "subsys/testsuite/ztest/Kconfig" |
Jaakko Hannikainen | 9167a03 | 2016-08-22 14:51:46 +0300 | [diff] [blame] | 7 | |
Anas Nashif | 829598b | 2018-01-06 16:15:53 -0500 | [diff] [blame] | 8 | config TEST |
| 9 | bool "Mark project as a test" |
Paul Sokolovsky | 2a798bb | 2019-03-13 22:56:51 +0300 | [diff] [blame] | 10 | # For tests, store thread names in binary and dump them on crash to |
| 11 | # ease debugging. |
| 12 | select THREAD_NAME |
Anas Nashif | 829598b | 2018-01-06 16:15:53 -0500 | [diff] [blame] | 13 | help |
| 14 | Mark a project or an application as a test. This will enable a few |
| 15 | test defaults. |
| 16 | |
Carles Cufi | e83a13a | 2022-02-17 17:09:09 +0100 | [diff] [blame] | 17 | config TEST_EXTRA_STACK_SIZE |
Ramakrishna Pallala | 275d16d | 2018-01-30 21:09:12 +0530 | [diff] [blame] | 18 | int "Test function extra thread stack size" |
Wentong Wu | b991962 | 2019-04-04 17:50:30 +0800 | [diff] [blame] | 19 | default 2048 if COVERAGE_GCOV |
Mazen NEIFER | 4713575 | 2017-01-31 23:05:18 +0100 | [diff] [blame] | 20 | default 768 if XTENSA |
Ulf Magnusson | ec3eff5 | 2018-07-30 10:57:47 +0200 | [diff] [blame] | 21 | default 0 |
Anas Nashif | d60e312 | 2022-08-02 09:03:56 -0400 | [diff] [blame] | 22 | depends on TEST |
Anas Nashif | a2eaae5 | 2018-01-07 11:54:38 -0500 | [diff] [blame] | 23 | help |
| 24 | Additional stack for tests on some platform where default is not |
| 25 | enough. |
Mazen NEIFER | 4713575 | 2017-01-31 23:05:18 +0100 | [diff] [blame] | 26 | |
Adithya Baglody | 76ee02b | 2018-08-31 15:13:36 +0530 | [diff] [blame] | 27 | config HAS_COVERAGE_SUPPORT |
| 28 | bool |
| 29 | help |
| 30 | The code coverage report generation is only available on boards |
Alberto Escolar Piedras | ee3403a | 2019-02-11 16:44:51 +0100 | [diff] [blame] | 31 | with enough spare RAM to buffer the coverage data, or on boards |
| 32 | based on the POSIX ARCH. |
Adithya Baglody | 76ee02b | 2018-08-31 15:13:36 +0530 | [diff] [blame] | 33 | |
Anas Nashif | 72fe097 | 2017-11-22 08:28:52 -0500 | [diff] [blame] | 34 | config COVERAGE |
| 35 | bool "Create coverage data" |
Adithya Baglody | 76ee02b | 2018-08-31 15:13:36 +0530 | [diff] [blame] | 36 | depends on HAS_COVERAGE_SUPPORT |
Anas Nashif | 72fe097 | 2017-11-22 08:28:52 -0500 | [diff] [blame] | 37 | help |
| 38 | This option will build your application with the -coverage option |
| 39 | which will generate data that can be used to create coverage reports. |
Alberto Escolar Piedras | 02ec7a0 | 2019-09-12 14:31:00 +0200 | [diff] [blame] | 40 | For more information see |
| 41 | https://docs.zephyrproject.org/latest/guides/coverage.html |
Adithya Baglody | a47f14a | 2018-03-19 14:17:55 +0530 | [diff] [blame] | 42 | |
Adithya Baglody | e223cfa | 2018-08-29 17:31:46 +0530 | [diff] [blame] | 43 | config COVERAGE_GCOV |
| 44 | bool "Create Coverage data from hardware platform" |
Adithya Baglody | e223cfa | 2018-08-29 17:31:46 +0530 | [diff] [blame] | 45 | default y |
Ulf Magnusson | eddd98f | 2020-02-08 03:45:50 +0100 | [diff] [blame] | 46 | depends on COVERAGE |
| 47 | depends on !NATIVE_APPLICATION |
Adithya Baglody | e223cfa | 2018-08-29 17:31:46 +0530 | [diff] [blame] | 48 | help |
| 49 | This option will select the custom gcov library. The reports will |
| 50 | be available over serial. This serial dump can be passed to |
| 51 | gen_gcov_files.py which creates the required .gcda files. These |
| 52 | can be read by gcov utility. For more details see gcovr.com . |
Adithya Baglody | e223cfa | 2018-08-29 17:31:46 +0530 | [diff] [blame] | 53 | |
Anas Nashif | 471ffbe | 2020-01-30 08:44:10 -0500 | [diff] [blame] | 54 | config COVERAGE_DUMP |
| 55 | bool "Dump coverage data on exit" |
| 56 | depends on COVERAGE_GCOV |
| 57 | help |
| 58 | Dump collected coverage information to console on exit. |
| 59 | |
Adithya Baglody | a47f14a | 2018-03-19 14:17:55 +0530 | [diff] [blame] | 60 | config TEST_USERSPACE |
Andrew Boie | 7b1ee5c | 2019-04-05 15:39:50 -0700 | [diff] [blame] | 61 | bool "Indicate that this test exercises user mode" |
| 62 | help |
| 63 | This option indicates that a test case puts threads in user mode, |
Marc Herbert | 4afcc0f | 2019-05-21 16:09:35 -0700 | [diff] [blame] | 64 | and that the build system will [override and] enable USERSPACE |
| 65 | if the platform supports it. It should be set in a .conf file on |
| 66 | a per-test basis and is not meant to be used outside test cases. |
| 67 | Tests with this option should also have the "userspace" filtering |
| 68 | tag in their testcase.yaml file. |
Andrew Boie | 7b1ee5c | 2019-04-05 15:39:50 -0700 | [diff] [blame] | 69 | |
| 70 | The userspace APIs are no-ops if userspace is not enabled, so it is |
| 71 | OK to enable this even if the test will run on platforms which do |
| 72 | not support userspace. The test should still run on those platforms, |
| 73 | just with all threads in supervisor mode. |
| 74 | |
| 75 | If a test *requires* that userspace be enabled in order to |
Marc Herbert | 4afcc0f | 2019-05-21 16:09:35 -0700 | [diff] [blame] | 76 | pass, CONFIG_ARCH_HAS_USERSPACE should be filtered in its |
Andrew Boie | 7b1ee5c | 2019-04-05 15:39:50 -0700 | [diff] [blame] | 77 | testcase.yaml. |
| 78 | |
Andrew Boie | 2192499 | 2019-08-08 12:26:55 -0700 | [diff] [blame] | 79 | config TEST_LOGGING_DEFAULTS |
Gerard Marull-Paretas | 95fb0de | 2022-03-09 12:05:12 +0100 | [diff] [blame] | 80 | bool "Test case logging defaults" |
Andrew Boie | 2192499 | 2019-08-08 12:26:55 -0700 | [diff] [blame] | 81 | depends on TEST |
| 82 | select LOG |
Krzysztof Chruscinski | c0808e3 | 2021-11-19 07:59:23 +0100 | [diff] [blame] | 83 | select LOG_DEFAULT_MINIMAL |
Andrew Boie | 2192499 | 2019-08-08 12:26:55 -0700 | [diff] [blame] | 84 | default y |
| 85 | help |
| 86 | Option which implements default policy of enabling logging in |
Andrew Boie | 7e29c9d | 2019-09-22 16:44:43 -0700 | [diff] [blame] | 87 | minimal mode for all test cases. For tests that need alternate |
Andrew Boie | 2192499 | 2019-08-08 12:26:55 -0700 | [diff] [blame] | 88 | logging configuration, or no logging at all, disable this |
| 89 | in the project-level defconfig. |
| 90 | |
Andrew Boie | 7b1ee5c | 2019-04-05 15:39:50 -0700 | [diff] [blame] | 91 | config TEST_ENABLE_USERSPACE |
| 92 | bool |
| 93 | depends on TEST_USERSPACE |
Adithya Baglody | a47f14a | 2018-03-19 14:17:55 +0530 | [diff] [blame] | 94 | depends on ARCH_HAS_USERSPACE |
| 95 | select USERSPACE |
Andrew Boie | efe0c4b | 2018-05-21 12:44:38 -0700 | [diff] [blame] | 96 | select DYNAMIC_OBJECTS |
| 97 | default y |
Adithya Baglody | a47f14a | 2018-03-19 14:17:55 +0530 | [diff] [blame] | 98 | help |
Marc Herbert | 4afcc0f | 2019-05-21 16:09:35 -0700 | [diff] [blame] | 99 | This hidden option implements the TEST_USERSPACE logic. It turns on |
| 100 | USERSPACE when CONFIG_ARCH_HAS_USERSPACE is set and the test |
Andrew Boie | 7b1ee5c | 2019-04-05 15:39:50 -0700 | [diff] [blame] | 101 | case itself indicates that it exercises user mode via |
Anas Nashif | 073e017 | 2019-04-07 09:02:37 -0400 | [diff] [blame] | 102 | CONFIG_TEST_USERSPACE. |
Andrew Boie | ba2c44e | 2018-05-24 22:14:20 -0700 | [diff] [blame] | 103 | |
Ioannis Glaropoulos | 912c558 | 2019-08-26 12:44:03 +0200 | [diff] [blame] | 104 | config TEST_USERSPACE_WITHOUT_HW_STACK_PROTECTION |
| 105 | bool "Run User Mode tests without additionally enabling stack protection" |
| 106 | depends on TEST_ENABLE_USERSPACE |
Ioannis Glaropoulos | 861fc23 | 2019-08-26 12:40:31 +0200 | [diff] [blame] | 107 | default y if SOC_SERIES_KINETIS_KE1XF |
Ioannis Glaropoulos | 912c558 | 2019-08-26 12:44:03 +0200 | [diff] [blame] | 108 | help |
| 109 | A HW platform might not have sufficient MPU/MMU capabilities to support |
| 110 | running all test cases with User Mode and HW Stack Protection features |
| 111 | simultaneously enabled. For this platforms we execute the User Mode- |
| 112 | related tests without enabling HW stack protection. |
| 113 | |
Andrew Boie | ba2c44e | 2018-05-24 22:14:20 -0700 | [diff] [blame] | 114 | config TEST_HW_STACK_PROTECTION |
Gerard Marull-Paretas | 95fb0de | 2022-03-09 12:05:12 +0100 | [diff] [blame] | 115 | bool "Hardware-based stack overflow detection if available" |
Andrew Boie | ba2c44e | 2018-05-24 22:14:20 -0700 | [diff] [blame] | 116 | depends on ARCH_HAS_STACK_PROTECTION |
| 117 | depends on TEST |
| 118 | select HW_STACK_PROTECTION |
Ioannis Glaropoulos | 912c558 | 2019-08-26 12:44:03 +0200 | [diff] [blame] | 119 | default y if !TEST_USERSPACE_WITHOUT_HW_STACK_PROTECTION |
Andrew Boie | ba2c44e | 2018-05-24 22:14:20 -0700 | [diff] [blame] | 120 | help |
| 121 | This option will enable hardware-based stack protection by default |
| 122 | for all test cases if the hardware supports it. |
Adithya Baglody | 4377540 | 2018-04-02 15:56:55 +0530 | [diff] [blame] | 123 | |
| 124 | config TEST_FLASH_DRIVERS |
| 125 | bool "Test flash drivers" |
| 126 | depends on BOARD_QEMU_X86 |
| 127 | select FLASH_HAS_DRIVER_ENABLED |
| 128 | select FLASH_HAS_PAGE_LAYOUT |
Adithya Baglody | 4377540 | 2018-04-02 15:56:55 +0530 | [diff] [blame] | 129 | help |
| 130 | This option will help test the flash drivers. This should be enabled |
| 131 | only when using qemu_x86. |
Ulf Magnusson | 9964cf2 | 2019-03-18 15:03:35 +0100 | [diff] [blame] | 132 | |
Ioannis Glaropoulos | a3ee56f | 2019-08-08 14:56:53 +0200 | [diff] [blame] | 133 | config TEST_ARM_CORTEX_M |
| 134 | bool |
| 135 | depends on CPU_CORTEX_M |
Ioannis Glaropoulos | 1d55f94 | 2021-02-21 17:25:59 +0100 | [diff] [blame] | 136 | depends on TEST |
Ioannis Glaropoulos | a3ee56f | 2019-08-08 14:56:53 +0200 | [diff] [blame] | 137 | default y |
| 138 | select ARM_SECURE_BUSFAULT_HARDFAULT_NMI if ARM_SECURE_FIRMWARE |
| 139 | help |
| 140 | ARM Cortex-M configuration required when testing. |
| 141 | |
| 142 | Currently, this option is only utilized, to force routing |
| 143 | BusFault, HardFault, and NMI exceptions to Secure State, |
| 144 | when building a Secure ARMv8-M firmware. This will allow |
| 145 | the testing suite to utilize these exceptions, in tests. |
| 146 | Note that by default, when building with ARM_SECURE_FIRMWARE |
| 147 | set, these exceptions are set to target the Non-Secure state. |
Krzysztof Chruscinski | ffc4a6c | 2021-06-29 18:32:19 +0200 | [diff] [blame] | 148 | |
| 149 | config TEST_BUSY_SIM |
Gerard Marull-Paretas | 95fb0de | 2022-03-09 12:05:12 +0100 | [diff] [blame] | 150 | bool "Busy simulator" |
Krzysztof Chruscinski | ffc4a6c | 2021-06-29 18:32:19 +0200 | [diff] [blame] | 151 | depends on TEST |
| 152 | select ENTROPY_GENERATOR |
Krzysztof Chruscinski | 0a7667b | 2021-10-25 09:25:31 +0200 | [diff] [blame] | 153 | select RING_BUFFER if !XOSHIRO_RANDOM_GENERATOR |
Krzysztof Chruscinski | ffc4a6c | 2021-06-29 18:32:19 +0200 | [diff] [blame] | 154 | select COUNTER |
| 155 | help |
| 156 | It simulates cpu load by using counter device to generate interrupts |
| 157 | with random intervals and random busy looping in the interrupt. |
| 158 | |
Jaakko Hannikainen | 9167a03 | 2016-08-22 14:51:46 +0300 | [diff] [blame] | 159 | endmenu |