xref: /freebsd/bin/dd/Makefile (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1.include <src.opts.mk>
2
3PACKAGE=runtime
4PROG=	dd
5SRCS=	args.c conv.c conv_tab.c dd.c misc.c position.c
6LIBADD= util
7
8#
9# Test the character conversion functions.  We have to be explicit about
10# which LC_LANG we use because the definition of upper and lower case
11# depends on it.
12#
13
14CLEANFILES=	gen
15
16test: ${PROG} gen
17.for conv in ascii ebcdic ibm oldascii oldebcdic oldibm \
18    pareven parnone parodd parset \
19    swab lcase ucase
20	@${ECHO} testing conv=${conv}
21	@./gen | \
22	    LC_ALL=en_US.US-ASCII ./dd conv=${conv} 2>/dev/null | \
23	    LC_ALL=en_US.US-ASCII hexdump -C | \
24	    diff -I FreeBSD - ${.CURDIR}/ref.${conv}
25.endfor
26	@${ECHO} "testing sparse file (obs zeroes)"
27	@./gen 189284 | ./dd ibs=16 obs=8 conv=sparse of=obs_zeroes 2> /dev/null
28	@hexdump -C obs_zeroes | diff -I FreeBSD - ${.CURDIR}/ref.obs_zeroes
29
30	@${ECHO} "testing spase file (all zeroes)"
31	@./dd if=/dev/zero of=1M_zeroes bs=1048576 count=1 2> /dev/null
32	@./dd if=1M_zeroes of=1M_zeroes.1 bs=1048576 conv=sparse 2> /dev/null
33	@./dd if=1M_zeroes of=1M_zeroes.2 bs=1048576 2> /dev/null
34	@diff 1M_zeroes 1M_zeroes.1
35	@diff 1M_zeroes 1M_zeroes.2
36
37	@rm -f gen 1M_zeroes* obs_zeroes
38
39HAS_TESTS=
40SUBDIR.${MK_TESTS}+= tests
41
42.include <bsd.prog.mk>
43