tomato/.github/scripts/flags-coverage.sh
Green Sky 227425b90e Squashed 'external/toxcore/c-toxcore/' content from commit 67badf69
git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: 67badf69416a74e74f6d7eb51dd96f37282b8455
2023-07-25 11:53:09 +02:00

28 lines
808 B
Bash

#!/bin/bash
. .github/scripts/flags-clang.sh
add_ld_flag -Wl,-z,defs
# Make compilation error on a warning
add_flag -Werror
# Coverage flags.
add_flag --coverage
# Optimisation, but keep stack traces useful.
add_c_flag -fno-inline -fno-omit-frame-pointer
# Show useful stack traces on crash.
add_flag -fsanitize=undefined -fno-sanitize-recover=all
# In test code (_test.cc and libgtest), throw away all debug information.
# We only care about stack frames inside toxcore (which is C). Without this,
# mallocfail will spend a lot of time finding all the ways in which gtest can
# fail to allocate memory, which is not interesting to us.
add_cxx_flag -g0
# Continue executing code in error paths so we can see it cleanly exit (and the
# test code itself may abort).
add_flag -DABORT_ON_LOG_ERROR=false