Enable code coverage
Reviewers: teon.banek Reviewed By: teon.banek Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2666
This commit is contained in:
parent
6a7b983a58
commit
4669e0ae7d
@ -25,15 +25,13 @@
|
||||
|
||||
# Build coverage binaries.
|
||||
cd ..
|
||||
# TODO: uncomment this build once single node and ha are split
|
||||
# mkdir build_coverage
|
||||
# cd build_coverage
|
||||
# cmake -DTEST_COVERAGE=ON ..
|
||||
# TIMEOUT=1200 make -j$THREADS memgraph__unit
|
||||
ln -s build_debug build_coverage
|
||||
mkdir build_coverage
|
||||
cd build_coverage
|
||||
cmake -DTEST_COVERAGE=ON ..
|
||||
TIMEOUT=1200 make -j$THREADS memgraph__unit
|
||||
|
||||
# Build release binaries.
|
||||
# cd ..
|
||||
cd ..
|
||||
mkdir build_release
|
||||
cd build_release
|
||||
cmake -DCMAKE_BUILD_TYPE=release ..
|
||||
@ -74,15 +72,13 @@
|
||||
|
||||
# Build coverage binaries.
|
||||
cd ..
|
||||
# TODO: uncomment this build once single node and ha are split
|
||||
# mkdir build_coverage
|
||||
# cd build_coverage
|
||||
# cmake -DTEST_COVERAGE=ON ..
|
||||
# TIMEOUT=1200 make -j$THREADS memgraph__unit
|
||||
ln -s build_debug build_coverage
|
||||
mkdir build_coverage
|
||||
cd build_coverage
|
||||
cmake -DTEST_COVERAGE=ON ..
|
||||
TIMEOUT=1200 make -j$THREADS memgraph__unit
|
||||
|
||||
# Build release binaries.
|
||||
# cd ..
|
||||
cd ..
|
||||
mkdir build_release
|
||||
cd build_release
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_READLINE=OFF ..
|
||||
|
@ -13,7 +13,6 @@
|
||||
- \./memgraph/tools/apollo/\.cppcheck_errors
|
||||
|
||||
- name: code_coverage
|
||||
project: ^NEVER$ # TODO (mferencevic): remove when the coverage is split into two (single node and distributed)
|
||||
type: data process
|
||||
require_runs: ^unit__.+ # regex to match all unit runs
|
||||
commands: |
|
||||
|
@ -18,7 +18,7 @@ mkdir "$generated_dir"
|
||||
|
||||
# merge raw coverage info
|
||||
raw_files="$( find "$HOME" -name "*.profraw" | tr '\n' ' ' )"
|
||||
llvm-profdata-5.0 merge -sparse $raw_files -o "$data_file"
|
||||
llvm-profdata merge -sparse $raw_files -o "$data_file"
|
||||
|
||||
# create list of binaries
|
||||
cnt=0
|
||||
@ -35,7 +35,7 @@ done
|
||||
src_files=$( find "$HOME" \( -name '*.cpp' -o -name '*.hpp' \) -print | sort | tr '\n' ' ' )
|
||||
|
||||
# generate html output
|
||||
llvm-cov-5.0 show $obj_files \
|
||||
llvm-cov show $obj_files \
|
||||
-format html \
|
||||
-instr-profile "$data_file" \
|
||||
-o "$html_dir" \
|
||||
@ -52,7 +52,7 @@ find $coverage_dir -name "*.html" -exec sed -i 's@../../style.css@style.css@g' {
|
||||
sed -i 's@/workspace/memgraph@@g' $html_dir/index.html
|
||||
|
||||
# generate json output
|
||||
llvm-cov-5.0 export $obj_files \
|
||||
llvm-cov export $obj_files \
|
||||
-instr-profile "$data_file" \
|
||||
-Xdemangler c++filt -Xdemangler -n \
|
||||
$src_files > "$json_file"
|
||||
|
Loading…
Reference in New Issue
Block a user