numam-spdk/autopackage.sh
Jim Harris cfb65ba611 test: add generic unlink wrapper
reduce library uses unlink, but the unit tests need to
override it in a specific way.

But linking unit tests with LTO requires the wrapper
definitions be in objects/libraries listed *after*
the object/library that refers to it.  So we need to
make the unlink wrapper somewhat generic.  We do this
by exporting a string and callback function that the
user can set to enable a user-defined function to be
called when unlink() is called with a specific file
name.

Also revert 3ef6d06 as part of this patch, since we
no longer require the workaround that it implemented.

Fixes issue #1357.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1ee4c424ad31fe7d91d7b524ed47aedd279e5b5c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1948
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-05-06 12:43:57 +00:00

50 lines
968 B
Bash
Executable File

#!/usr/bin/env bash
set -xe
# If the configuration of tests is not provided, no tests will be carried out.
if [[ ! -f $1 ]]; then
echo "ERROR: SPDK test configuration not specified"
exit 1
fi
source "$1"
rootdir=$(readlink -f $(dirname $0))
source "$rootdir/test/common/autotest_common.sh"
out=$PWD
MAKEFLAGS=${MAKEFLAGS:--j16}
cd $rootdir
timing_enter porcelain_check
$MAKE clean
if [ $(git status --porcelain --ignore-submodules | wc -l) -ne 0 ]; then
echo make clean left the following files:
git status --porcelain --ignore-submodules
exit 1
fi
timing_exit porcelain_check
if [[ $RUN_NIGHTLY -eq 0 ]]; then
timing_finish
exit 0
fi
timing_enter build_release
if [ $(uname -s) = Linux ]; then
./configure $(get_config_params) --disable-debug --enable-lto
else
# LTO needs a special compiler to work on BSD.
./configure $(get_config_params) --disable-debug
fi
$MAKE ${MAKEFLAGS}
$MAKE ${MAKEFLAGS} clean
timing_exit build_release
timing_finish