rpm-ostree/Makefile-tests.am
Jonathan Lebon f411c0babb testenv: include same vars as real test environment
Closes: #325
Approved by: cgwalters
2016-06-15 20:41:45 +00:00

94 lines
3.0 KiB
Plaintext

include $(top_srcdir)/buildutil/glib-tap.mk
AM_TESTS_ENVIRONMENT = \
UNINSTALLEDTESTS=1 \
builddir=$(abs_builddir) \
topsrcdir=$(abs_top_srcdir) \
commondir=$(abs_top_srcdir)/tests/common
CLEANFILES += \
tests/common/compose/yum/empty \
tests/common/compose/yum/repodata/repomd.xml \
tests/common/compose/test-repo.repo \
tests/common/compose/yum/repodata/*.bz2 \
tests/common/compose/yum/repodata/*.gz \
$(NULL)
# Needed by the compose test
tests/common/compose/yum/empty: tests/common/compose/yum/empty.c
$(CC) -nostdlib $< -o $@
tests/common/compose/yum/repodata/repomd.xml: tests/common/compose/yum/empty tests/common/compose/yum/empty.spec
(cd tests/common/compose/yum && \
rpmbuild \
--define "_sourcedir $(abs_top_srcdir)/tests/common/compose/yum" \
--define "_specdir $(abs_top_srcdir)/tests/common/compose/yum" \
--define "_builddir $(abs_top_srcdir)/tests/common/compose/yum" \
--define "_srcrpmdir $(abs_top_srcdir)/tests/common/compose/yum" \
--define "_rpmdir $(abs_top_srcdir)/tests/common/compose/yum" \
--define "_buildrootdir $(abs_top_srcdir)/tests/common/compose/yum/.build" \
-ba empty.spec && \
rm *.src.rpm && \
createrepo_c --no-database $(abs_top_srcdir)/tests/common/compose/yum/)
tests/common/compose/test-repo.repo: tests/common/compose/test-repo.repo.in tests/common/compose/yum/repodata/repomd.xml
cat $< | sed -e "s|%WHERE%|$(abs_top_srcdir)|" > $@
CLEANFILES += \
tests/common/compose/test-repo-local.repo \
tests/common/compose/yum/empty-1.0-1.src.rpm \
$(NULL)
tests_check_jsonutil_CPPFLAGS = -I $(srcdir)/src/libpriv
tests_check_jsonutil_CFLAGS = $(PKGDEP_RPMOSTREE_CFLAGS)
tests_check_jsonutil_LDADD = $(PKGDEP_RPMOSTREE_LIBS) librpmostreepriv.la
tests/check/test-compose.sh: tests/common/compose/test-repo.repo
tests/check/test-ucontainer.sh: tests/common/compose/test-repo.repo
uninstalled_test_programs = \
tests/check/jsonutil \
$(NULL)
uninstalled_test_scripts = \
tests/check/test-basic.sh \
tests/check/test-compose.sh \
tests/check/test-ucontainer.sh \
$(NULL)
uninstalled_test_extra_programs = dbus-run-session
dbus_run_session_SOURCES = tests/utils/dbus-run-session.c
check-local:
@echo " *** NOTE ***"
@echo " *** NOTE ***"
@echo " \"make check\" only runs a subset of rpm-ostree's tests."
@echo " Use \"make vmcheck\" to run remaining tests in a VM."
@echo " *** NOTE ***"
@echo " *** NOTE ***"
vmbuild:
vagrant up # provision if not already done
vagrant rsync
vagrant ssh -c "cd sync/tests/vmcheck && make install VERSION=$$(git describe)"
vagrant ssh -c "sudo systemctl reboot" || :
vmcheck: vmbuild
true # start test harness here
vmshell: vmbuild
sleep 3 # give time to VM to close ssh port
vagrant ssh
testenv:
@echo "===== ENTERING TESTENV ====="
test_tmpdir=$$(mktemp -d test.XXXXXX) && \
cd $$test_tmpdir && \
env $(AM_TESTS_ENVIRONMENT) TESTENV=1 \
sh ../tests/utils/setup-session.sh bash && \
cd .. && \
rm -rf $$test_tmpdir
@echo "===== LEAVING TESTENV ====="