Skip to content

Commit

Permalink
update codechecker running script
Browse files Browse the repository at this point in the history
  • Loading branch information
i80287 committed Oct 16, 2024
1 parent da3656e commit 7c06504
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/run_codechecker.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
#!/bin/bash

build_dir=cmake-build-codechecker
cmake_build_dir=cmake-build-dir

mkdir -p "$build_dir"
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

0 comments on commit 7c06504

Please sign in to comment.