1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-16 04:05:46 +00:00

Extend clang-tidy checking to tests and utils

This commit is contained in:
Carles Fernandez 2019-02-21 11:42:56 +01:00
parent 78afe4834d
commit b617213784
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
6 changed files with 62 additions and 1 deletions

View File

@ -404,6 +404,14 @@ if(ENABLE_UNIT_TESTING)
)
endif()
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(run_tests
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
if(ENABLE_CUDA)
target_link_libraries(run_tests
PUBLIC
@ -476,6 +484,14 @@ function(add_system_test executable)
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${executable}>
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:${executable}>)
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(${executable}
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
endfunction()

View File

@ -2003,7 +2003,7 @@ void Gnuplot::init()
// whose name is specified as argument. If the requested variable is not
// part of the environment list, the function returns a NULL pointer.
#if (defined(unix) || defined(__unix) || defined(__unix__)) && !defined(__APPLE__)
if (std::getenv("DISPLAY") == NULL)
if (std::getenv("DISPLAY") == nullptr)
{
valid = false;
throw GnuplotException("Can't find DISPLAY variable");

View File

@ -41,6 +41,15 @@ target_link_libraries(system_testing_lib
Matio::matio
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(system_testing_lib
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET system_testing_lib
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

View File

@ -48,6 +48,15 @@ target_link_libraries(signal_processing_testing_lib
Glog::glog
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(signal_processing_testing_lib
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
set_property(TARGET signal_processing_testing_lib
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

View File

@ -46,6 +46,15 @@ target_link_libraries(front_end_cal_lib
Boost::thread
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(front_end_cal_lib
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
add_executable(front-end-cal ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
target_link_libraries(front-end-cal
@ -65,6 +74,15 @@ target_compile_definitions(front-end-cal
PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(front-end-cal
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
add_custom_command(TARGET front-end-cal POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:front-end-cal>
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:front-end-cal>)

View File

@ -86,6 +86,15 @@ if(Boost_FOUND)
add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(rinex2assist
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
add_custom_command(TARGET rinex2assist POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:rinex2assist>
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:rinex2assist>