File: flags-coverage.sh

package info (click to toggle)
libtoxcore 0.2.20-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,124 kB
  • sloc: ansic: 75,034; cpp: 4,933; sh: 1,115; python: 651; makefile: 329; perl: 39
file content (27 lines) | stat: -rwxr-xr-x 875 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

. .github/scripts/flags-clang.sh

add_ld_flag -Wl,-z,defs

# Make compilation error on a warning
add_flag -Werror -Wno-unsafe-buffer-usage

# Coverage flags.
add_flag -fprofile-instr-generate -fcoverage-mapping

# 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 -D_DEBUG

# 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