xref: /openbsd/regress/bin/md5/Makefile (revision cca36db2)
1# $OpenBSD: Makefile,v 1.5 2010/08/08 20:15:32 david Exp $
2
3REGRESS_TARGETS=cksum md5 sha1 sha256 sum md5_string_vs_files md5_pipe
4REGRESS_TARGETS+=md5_pipe_vs_file md5_multiple_files
5
6cksum:
7	cksum -x | cmp -s ${.CURDIR}/testsuite.cksum /dev/stdin
8
9md5:
10	md5 -x | cmp -s ${.CURDIR}/testsuite.md5 /dev/stdin
11
12sha1:
13	sha1 -x | cmp -s ${.CURDIR}/testsuite.sha1 /dev/stdin
14
15sha256:
16	sha256 -x | cmp -s ${.CURDIR}/testsuite.sha256 /dev/stdin
17
18sum:
19	sum -x | cmp -s ${.CURDIR}/testsuite.sum /dev/stdin
20
21#	shouldn't allow files on the command line along with '-s'
22md5_string_vs_files:
23	if md5 -s "" /dev/null >/dev/null 2>&1; then \
24		false ; \
25	fi
26
27md5_pipe:
28	echo hi | md5 -p | cmp -s ${.CURDIR}/pipe_test.md5 /dev/stdin
29
30#	shouldn't allow files on the command line along with '-p'
31md5_pipe_vs_file:
32	if echo hi | md5 -p /dev/null >/dev/null 2>&1; then \
33		false ; \
34	fi
35
36#	should allow multiple files
37md5_multiple_files:
38	if [ `md5 /dev/null /dev/null | wc -l` != 2 ]; then \
39		false ; \
40	fi
41
42.PHONY: ${REGRESS_TARGETS}
43
44.include <bsd.regress.mk>
45