Merge pull request #219 from jlebon/pr/testenv-helper
Fix up libtest.sh and add testenv helper
This commit is contained in:
commit
50fb99ed5a
@ -78,3 +78,12 @@ check-local:
|
||||
@echo " To run them, rpm-ostree must be configured with --enable-installed-tests and installed"
|
||||
@echo " *** NOTE ***"
|
||||
@echo " *** NOTE ***"
|
||||
|
||||
testenv:
|
||||
@echo "===== ENTERING TESTENV ====="
|
||||
test_tmpdir=$$(mktemp -d test.XXXXXX) && \
|
||||
cd $$test_tmpdir && \
|
||||
sh ../tests/setup-session.sh bash && \
|
||||
cd .. && \
|
||||
rm -rf $$test_tmpdir
|
||||
@echo "===== LEAVING TESTENV ====="
|
||||
|
@ -17,12 +17,24 @@
|
||||
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
# Have we already been sourced?
|
||||
if test -n "${LIBTEST_SH:-}"; then
|
||||
# would be good to know when it happens
|
||||
echo "INFO: Skipping subsequent sourcing of libtest.sh"
|
||||
return
|
||||
fi
|
||||
LIBTEST_SH=1
|
||||
|
||||
SRCDIR=$(dirname $0)
|
||||
_cleanup_tmpdir () {
|
||||
if test -f ${test_tmpdir}.test; then
|
||||
if test -f ${test_tmpdir}/.test; then
|
||||
rm ${test_tmpdir} -rf
|
||||
fi
|
||||
}
|
||||
|
||||
# If we're running as a local test (i.e. through `make check`), then
|
||||
# UNINSTALLEDTESTS=1. Otherwise (i.e. as an installed test), it's undefined, in
|
||||
# which case we're already in a tmpdir.
|
||||
if test -n "${UNINSTALLEDTESTS:-}"; then
|
||||
test_tmpdir=$(mktemp -d test.XXXXXX)
|
||||
touch ${test_tmpdir}/.test
|
||||
@ -30,6 +42,7 @@ if test -n "${UNINSTALLEDTESTS:-}"; then
|
||||
cd ${test_tmpdir}
|
||||
export PATH=${builddir}:${PATH}
|
||||
fi
|
||||
|
||||
test_tmpdir=$(pwd)
|
||||
|
||||
export G_DEBUG=fatal-warnings
|
||||
|
@ -19,12 +19,14 @@
|
||||
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
test_tmpdir=$(pwd)
|
||||
set -e
|
||||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
exec_binary="@LIBEXECDIR@/rpm-ostreed"
|
||||
|
||||
mkdir sysroot
|
||||
mkdir session-services
|
||||
mkdir -p sysroot
|
||||
mkdir -p session-services
|
||||
|
||||
# Create a busconfig file with a custom <servicedir>
|
||||
cat > session.conf <<EOF
|
||||
|
Loading…
Reference in New Issue
Block a user