File tree Expand file tree Collapse file tree 6 files changed +24
-0
lines changed Expand file tree Collapse file tree 6 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -704,6 +704,14 @@ endif()
704704
705705if (CONFIG_ZTEST)
706706 list (APPEND SYSCALL_INCLUDE_DIRS ${ZEPHYR_BASE} /subsys/testsuite/ztest/include )
707+
708+ if (CONFIG_NO_OPTIMIZATIONS AND NOT CONFIG_ZTEST_ALLOW_NO_OPTIMIZATIONS)
709+ message (FATAL_ERROR "Running tests with CONFIG_NO_OPTIMIZATIONS is not "
710+ "supported and known to break many tests, please do not file issues about "
711+ "it. If you really mean to do this also enable "
712+ "CONFIG_ZTEST_ALLOW_NO_OPTIMIZATIONS." )
713+ endif ()
714+
707715endif ()
708716
709717foreach (d ${SYSCALL_INCLUDE_DIRS} )
Original file line number Diff line number Diff line change @@ -103,6 +103,14 @@ config ZTEST_NO_YIELD
103103 yielding to the idle thread may put the board into a low power state
104104 where a debugger cannot connect to it.
105105
106+ config ZTEST_ALLOW_NO_OPTIMIZATIONS
107+ bool "Allow running tests with CONFIG_NO_OPTIMIZATIONS"
108+ depends on NO_OPTIMIZATIONS
109+ help
110+ Do not error out when building a test without compiler optimization.
111+ This is normally not supported, please don't file issues when running
112+ tests that are not explicitly tuned to work in this configuration.
113+
106114if ZTEST_NEW_API
107115
108116menu "ztest provided rules"
Original file line number Diff line number Diff line change 1313 filter : not CONFIG_TRUSTED_EXECUTION_NONSECURE
1414 extra_configs :
1515 - CONFIG_NO_OPTIMIZATIONS=y
16+ - CONFIG_ZTEST_ALLOW_NO_OPTIMIZATIONS=y
1617 - CONFIG_IDLE_STACK_SIZE=512
1718 - CONFIG_MAIN_STACK_SIZE=2048
1819 arch.interrupt.extra_exception_info :
Original file line number Diff line number Diff line change 1111 filter : not CONFIG_TRUSTED_EXECUTION_NONSECURE
1212 extra_configs :
1313 - CONFIG_NO_OPTIMIZATIONS=y
14+ - CONFIG_ZTEST_ALLOW_NO_OPTIMIZATIONS=y
1415 - CONFIG_IDLE_STACK_SIZE=512
1516 - CONFIG_MAIN_STACK_SIZE=2048
1617 min_flash : 192
2526 - CONFIG_FPU=y
2627 - CONFIG_FPU_SHARING=y
2728 - CONFIG_NO_OPTIMIZATIONS=y
29+ - CONFIG_ZTEST_ALLOW_NO_OPTIMIZATIONS=y
2830 - CONFIG_IDLE_STACK_SIZE=512
2931 - CONFIG_MAIN_STACK_SIZE=2048
3032 min_flash : 192
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ CONFIG_ZTEST=y
22CONFIG_ZTEST_NEW_API=y
33CONFIG_GEN_IRQ_VECTOR_TABLE=y
44CONFIG_DYNAMIC_INTERRUPTS=y
5+ CONFIG_ZTEST_ALLOW_NO_OPTIMIZATIONS=y
Original file line number Diff line number Diff line change 1616 extra_configs :
1717 - CONFIG_LOG_MODE_DEFERRED=y
1818 - CONFIG_NO_OPTIMIZATIONS=y
19+ - CONFIG_ZTEST_ALLOW_NO_OPTIMIZATIONS=y
1920 - CONFIG_IDLE_STACK_SIZE=2048
2021 logging.log_stack_immediate :
2122 extra_configs :
2526 extra_configs :
2627 - CONFIG_LOG_MODE_IMMEDIATE=y
2728 - CONFIG_NO_OPTIMIZATIONS=y
29+ - CONFIG_ZTEST_ALLOW_NO_OPTIMIZATIONS=y
2830 - CONFIG_IDLE_STACK_SIZE=2048
2931 logging.log_stack_deferred_cpp :
3032 extra_configs :
3537 extra_configs :
3638 - CONFIG_LOG_MODE_DEFERRED=y
3739 - CONFIG_NO_OPTIMIZATIONS=y
40+ - CONFIG_ZTEST_ALLOW_NO_OPTIMIZATIONS=y
3841 - CONFIG_CPP=y
3942 logging.log_stack_immediate_cpp :
4043 extra_configs :
4548 extra_configs :
4649 - CONFIG_LOG_MODE_IMMEDIATE=y
4750 - CONFIG_NO_OPTIMIZATIONS=y
51+ - CONFIG_ZTEST_ALLOW_NO_OPTIMIZATIONS=y
4852 - CONFIG_CPP=y
You can’t perform that action at this time.
0 commit comments