summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2019-02-12 22:26:15 +0000
committerbluhm <bluhm@openbsd.org>2019-02-12 22:26:15 +0000
commitfe67560f108e8ce797cb3aa0f22d772c4556168d (patch)
treea426f82cc2d2c3d3866e28533280ea769d72c531
parentlong option -group is same as -g; ok benno (diff)
downloadwireguard-openbsd-fe67560f108e8ce797cb3aa0f22d772c4556168d.tar.xz
wireguard-openbsd-fe67560f108e8ce797cb3aa0f22d772c4556168d.zip
Skip tests for wscons devices that do not exist on the local machine.
from Moritz Buhl
-rw-r--r--regress/sys/dev/wscons/Makefile17
1 files changed, 16 insertions, 1 deletions
diff --git a/regress/sys/dev/wscons/Makefile b/regress/sys/dev/wscons/Makefile
index 989a467390c..1d692d49cf7 100644
--- a/regress/sys/dev/wscons/Makefile
+++ b/regress/sys/dev/wscons/Makefile
@@ -1,8 +1,13 @@
-# $OpenBSD: Makefile,v 1.7 2019/02/01 07:15:01 anton Exp $
+# $OpenBSD: Makefile,v 1.8 2019/02/12 22:26:15 bluhm Exp $
WARNINGS= yes
DEVICES= wskbd0 wsmouse0 wskbd
+.for d in ${DEVICES}
+HAVE_${d} ?!= if dd if=/dev/${d} count=0 status=none; \
+ then echo yes; else echo no; fi
+MAKE := HAVE_${d}="${HAVE_${d}}" ${MAKE}
+.endfor
PROG_sigio= sigio
PROGS+= ${PROG_sigio}
@@ -26,7 +31,12 @@ IGNORE_sigio+= wsmouse0-sigio
REGRESS_TARGETS+= ${PROG_sigio}-$d-$t
${PROG_sigio}-$d-$t: ${PROG_sigio}
@echo "\n======== ${@} ========"
+. if ${HAVE_${d}:L} == "yes"
./${PROG_sigio} -d /dev/$d $t
+. else
+ # no access to device ${d} on this machine
+ @echo SKIPPED
+. endif
. endif
. endfor
.endfor
@@ -42,7 +52,12 @@ TESTS_wscons+= ioctl-unknown
REGRESS_TARGETS+= ${PROG_wscons}-$d-$t
${PROG_wscons}-$d-$t: ${PROG_wscons}
@echo "\n======== ${@} ========"
+. if ${HAVE_${d}:L} == "yes"
./${PROG_wscons} -d /dev/$d $t
+. else
+ # device ${d} does not exists on this machine
+ @echo SKIPPED
+. endif
. endfor
.endfor