[dm-devel] [PATCH 2/4] tests/Makefile: allow setting DIO_TEST_DEV in the environment

mwilck at suse.com mwilck at suse.com
Mon Mar 2 22:20:23 UTC 2020


From: Martin Wilck <mwilck at suse.com>

This change has two effects: 1. no error message is printed if
the directio_test_dev file doesn't exist, and 2. DIO_TEST_DEV
can be set in the environment, or on the "make" command line.
It's still possible to set DIO_TEST_DEV via the directio_test_dev
file if preferred.

Signed-off-by: Martin Wilck <mwilck at suse.com>
---
 tests/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index 6e3e9ca2..5f6583a0 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -18,12 +18,14 @@ TESTS := uevent parser util dmevents hwtable blacklist unaligned vpd pgpolicy \
 .SILENT: $(TESTS:%=%.o)
 .PRECIOUS: $(TESTS:%=%-test)
 
-DIO_TEST_DEV = $(shell sed -n -e 's/^[[:space:]]*DIO_TEST_DEV[[:space:]]*=[[:space:]]*\([^[:space:]\#]\+\).*/\1/p' < directio_test_dev)
-
 all:	$(TESTS:%=%.out)
 
 # test-specific compiler flags
 # XYZ-test_FLAGS: Additional compiler flags for this test
+
+ifneq ($(wildcard directio_test_dev),)
+DIO_TEST_DEV = $(shell sed -n -e 's/^[[:space:]]*DIO_TEST_DEV[[:space:]]*=[[:space:]]*\([^[:space:]\#]\+\).*/\1/p' < directio_test_dev)
+endif
 ifneq ($(DIO_TEST_DEV),)
 directio-test_FLAGS := -DDIO_TEST_DEV=\"$(DIO_TEST_DEV)\"
 endif
-- 
2.25.0





More information about the dm-devel mailing list