From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - makefile: enhance run-unit-test target
Date: Fri, 15 Oct 2021 08:12:13 +0000 (GMT) [thread overview]
Message-ID: <20211015081213.EFFE13857C6E@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2e2d67378007ee850792396f933900e71f0ea80d
Commit: 2e2d67378007ee850792396f933900e71f0ea80d
Parent: 037165300ea1f6d9c9f8587360792505b2f3988d
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Fri Oct 15 09:45:26 2021 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Fri Oct 15 09:55:54 2021 +0200
makefile: enhance run-unit-test target
Use TMPDIR for executing test and also ensure
all libraries linked to the test are from builddir.
---
test/unit/Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/test/unit/Makefile b/test/unit/Makefile
index 455c18d2a..5826f41c2 100644
--- a/test/unit/Makefile
+++ b/test/unit/Makefile
@@ -54,7 +54,12 @@ $(UNIT_TARGET): $(UNIT_OBJECTS) $(LVMINTERNAL_LIBS)
unit-test: $(UNIT_TARGET)
run-unit-test: $(UNIT_TARGET)
@echo "Running unit tests"
- LD_LIBRARY_PATH=$(top_builddir)/libdm $(UNIT_TARGET) run
+ test -n "$$LVM_TEST_DIR" || LVM_TEST_DIR=$${TMPDIR:-/tmp} ;\
+ TESTDIR=$$(mktemp -d -t -p "$$LVM_TEST_DIR" "LVMTEST.XXXXXXXXXX") ;\
+ cd "$$TESTDIR" ;\
+ LD_LIBRARY_PATH=$(abs_top_builddir)/libdm:$(abs_top_builddir)/daemons/dmeventd $(abs_top_builddir)/$(UNIT_TARGET) run ;\
+ cd $$OLDPWD ;\
+ $(RM) -r "$${TESTDIR:?}"
ifeq ("$(DEPENDS)","yes")
-include $(UNIT_SOURCE:%.c=%.d)
reply other threads:[~2021-10-15 8:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211015081213.EFFE13857C6E@sourceware.org \
--to=zkabelac@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.