add sanitizers to unit test runs
remove unnecessary stdlib.h include in json.c
This commit is contained in:
parent
1644367743
commit
d03a732c81
@ -1400,7 +1400,7 @@ UNITTESTS=$(shell grep -l UNITTEST */*.c)
|
|||||||
TESTS=$(patsubst %.c,test_%,$(notdir $(UNITTESTS)))
|
TESTS=$(patsubst %.c,test_%,$(notdir $(UNITTESTS)))
|
||||||
|
|
||||||
test_%: %.c
|
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 $@
|
rm -f $@
|
||||||
|
|
||||||
|
4
Makefile
4
Makefile
@ -1338,7 +1338,7 @@ UNITTESTS=$(shell grep -l UNITTEST */*.c)
|
|||||||
TESTS=$(patsubst %.c,test_%,$(notdir $(UNITTESTS)))
|
TESTS=$(patsubst %.c,test_%,$(notdir $(UNITTESTS)))
|
||||||
|
|
||||||
test_%:
|
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 $@
|
rm -f $@
|
||||||
|
|
||||||
@ -1354,8 +1354,6 @@ srcfiles=$(foreach dir,$(srcdirs),$(wildcard $(dir)/*.c))
|
|||||||
|
|
||||||
compile_commands.json.tmpl: json
|
compile_commands.json.tmpl: json
|
||||||
./json $(srcfiles) > $@
|
./json $(srcfiles) > $@
|
||||||
# for i in $(ALL_OBJS); do foo="{ \"directory\": \".\", \"file\": \"
|
|
||||||
# echo "[ > $@
|
|
||||||
|
|
||||||
compile_commands.json: compile_commands.json.tmpl
|
compile_commands.json: compile_commands.json.tmpl
|
||||||
sed -e 's#"@"#"$(PWD)"#' < $< > $@
|
sed -e 's#"@"#"$(PWD)"#' < $< > $@
|
||||||
|
Loading…
x
Reference in New Issue
Block a user