From b129df69dc68e4a6dc90ec2794bde624482e6f0a Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Fri, 26 Feb 2016 11:31:33 -0500 Subject: [PATCH] Makefile-tests.am: add helper testenv target The 'testenv' target enters an environment in which a tmpdir is created and the daemon is set up and started. This is useful for easy testing. $ make -j4 && make install $ make testenv ===== ENTERING TESTENV ===== $ # now we can easily test our new code $ # we can even make use of helper funcs $ source ../tests/libtest.sh $ setup_os_repository archive-z2 syslinux $ exit ===== EXITING TESTENV ===== --- Makefile-tests.am | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile-tests.am b/Makefile-tests.am index 5dd40abf..47877906 100644 --- a/Makefile-tests.am +++ b/Makefile-tests.am @@ -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 ====="