Skip to content

Commit

Permalink
[gcov] Fix test coverage generation failure
Browse files Browse the repository at this point in the history
Test coverage generation has been failed due to gcc bug.
Add comile option to fix it.

Refer: https://manpages.debian.org/unstable/lcov/geninfo.1.en.html#negative:

Signed-off-by: Gichan Jang <[email protected]>
  • Loading branch information
gichan-jang authored and jaeyun-jung committed Nov 4, 2024
1 parent c1d5c42 commit 5d8d198
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packaging/nnstreamer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,10 @@ CXXFLAGS=`echo $CXXFLAGS | sed -e "s|-std=gnu++11||"`
# To test coverage, disable optimizations (and should unset _FORTIFY_SOURCE to use -O0)
CFLAGS=`echo $CFLAGS | sed -e "s|-O[1-9]|-O0|g"`
CFLAGS=`echo $CFLAGS | sed -e "s|-Wp,-D_FORTIFY_SOURCE=[1-9]||g"`
export CFLAGS+=" -fprofile-update=atomic"
CXXFLAGS=`echo $CXXFLAGS | sed -e "s|-O[1-9]|-O0|g"`
CXXFLAGS=`echo $CXXFLAGS | sed -e "s|-Wp,-D_FORTIFY_SOURCE=[1-9]||g"`
export CXXFLAGS+=" -fprofile-update=atomic"
# also, use the meson's base option, -Db_coverage, instead of --coverage/-fprofile-arcs and -ftest-coverage
%define enable_test_coverage -Db_coverage=true
%else
Expand Down

0 comments on commit 5d8d198

Please sign in to comment.