1994-05-26 06:18:55 +00:00
|
|
|
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
1999-08-27 23:15:48 +00:00
|
|
|
# $FreeBSD$
|
1994-05-26 06:18:55 +00:00
|
|
|
|
2015-10-18 05:29:49 +00:00
|
|
|
.include <src.opts.mk>
|
|
|
|
|
2016-02-09 16:58:50 +00:00
|
|
|
PACKAGE=runtime
|
2004-04-09 07:13:27 +00:00
|
|
|
PROG= dd
|
|
|
|
SRCS= args.c conv.c conv_tab.c dd.c misc.c position.c
|
2018-08-15 19:46:13 +00:00
|
|
|
LIBADD= util
|
2004-03-05 19:30:13 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Test the character conversion functions. We have to be explicit about
|
|
|
|
# which LC_LANG we use because the definition of upper and lower case
|
|
|
|
# depends on it.
|
2004-04-09 07:13:27 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
CLEANFILES= gen
|
|
|
|
|
|
|
|
test: ${PROG} gen
|
2004-03-05 19:30:13 +00:00
|
|
|
.for conv in ascii ebcdic ibm oldascii oldebcdic oldibm \
|
2004-03-05 19:35:51 +00:00
|
|
|
pareven parnone parodd parset \
|
2004-03-05 19:30:13 +00:00
|
|
|
swab lcase ucase
|
2004-04-09 07:13:27 +00:00
|
|
|
@${ECHO} testing conv=${conv}
|
|
|
|
@./gen | \
|
|
|
|
LC_ALL=en_US.US-ASCII ./dd conv=${conv} 2>/dev/null | \
|
|
|
|
LC_ALL=en_US.US-ASCII hexdump -C | \
|
|
|
|
diff -I FreeBSD - ${.CURDIR}/ref.${conv}
|
2004-03-05 19:30:13 +00:00
|
|
|
.endfor
|
2016-02-18 08:44:16 +00:00
|
|
|
@${ECHO} "testing sparse file (obs zeroes)"
|
|
|
|
@./gen 189284 | ./dd ibs=16 obs=8 conv=sparse of=obs_zeroes 2> /dev/null
|
|
|
|
@hexdump -C obs_zeroes | diff -I FreeBSD - ${.CURDIR}/ref.obs_zeroes
|
|
|
|
|
|
|
|
@${ECHO} "testing spase file (all zeroes)"
|
|
|
|
@./dd if=/dev/zero of=1M_zeroes bs=1048576 count=1 2> /dev/null
|
|
|
|
@./dd if=1M_zeroes of=1M_zeroes.1 bs=1048576 conv=sparse 2> /dev/null
|
|
|
|
@./dd if=1M_zeroes of=1M_zeroes.2 bs=1048576 2> /dev/null
|
|
|
|
@diff 1M_zeroes 1M_zeroes.1
|
|
|
|
@diff 1M_zeroes 1M_zeroes.2
|
|
|
|
|
|
|
|
@rm -f gen 1M_zeroes* obs_zeroes
|
2004-04-09 07:13:27 +00:00
|
|
|
|
2017-08-02 08:50:42 +00:00
|
|
|
HAS_TESTS=
|
2017-08-02 08:38:36 +00:00
|
|
|
SUBDIR.${MK_TESTS}+= tests
|
2015-10-18 05:29:49 +00:00
|
|
|
|
2004-04-09 07:13:27 +00:00
|
|
|
.include <bsd.prog.mk>
|