From 7c06504c65647643a26699507c863963442d5938 Mon Sep 17 00:00:00 2001 From: i80287 Date: Wed, 16 Oct 2024 03:04:11 +0300 Subject: [PATCH] update codechecker running script --- tests/run_codechecker.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/run_codechecker.sh b/tests/run_codechecker.sh index 56b4043..a2bec5d 100755 --- a/tests/run_codechecker.sh +++ b/tests/run_codechecker.sh @@ -1,6 +1,7 @@ #!/bin/bash build_dir=cmake-build-codechecker +cmake_build_dir=cmake-build-dir mkdir -p "$build_dir" cd ./$build_dir || exit 1 @@ -8,10 +9,18 @@ cd ./$build_dir || exit 1 OLDIFS=$IFS IFS=',' for cc_and_cxx in clang,clang++ gcc,g++ i686-w64-mingw32-gcc-posix,i686-w64-mingw32-g++-posix x86_64-w64-mingw32-gcc-posix,x86_64-w64-mingw32-g++-posix; do + if [ -d "$cmake_build_dir" ]; then rm -r "$cmake_build_dir"; fi + mkdir -p "$cmake_build_dir" set -- $cc_and_cxx echo "cc = $1, c++ = $2" - cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER="$1" -DCMAKE_CXX_COMPILER="$2" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -S .. -B . - CodeChecker analyze compile_commands.json -o ./report_"$1" + cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_C_COMPILER="$1" \ + -DCMAKE_CXX_COMPILER="$2" \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ + -S .. \ + -B "$cmake_build_dir" + cd "./$cmake_build_dir" && make all --jobs "$(nproc)" && cd .. + CodeChecker analyze "./$cmake_build_dir/compile_commands.json" -o ./report_"$1" CodeChecker parse --print-steps ./report_"$1" >./parsed_report_"$1" done IFS=$OLDIFS