2015-09-21 21:48:40 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2015-10-08 19:40:44 +00:00
|
|
|
rootdir=$(readlink -f $(dirname $0))
|
|
|
|
source "$rootdir/scripts/autotest_common.sh"
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2015-10-03 00:11:56 +00:00
|
|
|
out=$PWD
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2015-10-05 17:54:32 +00:00
|
|
|
umask 022
|
|
|
|
|
2015-10-08 19:40:44 +00:00
|
|
|
cd $rootdir
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2016-04-13 00:58:29 +00:00
|
|
|
if [ -d /usr/src/fio ]; then
|
|
|
|
MAKECONFIG="$MAKECONFIG CONFIG_FIO_PLUGIN=y FIO_SOURCE_DIR=/usr/src/fio"
|
|
|
|
fi
|
|
|
|
|
2015-10-08 19:40:44 +00:00
|
|
|
timing_enter autobuild
|
|
|
|
|
|
|
|
timing_enter check_format
|
2015-09-23 15:52:44 +00:00
|
|
|
./scripts/check_format.sh
|
2015-10-08 19:40:44 +00:00
|
|
|
timing_exit check_format
|
2015-09-23 15:52:44 +00:00
|
|
|
|
2016-01-19 03:36:50 +00:00
|
|
|
timing_enter build_kmod
|
|
|
|
./scripts/build_kmod.sh build
|
|
|
|
timing_exit build_kmod
|
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
scanbuild=''
|
|
|
|
if hash scan-build; then
|
2015-09-22 23:20:35 +00:00
|
|
|
scanbuild="scan-build -o $out/scan-build-tmp --status-bugs"
|
2015-09-21 21:48:40 +00:00
|
|
|
fi
|
|
|
|
|
2015-10-03 00:11:56 +00:00
|
|
|
$MAKE $MAKEFLAGS clean
|
2015-10-08 19:40:44 +00:00
|
|
|
|
|
|
|
timing_enter scanbuild_make
|
2015-09-22 23:20:35 +00:00
|
|
|
fail=0
|
2015-10-22 18:26:21 +00:00
|
|
|
time $scanbuild $MAKE $MAKEFLAGS DPDK_DIR=$DPDK_DIR $MAKECONFIG || fail=1
|
2015-10-08 19:40:44 +00:00
|
|
|
timing_exit scanbuild_make
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2015-09-25 20:29:39 +00:00
|
|
|
# Check that header file dependencies are working correctly by
|
|
|
|
# capturing a binary's stat data before and after touching a
|
|
|
|
# header file and re-making.
|
|
|
|
STAT1=`stat examples/nvme/identify/identify`
|
2015-11-03 01:37:15 +00:00
|
|
|
sleep 1
|
2015-09-25 20:29:39 +00:00
|
|
|
touch lib/nvme/nvme_internal.h
|
2015-10-22 18:26:21 +00:00
|
|
|
$MAKE $MAKEFLAGS DPDK_DIR=$DPDK_DIR $MAKECONFIG || fail=1
|
2015-09-25 20:29:39 +00:00
|
|
|
STAT2=`stat examples/nvme/identify/identify`
|
|
|
|
|
|
|
|
if [ "$STAT1" == "$STAT2" ]; then
|
|
|
|
fail=1
|
|
|
|
fi
|
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
if [ -d $out/scan-build-tmp ]; then
|
|
|
|
scanoutput=$(ls -1 $out/scan-build-tmp/)
|
|
|
|
mv $out/scan-build-tmp/$scanoutput $out/scan-build
|
2015-09-22 23:42:53 +00:00
|
|
|
rm -rf $out/scan-build-tmp
|
2015-09-21 21:48:40 +00:00
|
|
|
chmod -R a+rX $out/scan-build
|
|
|
|
fi
|
|
|
|
|
2015-10-08 19:40:44 +00:00
|
|
|
timing_enter doxygen
|
2015-09-21 21:48:40 +00:00
|
|
|
if hash doxygen; then
|
2015-10-08 19:40:44 +00:00
|
|
|
(cd "$rootdir"/doc; $MAKE $MAKEFLAGS)
|
2015-09-21 21:48:40 +00:00
|
|
|
mkdir -p "$out"/doc
|
2016-03-25 16:54:24 +00:00
|
|
|
mv "$rootdir"/doc/output/html "$out"/doc
|
|
|
|
rm -rf "$rootdir"/doc/output
|
2015-09-21 21:48:40 +00:00
|
|
|
fi
|
2015-10-08 19:40:44 +00:00
|
|
|
timing_exit doxygen
|
|
|
|
|
|
|
|
timing_exit autobuild
|
2015-09-22 23:20:35 +00:00
|
|
|
|
|
|
|
exit $fail
|