Clang-tidy test.
This commit is contained in:
parent
56fb165029
commit
d6e56ae4b5
|
@ -12,7 +12,7 @@ set(HAL_SOURCE_PATH "${CMAKE_SOURCE_DIR_IPCSDK}/hal")
|
||||||
set(TEST_SOURCE_PATH "${CMAKE_SOURCE_DIR_IPCSDK}/test")
|
set(TEST_SOURCE_PATH "${CMAKE_SOURCE_DIR_IPCSDK}/test")
|
||||||
set(EXTERNAL_SOURCE_PATH "${CMAKE_SOURCE_DIR_IPCSDK}/external")
|
set(EXTERNAL_SOURCE_PATH "${CMAKE_SOURCE_DIR_IPCSDK}/external")
|
||||||
|
|
||||||
set(CLANG_TIDY_CHECKS "-*\
|
set(CLANG_TIDY_CHECKS "-*,\
|
||||||
llvm-else-after-return,\
|
llvm-else-after-return,\
|
||||||
llvm-header-guard,\
|
llvm-header-guard,\
|
||||||
llvm-include-order,\
|
llvm-include-order,\
|
||||||
|
|
|
@ -26,3 +26,24 @@ add_library(${ABSTRACT_TARGET} STATIC ${ABSTRACT_FILES})
|
||||||
target_link_libraries(${ABSTRACT_TARGET} ReturnCode)
|
target_link_libraries(${ABSTRACT_TARGET} ReturnCode)
|
||||||
add_library(${IMPL_TARGET} STATIC ${IMPL_SRC_FILES})
|
add_library(${IMPL_TARGET} STATIC ${IMPL_SRC_FILES})
|
||||||
target_link_libraries(${IMPL_TARGET} ${ABSTRACT_TARGET} ReturnCode)
|
target_link_libraries(${IMPL_TARGET} ${ABSTRACT_TARGET} ReturnCode)
|
||||||
|
|
||||||
|
add_custom_target(
|
||||||
|
log_code_check
|
||||||
|
COMMAND ${CMAKE_SOURCE_DIR_IPCSDK}/tools/clang-tidy/clang-tidy
|
||||||
|
-checks='${CLANG_TIDY_CHECKS}'
|
||||||
|
${IMPL_SRC_FILES}
|
||||||
|
${ABSTRACT_FILES}
|
||||||
|
${CLANG_TIDY_CONFIG}
|
||||||
|
-header-filter=.*
|
||||||
|
-system-headers=false
|
||||||
|
-p ${CMAKE_SOURCE_DIR_IPCSDK}/cmake-shell-linux
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR_IPCSDK}/utils/LogC
|
||||||
|
)
|
||||||
|
|
||||||
|
# add_custom_command(
|
||||||
|
# TARGET ${IMPL_TARGET}
|
||||||
|
# TARGET ${ABSTRACT_TARGET}
|
||||||
|
# PRE_BUILD
|
||||||
|
# COMMAND make log_code_check
|
||||||
|
# WORKING_DIRECTORY ${PROJECT_ROOT_PATH}/cmake-shell-linux/
|
||||||
|
# )
|
|
@ -1,5 +1,5 @@
|
||||||
#include "iLog.h"
|
#include "iLog.h"
|
||||||
|
#include "ReturnCode.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef _IPC_I_LOG_H_
|
#ifndef ILOG_H
|
||||||
#define _IPC_I_LOG_H_
|
#define ILOG_H
|
||||||
|
|
||||||
#include <stdarg.h>
|
// #include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "ReturnCode.h"
|
#include "ReturnCode.h"
|
||||||
|
@ -62,4 +62,4 @@ RETURN_CODE_C destroy_log_module(void);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif //_IPC_I_LOG_H_
|
#endif //ILOG_H
|
|
@ -1,8 +1,10 @@
|
||||||
#include "logMakePtr.h"
|
#include "logMakePtr.h"
|
||||||
|
#include "ReturnCode.h"
|
||||||
|
#include "iLog.h"
|
||||||
#include "logUb.h"
|
#include "logUb.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
// #include <stdlib.h>
|
||||||
RETURN_CODE_C create_log_module(void)
|
RETURN_CODE_C create_log_module(void)
|
||||||
{
|
{
|
||||||
LogUbuntu *log = NULL;
|
LogUbuntu *log = NULL;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef _IPC_LOG_MAKE_PTR_H_
|
#ifndef LOGMAKEPTR_H
|
||||||
#define _IPC_LOG_MAKE_PTR_H_
|
#define LOGMAKEPTR_H
|
||||||
|
|
||||||
#include "ReturnCode.h"
|
#include "ReturnCode.h"
|
||||||
#include "logUb.h"
|
#include "logUb.h"
|
||||||
|
@ -39,4 +39,4 @@ static inline RETURN_CODE_C create_log_instance(LogUbuntu **log)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif //_IPC_LOG_MAKE_PTR_H_
|
#endif //LOGMAKEPTR_H
|
|
@ -1,8 +1,9 @@
|
||||||
|
#include "iLog.h"
|
||||||
|
#include "ReturnCode.h"
|
||||||
#include "logUb.h"
|
#include "logUb.h"
|
||||||
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
static const char *LogLevelStr[] = {
|
static const char *LogLevelStr[] = {
|
||||||
|
@ -44,12 +45,12 @@ static void ub_log_fmt(ILog *log, const LogLeveL level, const char *fmt, ...)
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_CODE_C ub_log_init(ILog *impl)
|
static RETURN_CODE_C ub_log_init(ILog *impl)
|
||||||
{
|
{
|
||||||
return CreateReturnCode(C_RETURN_CODE_OK);
|
return CreateReturnCode(C_RETURN_CODE_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_CODE_C ub_log_unInit(ILog *impl)
|
static RETURN_CODE_C ub_log_unInit(ILog *impl)
|
||||||
{
|
{
|
||||||
return CreateReturnCode(C_RETURN_CODE_OK);
|
return CreateReturnCode(C_RETURN_CODE_OK);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user