mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Start making code quality tests : cmake .. -DENABLE_CODE_QUALITY=1 && ninja && ctest
This commit is contained in:
parent
7bac9698f6
commit
0ce1a9c095
4
debian/.pbuilderrc
vendored
4
debian/.pbuilderrc
vendored
@ -53,7 +53,7 @@ DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME $STABLE_BAC
|
||||
"experimental" "unstable" "testing" "stable")
|
||||
|
||||
# List of Ubuntu suites. Update these when needed.
|
||||
UBUNTU_SUITES=("bionic" "artful" "zesty" "xenial" "trusty" "devel")
|
||||
UBUNTU_SUITES=("cosmic" "bionic" "artful" "zesty" "xenial" "trusty" "devel")
|
||||
|
||||
# Set a default distribution if none is used. Note that you can set your own default (i.e. ${DIST:="unstable"}).
|
||||
HOST_DIST=`lsb_release --short --codename`
|
||||
@ -161,7 +161,7 @@ esac
|
||||
|
||||
if [ "$ARCH" != arm64 ]; then
|
||||
case "$DIST" in
|
||||
"bionic" | "experimental" | "unstable" | "testing")
|
||||
"cosmic" | "bionic" | "experimental" | "unstable" | "testing")
|
||||
EXTRAPACKAGES+=" liblld-6.0-dev libclang-6.0-dev liblld-6.0 "
|
||||
export CMAKE_FLAGS="-DLLVM_VERSION_POSTFIX=-6.0 $CMAKE_FLAGS"
|
||||
;;
|
||||
|
@ -21,3 +21,7 @@ if (NOT DEFINED ENABLE_UTILS OR ENABLE_UTILS)
|
||||
add_subdirectory (check-marks)
|
||||
add_subdirectory (test-data-generator)
|
||||
endif ()
|
||||
|
||||
if (ENABLE_CODE_QUALITY)
|
||||
add_subdirectory (check-style)
|
||||
endif ()
|
||||
|
2
utils/check-style/CMakeLists.txt
Normal file
2
utils/check-style/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
add_test(NAME check-style COMMAND bash -c "${CMAKE_CURRENT_SOURCE_DIR}/check-style")
|
||||
add_test(NAME check-include COMMAND bash -c "env RUN_DIR=${CMAKE_CURRENT_SOURCE_DIR} ROOT_DIR=${ClickHouse_SOURCE_DIR} BUILD_DIR=${ClickHouse_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/check-include")
|
@ -1,10 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
#set -x
|
||||
# sudo apt install time
|
||||
# Small .h isolated compile checker
|
||||
# Finds missing #include <...>
|
||||
# prints compile time, number of includes, use with sort: ./check_include.sh 2>&1 | sort -rk3
|
||||
# use with clang: CXX=`which clang++-7 clang++-7.0 clang++-6.0 clang++-5.0 | head -n1` ./check_include.sh
|
||||
pwd=`pwd`
|
||||
RUN_DIR=${RUN_DIR=`pwd`}
|
||||
BUILD_DIR=${BUILD_DIR:=./build}
|
||||
inc="-I. \
|
||||
-I./contrib/libdivide \
|
||||
@ -46,8 +48,8 @@ inc="-I. \
|
||||
-I${BUILD_DIR}/dbms/src"
|
||||
|
||||
if [ -z $1 ]; then
|
||||
cd ..
|
||||
find dbms libs utils \( -name *.h -and -not -name *.inl.h \) -exec sh $pwd/$0 {} \; ;
|
||||
cd ${ROOT_DIR=../..}
|
||||
find dbms libs utils \( -name *.h -and -not -name *.inl.h \) -exec sh $RUN_DIR/`basename $0` {} \; ;
|
||||
else
|
||||
echo -n "$1 "
|
||||
echo -n `grep "#include" $1| wc -l` " "
|
Loading…
Reference in New Issue
Block a user