Use a dedicated regress target for each test case.
authoranton <anton@openbsd.org>
Sun, 13 Aug 2023 18:34:49 +0000 (18:34 +0000)
committeranton <anton@openbsd.org>
Sun, 13 Aug 2023 18:34:49 +0000 (18:34 +0000)
ok gnezdo@

regress/libexec/ld.so/ldd/Makefile

index b8b79d6..db93f08 100644 (file)
@@ -1,19 +1,16 @@
-# $OpenBSD: Makefile,v 1.1 2023/08/12 13:43:22 gnezdo Exp $
+# $OpenBSD: Makefile,v 1.2 2023/08/13 18:34:49 anton Exp $
 
-.include <bsd.own.mk>
+REGRESS_TARGETS+=      empty
+REGRESS_TARGETS+=      short
 
-REGRESS_TARGETS = test
-
-.include <bsd.regress.mk>
-
-CLEANFILES+=empty short
-
-.PHONY: test
-test: empty short
-       ${SHELL} ${.CURDIR}/test.sh
+CLEANFILES+=   *.in *.out
 
 empty:
-       touch empty
+       : >$@.in
+       ldd $@.in 2>&1 | tee $@.out | grep -q 'incomplete ELF header'
 
 short:
-       dd if=/usr/bin/ldd of=short count=128 bs=1
+       dd if=/usr/bin/ldd of=$@.in count=128 bs=1 status=none
+       ldd $@.in 2>&1 | tee $@.out | grep -q 'incomplete program header'
+
+.include <bsd.regress.mk>