xref: /openbsd/regress/bin/md5/Makefile (revision 5af055cd)
1# $OpenBSD: Makefile,v 1.7 2015/01/09 03:32:58 lteo Exp $
2
3REGRESS_TARGETS=cksum md5 sha1 sha224 sha256 sha384 sha512 md5_string_vs_files
4REGRESS_TARGETS+=md5_pipe 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
15sha224:
16	cksum -a sha224 -x | cmp -s ${.CURDIR}/testsuite.sha224 /dev/stdin
17
18sha256:
19	sha256 -x | cmp -s ${.CURDIR}/testsuite.sha256 /dev/stdin
20
21sha384:
22	cksum -a sha384 -x | cmp -s ${.CURDIR}/testsuite.sha384 /dev/stdin
23
24sha512:
25	sha512 -x | cmp -s ${.CURDIR}/testsuite.sha512 /dev/stdin
26
27#	shouldn't allow files on the command line along with '-s'
28md5_string_vs_files:
29	if md5 -s "" /dev/null >/dev/null 2>&1; then \
30		false ; \
31	fi
32
33md5_pipe:
34	echo hi | md5 -p | cmp -s ${.CURDIR}/pipe_test.md5 /dev/stdin
35
36#	shouldn't allow files on the command line along with '-p'
37md5_pipe_vs_file:
38	if echo hi | md5 -p /dev/null >/dev/null 2>&1; then \
39		false ; \
40	fi
41
42#	should allow multiple files
43md5_multiple_files:
44	if [ `md5 /dev/null /dev/null | wc -l` != 2 ]; then \
45		false ; \
46	fi
47
48.PHONY: ${REGRESS_TARGETS}
49
50.include <bsd.regress.mk>
51