Add a pair of scripts to facilitate running Bullseye Coverage and Coverity

Scan on the codebase.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@917 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2017-02-18 14:45:27 +00:00
parent 82935b7d7a
commit 2f340d61b5
5 changed files with 75 additions and 1 deletions

View file

@ -2,7 +2,7 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = lib bin modules include
SUBDIRS = misc include lib bin modules
if WITH_DOC
SUBDIRS += doc

View file

@ -143,6 +143,7 @@ AC_CONFIG_FILES([
include/security/Makefile
lib/Makefile
lib/libpam/Makefile
misc/Makefile
modules/Makefile
modules/pam_deny/Makefile
modules/pam_permit/Makefile
@ -151,4 +152,6 @@ AC_CONFIG_FILES([
t/Makefile
])
AC_CONFIG_FILES([mkpkgng],[chmod +x mkpkgng])
AC_CONFIG_FILES([misc/coverage.sh],[chmod +x misc/coverage.sh])
AC_CONFIG_FILES([misc/coverity.sh],[chmod +x misc/coverity.sh])
AC_OUTPUT

1
misc/Makefile.am Normal file
View file

@ -0,0 +1 @@
noinst_SCRIPTS = coverage.sh coverity.sh

33
misc/coverage.sh.in Normal file
View file

@ -0,0 +1,33 @@
#!/bin/sh
usage() {
echo "usage: ${0##*/} [-jN]" >&2
exit 1
}
while getopts "j:" opt ; do
case $opt in
j)
j="-j$OPTARG"
;;
*)
usage
;;
esac
done
if ! which -s cov01 covhtml ; then
echo "coverage tools not found" >&2
exit 1
fi
srcdir="@abs_top_srcdir@"
htmldir="${srcdir}/covhtml"
export COVFILE="${srcdir}/test.cov"
gmake -C "${srcdir}" clean
find "${srcdir}" -type f -name "${COVFILE##*/}" -delete
rm -rf "${htmldir}"
cov01 -1
gmake -C "${srcdir}" $j check || exit 1
covhtml -d "${srcdir}" -f "${COVFILE}" "${htmldir}"
cov01 -0
gmake -C "${srcdir}" clean

37
misc/coverity.sh.in Normal file
View file

@ -0,0 +1,37 @@
#!/bin/sh
usage() {
echo "usage: ${0##*/} [-jN]" >&2
exit 1
}
while getopts "j:" opt ; do
case $opt in
j)
j="-j$OPTARG"
;;
*)
usage
;;
esac
done
if which -s cov01 ; then
cov01="$(which cov01)"
fi
covint="cov-int"
covlog="${covint}/build-log.txt"
srcdir="@abs_top_srcdir@"
cd "${srcdir}" || exit 1
rm -rf "${covint}"
gmake clean || exit 1
"${cov01:-:}" -q -u
"${cov01:-:}" -q -0
cov-build --dir "${covint}" gmake "$@"
"${cov01:-:}" -q -o
gmake clean
if tail -1 "${covlog}" | grep -q "completed successfully" ; then
tar caf "@PACKAGE@-@PACKAGE_VERSION@-cov-int.txz" "${covint}"
else
tail "${covlog}"
fi