The -c option expects a digest file in either BSD or coreutils format. The output for matched and mismatched files is identical to that of the coreutils version. The review of these changes included test cases that have already been committed for the functionality that existed before. Another test script is added to cover the coreutils compatible extension implemented by this patch. This commit contains a tests/Makefile that has been cleaned up compared to the review version, using an implicit rule to apply the TESTBASE path at build time (and the scripts have been renamed to have an extension of .SH instead of .sh to trigger this rule). Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D30812
22 lines
397 B
Bash
22 lines
397 B
Bash
#!/bin/sh
|
|
|
|
/bin/cp %%TESTSBASE%%/sbin/md5/*.inp . || exit 127
|
|
|
|
exitcode=0
|
|
|
|
testloop () {
|
|
opt=$1
|
|
|
|
while read algorithm; do
|
|
${algorithm}sum -c %%TESTSBASE%%/sbin/md5/${algorithm}.digest || exitcode=1
|
|
${algorithm}sum -c %%TESTSBASE%%/sbin/md5/${algorithm}sum.digest || exitcode=1
|
|
done < %%TESTSBASE%%/sbin/md5/algorithms.txt
|
|
}
|
|
|
|
testloop ""
|
|
testloop -q
|
|
testloop -r
|
|
testloop -qr
|
|
|
|
exit $exitcode
|