Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
open-source-case-studies
Commits
fe5e4dcf
Commit
fe5e4dcf
authored
Jul 28, 2020
by
Dario Pinto
Committed by
Andre Maroneze
Aug 04, 2020
Browse files
[bench-moerman2018] add makefile, script and summary results for Infer
parent
376640d2
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
bench-moerman2018/infer.mk
0 → 100644
View file @
fe5e4dcf
INFER
=
infer run
CPPFLAGS
+=
\
-Icommon
\
# excludes files with recursive functions
filter-out-substring
=
$(
foreach
v,
$(2)
,
$(
if
$(
findstring
$(1)
,
$(v)
)
,,
$(v)
))
SRCS
:=
$(
sort
$(
call
filter-out-substring,leak,
$(
call
filter-out-substring,recursion,
$(
wildcard
base/
*
.c
*
/
*
/
*
.c
))))
GOOD_TARGETS
:=
$(
foreach
s,
$(SRCS)
,
$(
subst
/,_,
$(s:%.c=%)
)
_good.infer
)
BAD_TARGETS
:=
$(
foreach
s,
$(SRCS)
,
$(
subst
/,_,
$(s:%.c=%)
)
_bad.infer
)
TARGETS
:=
$(GOOD_TARGETS)
$(BAD_TARGETS)
define
generate-infer-rules
=
$(subst /,_,$(1
:
%.c=%))_good.infer: $(if $(findstring cross_file
,
$(1))
,
common/common.c
,
) $(1)
$(INFER)
-o
$$
@
--
clang
-DNO_BUG
$(CPPFLAGS)
$$
^
$(subst /,_,$(1
:
%.c=%))_bad.infer: $(if $(findstring cross_file
,
$(1))
,
common/common.c
,
) $(1)
$(INFER)
-o
$$
@
--
clang
$(CPPFLAGS)
$$
^
$(subst /,_,$(1
:
%.c=%))_good.infer/eval.txt: $(subst /
,
_
,
$(1:%.c=%))_good.infer infer_evaluate_case.sh
./infer_evaluate_case.sh good
$$
</bugs.txt
>
$$
</eval.txt
$(subst /,_,$(1
:
%.c=%))_bad.infer/eval.txt: $(subst /
,
_
,
$(1:%.c=%))_bad.infer infer_evaluate_case.sh
./infer_evaluate_case.sh bad
$$
</bugs.txt
>
$$
</eval.txt
endef
$(foreach
s,$(SRCS),$(eval
$(call
generate-infer-rules,$(s))))
infer_eval_sumup.txt
:
$(addsuffix /eval.txt
,
$(TARGETS))
cat
$^
>
infer_eval_sumup.txt
evaluate
:
infer_eval_sumup.txt
.PHONY
:
infer_eval_sumup.txt
good
:
$(GOOD_TARGETS)
bad
:
$(BAD_TARGETS)
all
:
good bad
clean
:
@
rm
-rf
*
_good.infer
@
rm
-rf
*
_bad.infer
@
rm
-rf
a.out
@
rm
-rf
infer-out
bench-moerman2018/infer_eval_sumup.txt
0 → 100644
View file @
fe5e4dcf
This diff is collapsed.
Click to expand it.
bench-moerman2018/infer_evaluate_case.sh
0 → 100644
View file @
fe5e4dcf
#!/bin/bash -eu
if
[
$#
-lt
2
]
;
then
echo
"usage:
$0
(good|bad) path/to/bugs.txt"
exit
1
fi
goodbad
=
"
$1
"
alarms
=
$(
wc
-l
"
$2
"
|
cut
-d
' '
-f1
)
case
$goodbad
in
"good"
)
if
[
"
$alarms
"
-gt
1
]
;
then
echo
"
$2
(
$goodbad
): imprecise"
else
echo
"
$2
(
$goodbad
): ok"
fi
;;
"bad"
)
if
[
"
$alarms
"
-lt
2
]
;
then
echo
"
$2
(
$goodbad
): false negative"
else
echo
"
$2
(
$goodbad
): ok"
fi
;;
*
)
echo
"invalid '
$goodbad
': must be either 'good' or 'bad'."
exit
1
esac
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment