Files
panda-meb/tests/libpanda/SConscript
Maxime Desroches 78b49ab155 safety mutation tests (#2040)
* mutation

* clone

* origin

* get diff

* better example

* better

* fix docker

* work on push

* make test fail

* real change

* test all modes

* ignore

* better

* reco

* fix

* no libpanda on device

* curl

* nl

* nl again

* delete

* clean

* clean

* this

* add this back

* cleanup
2024-09-25 21:56:09 -07:00

50 lines
979 B
Python

import os
import platform
COVERAGE_FLAGS = [
'-fprofile-instr-generate',
'-fcoverage-mapping',
]
env = Environment(
CC='clang',
CFLAGS=[
'-nostdlib',
'-fno-builtin',
'-std=gnu11',
'-Wfatal-errors',
'-Wno-pointer-to-int-cast',
],
CPPPATH=[".", "../../board/"],
)
if platform.system() == "Darwin":
env.PrependENVPath('PATH', '/opt/homebrew/bin')
TICI = os.path.isfile('/TICI')
AGNOS = TICI
if AGNOS:
env['CC'] = 'gcc'
else:
env['CFLAGS'] += COVERAGE_FLAGS
env['LINKFLAGS'] += COVERAGE_FLAGS
if GetOption('mutation'):
flags = [
'-fpass-plugin=/usr/lib/mull-ir-frontend-17',
'-g',
'-grecord-command-line',
]
env['CFLAGS'] += flags
env['LINKFLAGS'] += flags
if GetOption('ubsan'):
flags = [
"-fsanitize=undefined",
"-fno-sanitize-recover=undefined",
]
env['CFLAGS'] += flags
env['LINKFLAGS'] += flags
panda = env.SharedObject("panda.os", "panda.c")
libpanda = env.SharedLibrary("libpanda.so", [panda])