summaryrefslogtreecommitdiff
path: root/regress/etc/MAKEDEV/Makefile
blob: 1e1a910b29add06fbdc01c31a4584415a2661ca0 (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
48

# $OpenBSD: Makefile,v 1.33 2016/09/01 10:12:34 tedu Exp $

MAKEDEVARCHS+=alpha amd64 armv7 hppa i386 landisk
MAKEDEVARCHS+=loongson luna88k macppc
MAKEDEVARCHS+=sgi socppc sparc64 vax zaurus

MAKEDEVTARGS?=all ramdisk

ETCSRCDIR?=	/usr/src/etc

REGRESS_SLOW_TARGETS=${REGRESS_TARGETS}

# test separate targets, all, ramdisk/raminst, std, etc
# t1 = all
# t2 = ramdisk

REGRESS_TARGETS+= ${MAKEDEVARCHS}
REGRESS_ROOT_TARGETS=${REGRESS_TARGETS}

${REGRESS_TARGETS}:
. for _T in ${MAKEDEVTARGS}
	@echo "====> ${_T}.${.TARGET}"
	@exec ${SUDO} rm -rf test.${_T}.${.TARGET}
	@exec mkdir -p -m 700 test.${_T}.${.TARGET}
	@exec cp ${ETCSRCDIR}/etc.${.TARGET}/MAKEDEV test.${_T}.${.TARGET}
	@exec ${SUDO} chown root:wheel test.${_T}.${.TARGET}
	@cd test.${_T}.${.TARGET}; \
	time ${SUDO} sh ./MAKEDEV ${_T} || true; \
	time ${SUDO} sh ./MAKEDEV ${_T} || true; \
	( ls -ln; ls -ln fd/ ) 2> /dev/null | \
		awk '/^[bcps]/ {printf "%s %x.%x %x,%x%s\n",$$1,$$3,$$4,$$5,$$6,$$10} \
		     /^l/      {printf "%s %s.%s%s>%s\n",$$1,$$3,$$4,$$9,$$11}' | \
		sort +5 -n | \
		sed -e 's/rwx/7/g;s/rw-/6/g;s/r-x/5/g;s/r--/4/g' \
		    -e 's/-wx/3/g;s/-w-/2/g;s/--x/1/g;s/---/0/g' \
		    -e 's/^\([bcpsl]\)\([0-9][0-9]*\) /\2\1/' \
		> ../t1.${_T}.${.TARGET}.out
.endfor

clean:
	for f in ${MAKEDEVARCHS}; do rm -rf test.$$f; done
	rm -f ${CLEANFILES}

.PHONY: ${MAKEDEVARCHS}
CLEANFILES+=t1.*.out

.include <bsd.regress.mk>