From d2c58a42a790ed7f6cb58f70754efa113c9822f3 Mon Sep 17 00:00:00 2001 From: dv Date: Fri, 18 Jun 2021 14:35:59 +0000 Subject: [PATCH] vmd diskfmt regress: don't copy source files, cleanup disk images Previous version of the diskfmt regress tests for vmd(8) would copy source files from the tree in order to compile them. Using some of the ssh regress tests as inspiration, use the .PATH to allow building object files from other parts of the tree in place. Since 4G disk images are made as part of the test, clean those up when done by adding in a proper REGRESS_CLEANUP target. "go for it" mlarkin@ --- regress/usr.sbin/vmd/diskfmt/Makefile | 34 +++++++++++++-------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/regress/usr.sbin/vmd/diskfmt/Makefile b/regress/usr.sbin/vmd/diskfmt/Makefile index 5aaa9d6949c..5470824254e 100644 --- a/regress/usr.sbin/vmd/diskfmt/Makefile +++ b/regress/usr.sbin/vmd/diskfmt/Makefile @@ -1,29 +1,27 @@ -# $OpenBSD: Makefile,v 1.3 2021/06/13 21:43:35 dv Exp $ +# $OpenBSD: Makefile,v 1.4 2021/06/18 14:35:59 dv Exp $ # This regression test creates a raw disk image and a # qcow disk image, and scribbles the same data to both # of them. It verifies that they both have the same # result. +VMD_DIR= usr.sbin/vmd +.PATH: ${.CURDIR}/../../../../${VMD_DIR} -VMD_DIR=$(BSDSRCDIR)/usr.sbin/vmd +VMCTL?= /usr/sbin/vmctl -PROG=vioscribble -SRCS=vioscribble.c vioqcow2.c vioraw.c log.c -CFLAGS+=-I$(VMD_DIR) -pthread -LDFLAGS+=-pthread +PROG= vioscribble +SRCS= vioscribble.c vioqcow2.c vioraw.c log.c +CFLAGS+= -I${BSDSRCDIR}/${VMD_DIR} +LDADD+= -lpthread -run-regress-vioscribble: scribble-images +CLEANFILES= scribble.{raw,qcow2} +REGRESS_CLEANUP= cleanup +cleanup: + rm -f ${CLEANFILES} -scribble-images: - rm -f scribble.raw scribble.qcow2 - vmctl create -s 4G scribble.raw - vmctl create -s 4G scribble.qcow2 - - -.PHONY: ${REGRESS_TARGETS} scribble-images +REGRESS_SETUP= setup +setup: cleanup + ${VMCTL} create -s 4G scribble.raw + ${VMCTL} create -s 4G scribble.qcow2 .include - -vioqcow2.c vioraw.c log.c: $(VMD_DIR)/vioqcow2.c $(VMD_DIR)/vioraw.c \ - $(VMD_DIR)/log.c - cp $(VMD_DIR)/vioqcow2.c $(VMD_DIR)/vioraw.c $(VMD_DIR)/log.c . -- 2.20.1