summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authordv <dv@cvs.openbsd.org>2021-06-18 14:36:00 +0000
committerdv <dv@cvs.openbsd.org>2021-06-18 14:36:00 +0000
commit03a613da299ac2a53a50ce024c4912f61da89825 (patch)
tree11f344aab82bd28ff4329008ea9940d98e2b11b4 /regress
parent044481127c59a066bdb151aad7cce1059d37280b (diff)
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@
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.sbin/vmd/diskfmt/Makefile34
1 files 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 <bsd.regress.mk>
-
-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 .