- name: Set up Cygwin
uses: cygwin/cygwin-install-action@master
with:
- packages: make gcc-g++ bash libtool automake autoconf libssl-devel bind-utils
+ packages: make gcc-g++ bash libtool automake autoconf libssl-devel bind-utils clang
- uses: actions/checkout@main
with:
submodules: recursive
- name: Get the qemu container
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: "${{ matrix.platform }}: Build and test"
- run: docker run --rm --interactive --mount type=bind,source=$(pwd),target=/host ${{ matrix.platform }}/alpine sh -c "apk add make gcc libc-dev libtool automake autoconf openssl-dev m4 indent bash bind-tools && cd /host && libtoolize -vci && autoreconf -vfi && ./configure && make test"
+ run: docker run --rm --interactive --mount type=bind,source=$(pwd),target=/host ${{ matrix.platform }}/alpine sh -c "apk add make gcc libc-dev libtool automake autoconf openssl-dev m4 indent bash bind-tools clang && cd /host && libtoolize -vci && autoreconf -vfi && ./configure && make test"
# BSDs:
--- /dev/null
+# #-- clang-analysis.test --#
+# source the master var file when it's there
+[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
+# use .tpkg.var.test for in test variable passing
+[ -f .tpkg.var.test ] && source .tpkg.var.test
+# common functions
+. ../common.sh
+
+if test ! -x "`which clang 2>&1`"; then
+ echo "No clang in path"
+ exit 0
+fi
+#echo "have clang"
+
+# read value from Makefile
+# $1: result variable name
+# $2: string on Makefile
+# $3: Makefile location
+read_value () {
+ x=`grep "$2" $3 | sed -e "s/$2//"`
+ echo eval $1="'""$x""'"
+ eval $1="'""$x""'"
+ # print what we just read
+ #echo $1"="'"'"`eval echo '$'$1`"'"'
+}
+
+PRE="../.."
+# read some values from the Makefile
+read_value srcdir '^srcdir[ ]*= *' $PRE/Makefile
+read_value CPPFLAGS '^CPPFLAGS = *' $PRE/Makefile
+read_value LIBOBJS '^LIBOBJS = *' $PRE/Makefile
+
+#echo dir is $dir
+# turn libobjs into C files
+compatfiles=`echo "$LIBOBJS" | sed -e 's?..LIBOBJDIR.?compat/?g' -e 's/.U.o/.c/g'`
+echo compatfiles are $compatfiles
+#echo
+
+echo "cd $PRE -- cd $srcdir"
+cd $PRE; cd $srcdir
+# check the files in the srcdir
+fail="no"
+for x in *.c $compatfiles; do
+ echo clang --analyze $CPPFLAGS $x
+ plist=`basename $x .c`.plist
+ rm -rf $plist
+ clang --analyze $CPPFLAGS $x 2>&1 | tee tmp.$$
+ if grep -e warning -e error tmp.$$ >/dev/null; then
+ fail="yes"
+ fails="$fails $x"
+ fi
+ rm -rf $plist tmp.$$
+done
+
+echo
+if test "$fail" = "yes"; then
+ echo "Failures"
+ echo "create reports in file.plist dir with clang --analyze --analyzer-output html $CPPFLAGS""$fails"
+ exit 1
+fi
+echo "OK"
+exit 0