Add Google style guideline check tool: cpplint
This commit is contained in:
parent
488ab8c754
commit
506c740d81
4 changed files with 3379 additions and 0 deletions
|
@ -108,6 +108,7 @@ ENDIF (UNIX)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES( ${telldus-core_TARGET} ${telldus-core_LIBRARIES} )
|
TARGET_LINK_LIBRARIES( ${telldus-core_TARGET} ${telldus-core_LIBRARIES} )
|
||||||
|
|
||||||
|
SET(telldus-core_TARGET ${telldus-core_TARGET} PARENT_SCOPE)
|
||||||
SET_TARGET_PROPERTIES(${telldus-core_TARGET} PROPERTIES
|
SET_TARGET_PROPERTIES(${telldus-core_TARGET} PROPERTIES
|
||||||
FRAMEWORK TRUE
|
FRAMEWORK TRUE
|
||||||
INSTALL_NAME_DIR "/Library/Frameworks"
|
INSTALL_NAME_DIR "/Library/Frameworks"
|
||||||
|
|
|
@ -186,6 +186,7 @@ ENDIF (FTDI_ENGINE STREQUAL "ftd2xx")
|
||||||
|
|
||||||
SOURCE_GROUP("Protocol Files" FILES ${telldus-service_protocol_SRCS})
|
SOURCE_GROUP("Protocol Files" FILES ${telldus-service_protocol_SRCS})
|
||||||
|
|
||||||
|
SET(telldus-service_TARGET ${telldus-service_TARGET} PARENT_SCOPE)
|
||||||
ADD_EXECUTABLE(${telldus-service_TARGET}
|
ADD_EXECUTABLE(${telldus-service_TARGET}
|
||||||
${telldus-service_SRCS}
|
${telldus-service_SRCS}
|
||||||
${telldus-service_protocol_SRCS}
|
${telldus-service_protocol_SRCS}
|
||||||
|
|
|
@ -1,5 +1,17 @@
|
||||||
SET(ENABLE_TESTING FALSE CACHE BOOL "Enable unit tests")
|
SET(ENABLE_TESTING FALSE CACHE BOOL "Enable unit tests")
|
||||||
|
|
||||||
|
SET(cpplint_filters
|
||||||
|
-whitespace/tab,-whitespace/parens,-whitespace/line_length,-whitespace/labels
|
||||||
|
)
|
||||||
|
|
||||||
|
FUNCTION(ADD_SOURCES TARGET PATH)
|
||||||
|
GET_TARGET_PROPERTY(SOURCES ${TARGET} SOURCES)
|
||||||
|
FOREACH(SOURCE ${SOURCES})
|
||||||
|
LIST(APPEND L ${PATH}/${SOURCE})
|
||||||
|
ENDFOREACH()
|
||||||
|
ADD_TEST(StyleGuidelines-${TARGET} ${CMAKE_CURRENT_SOURCE_DIR}/cpplint.py --filter=${cpplint_filters} ${L})
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
||||||
IF(ENABLE_TESTING)
|
IF(ENABLE_TESTING)
|
||||||
ADD_SUBDIRECTORY(common)
|
ADD_SUBDIRECTORY(common)
|
||||||
|
|
||||||
|
@ -7,6 +19,10 @@ IF(ENABLE_TESTING)
|
||||||
TARGET_LINK_LIBRARIES(TestRunner cppunit TelldusCommonTests)
|
TARGET_LINK_LIBRARIES(TestRunner cppunit TelldusCommonTests)
|
||||||
ADD_DEPENDENCIES(TestRunner TelldusCommonTests)
|
ADD_DEPENDENCIES(TestRunner TelldusCommonTests)
|
||||||
|
|
||||||
|
ADD_SOURCES(TelldusCommon ${CMAKE_SOURCE_DIR}/common)
|
||||||
|
ADD_SOURCES(${telldus-core_TARGET} ${CMAKE_SOURCE_DIR}/client)
|
||||||
|
ADD_SOURCES(${telldus-service_TARGET} ${CMAKE_SOURCE_DIR}/service)
|
||||||
|
|
||||||
ADD_TEST(cppunit ${CMAKE_CURRENT_BINARY_DIR}/TestRunner)
|
ADD_TEST(cppunit ${CMAKE_CURRENT_BINARY_DIR}/TestRunner)
|
||||||
IF (UNIX AND NOT APPLE)
|
IF (UNIX AND NOT APPLE)
|
||||||
ADD_TEST(cppcheck cppcheck --quiet --error-exitcode=2 ${CMAKE_SOURCE_DIR})
|
ADD_TEST(cppcheck cppcheck --quiet --error-exitcode=2 ${CMAKE_SOURCE_DIR})
|
||||||
|
|
3361
telldus-core/tests/cpplint.py
vendored
Executable file
3361
telldus-core/tests/cpplint.py
vendored
Executable file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue