summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/btrace/Makefile
blob: 08654e32a3ccca929c300042057e42a0dae4fff3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# $OpenBSD: Makefile,v 1.25 2021/12/19 01:07:50 guenther Exp $

BTRACE?=		 /usr/sbin/btrace
ALLOWDT!=		sysctl -n kern.allowdt 2>/dev/null

# scripts that don't need /dev/dt
BT_LANG_SCRIPTS=	arithm beginend boolean comments delete exit \
			histempty if \
			map mapclear mapempty mapsyntax mapzero map-unnamed \
			maxoperand min+max+sum multismts nsecs+var \
			precedence print read-map-after-clear staticv-empty \
			syntaxerror

BT_ARG_LANG_SCRIPTS=	staticv str

# scripts that use kernel probes
BT_KERN_SCRIPTS=	multiprobe

REGRESS_EXPECTED_FAILURES=	run-maxoperand

.for b in ${BT_LANG_SCRIPTS}
REGRESS_TARGETS+=		run-$b
run-$b:
	cd ${.CURDIR} && ${BTRACE} $b.bt 2>&1 | diff -u $b.ok /dev/stdin
.endfor

.for b in ${BT_ARG_LANG_SCRIPTS}
REGRESS_TARGETS+=		run-$b
run-$b:
	cat ${.CURDIR}/$b.args | xargs ${BTRACE} ${.CURDIR}/$b.bt 2>&1 | \
		diff -u ${.CURDIR}/$b.ok /dev/stdin
.endfor

.for b in ${BT_KERN_SCRIPTS}
REGRESS_TARGETS+=		run-$b
REGRESS_ROOT_TARGETS+=		run-$b
run-$b:
.if ${ALLOWDT}
	${SUDO} ${BTRACE} ${.CURDIR}/$b.bt 2>&1 | \
		diff -u ${.CURDIR}/$b.ok /dev/stdin
.else
	@echo 'Set "sysctl kern.allowdt=1" to enable $@ tests'
	@echo SKIPPED
.endif
.endfor

.include <bsd.regress.mk>