Skip to content

Commit

Permalink
unit-test CMake: Remove compile_options(-O0 -Wno-div-by-zero)
Browse files Browse the repository at this point in the history
Let's not override optimization options: This is surprising when
the cmake user tries to set CMAKE_BUILD_TYPE=(Debug|Release)'.

The -Wno-div-by-zero warning disabling seems obsolete:
Replacing it with -Werror did not fail, at least with Gcc 13.
  • Loading branch information
anordal committed Jun 4, 2024
1 parent 02a4c05 commit 28d5fa8
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/unit-test/FreeRTOS_DNS/ut.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ list(APPEND mock_define_list

# ================= Create the library under test here (edit) ==================

add_compile_options(-Wno-pedantic -Wno-div-by-zero -O0 -ggdb3)
add_compile_options(-Wno-pedantic -ggdb3)
# list the files you would like to test here
set(real_source_files "")
list(APPEND real_source_files
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/FreeRTOS_DNS_Cache/ut.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ list(APPEND mock_define_list

# ================= Create the library under test here (edit) ==================

add_compile_options(-Wno-pedantic -Wno-div-by-zero -O0 -ggdb3)
add_compile_options(-Wno-pedantic -ggdb3)
# list the files you would like to test here
set(real_source_files ""
)
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/FreeRTOS_DNS_Callback/ut.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ list(APPEND mock_define_list

# ================= Create the library under test here (edit) ==================

add_compile_options(-Wno-pedantic -Wno-div-by-zero -O0 -ggdb3)
add_compile_options(-Wno-pedantic -ggdb3)
# list the files you would like to test here
set(real_source_files "")
list(APPEND real_source_files
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/FreeRTOS_DNS_ConfigNoCallback/ut.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ list(APPEND mock_define_list

# ================= Create the library under test here (edit) ==================

add_compile_options(-Wno-pedantic -Wno-div-by-zero -O0 -ggdb3)
add_compile_options(-Wno-pedantic -ggdb3)
# list the files you would like to test here
set(real_source_files "")
list(APPEND real_source_files
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/FreeRTOS_DNS_Networking/ut.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ list(APPEND mock_define_list

# ================= Create the library under test here (edit) ==================

add_compile_options(-Wno-pedantic -Wno-div-by-zero -O0 -ggdb3)
add_compile_options(-Wno-pedantic -ggdb3)
# list the files you would like to test here
set(real_source_files ""
)
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/FreeRTOS_DNS_Parser/ut.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ list(APPEND mock_define_list

# ================= Create the library under test here (edit) ==================

add_compile_options(-Wno-pedantic -Wno-div-by-zero -O0 -ggdb3)
add_compile_options(-Wno-pedantic -ggdb3)
# list the files you would like to test here
set(real_source_files ""
)
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/FreeRTOS_TCP_WIN/ut.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ list(APPEND mock_define_list

# ================= Create the library under test here (edit) ==================

add_compile_options(-Wno-pedantic -Wno-div-by-zero -O0 -ggdb3)
add_compile_options(-Wno-pedantic -ggdb3)
# list the files you would like to test here
set(real_source_files "")
list(APPEND real_source_files
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/FreeRTOS_Tiny_TCP/ut.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ list(APPEND mock_define_list

# ================= Create the library under test here (edit) ==================

add_compile_options(-Wno-pedantic -Wno-div-by-zero -O0 -ggdb3)
add_compile_options(-Wno-pedantic -ggdb3)
# list the files you would like to test here
set(real_source_files "")
list(APPEND real_source_files
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/cmock/create_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function(create_test test_name
)
add_executable(${test_name} ${test_src} ${test_name}_runner.c)
set_target_properties(${test_name} PROPERTIES
COMPILE_FLAG "-Wall -O0 -ggdb"
COMPILE_FLAG "-Wall -ggdb3"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/tests"
INSTALL_RPATH_USE_LINK_PATH TRUE
LINK_FLAGS " \
Expand Down

0 comments on commit 28d5fa8

Please sign in to comment.