add sanitizers to unit test runs

remove unnecessary stdlib.h include in json.c
master
leitner 7 months ago
parent 1644367743
commit d03a732c81

@ -1400,7 +1400,7 @@ UNITTESTS=$(shell grep -l UNITTEST */*.c)
TESTS=$(patsubst %.c,test_%,$(notdir $(UNITTESTS)))
test_%: %.c
$(CC) -g -o $@ $< -DUNITTEST -I. -fprofile-arcs -ftest-coverage $(LDFLAGS)
$(CC) -g -o $@ $< -DUNITTEST -I. -fprofile-arcs -ftest-coverage -fsanitize=undefined -fsanitize=address $(LDFLAGS)
./$@
rm -f $@

@ -1338,7 +1338,7 @@ UNITTESTS=$(shell grep -l UNITTEST */*.c)
TESTS=$(patsubst %.c,test_%,$(notdir $(UNITTESTS)))
test_%:
$(CC) -g -o $@ $< -DUNITTEST -I. -fprofile-arcs -ftest-coverage $(LDFLAGS)
$(CC) -g -o $@ $< -DUNITTEST -I. -fprofile-arcs -ftest-coverage -fsanitize=undefined -fsanitize=address $(LDFLAGS)
./$@
rm -f $@
@ -1354,8 +1354,6 @@ srcfiles=$(foreach dir,$(srcdirs),$(wildcard $(dir)/*.c))
compile_commands.json.tmpl: json
./json $(srcfiles) > $@
# for i in $(ALL_OBJS); do foo="{ \"directory\": \".\", \"file\": \"
# echo "[ > $@
compile_commands.json: compile_commands.json.tmpl
sed -e 's#"@"#"$(PWD)"#' < $< > $@

@ -1,7 +1,6 @@
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc,char* argv[]) {
int i;

Loading…
Cancel
Save