[dm-devel] [PATCH 3/4] tests/Makefile: add test_clean target

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


From: Martin Wilck <mwilck at suse.com>

This is a convenience target to remove only the test output files.
It's useful for those tests which require root permissions to run,
as "make" doesn't delete the .out file if a test fails (we could
force "make" to do so, but we don't want to do that, because usually
we want to inspect the output file when a test has failed). With
test_clean, we can run "make" as normal user, then "make test_clean"
and finally run "make" as root again.

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

diff --git a/tests/Makefile b/tests/Makefile
index 5f6583a0..77ff3249 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -67,8 +67,11 @@ lib/libchecktur.so:
 
 OBJS = $(TESTS:%=%.o) test-lib.o
 
-clean: dep_clean
-	$(RM) $(TESTS:%=%-test) $(TESTS:%=%.out) $(OBJS) *.o.wrap
+test_clean:
+	$(RM) $(TESTS:%=%.out)
+
+clean: test_clean dep_clean
+	$(RM) $(TESTS:%=%-test) $(OBJS) *.o.wrap
 	$(RM) -rf lib
 
 .SECONDARY: $(OBJS)
-- 
2.25.0





More information about the dm-devel mailing list