Invoke the helper program from the test installation directory (instead

of the current/temporary).
Properly register failure.
This commit is contained in:
martin 2015-01-06 15:13:16 +00:00
parent 3ea142811f
commit 87706a3247
1 changed files with 24 additions and 14 deletions

View File

@ -1,28 +1,38 @@
#! /usr/bin/atf-sh
# $NetBSD: t_in_cksum.sh,v 1.1 2015/01/05 22:38:36 christos Exp $
# $NetBSD: t_in_cksum.sh,v 1.2 2015/01/06 15:13:16 martin Exp $
#
TIMING_LOOPS=10000
incksum="$(atf_get_srcdir)/in_cksum"
fail() {
atf_fail "see output for details"
}
mbufs() {
./in_cksum -l 16 -u $0 -i ${TIMING_LOOPS} \
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
./in_cksum -l 16 -u $0 -i ${TIMING_LOOPS} \
${incksum} -l 16 -u $0 -i ${TIMING_LOOPS} \
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 \
|| fail
${incksum} -l 16 -u $0 -i ${TIMING_LOOPS} \
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 \
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
./in_cksum -l 64 -u $0 -i ${TIMING_LOOPS} \
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 \
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
./in_cksum -l 16 -u $0 -i ${TIMING_LOOPS} \
1 3 1 3 1 3 1
|| fail
${incksum} -l 64 -u $0 -i ${TIMING_LOOPS} \
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 \
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 \
|| fail
${incksum} -l 16 -u $0 -i ${TIMING_LOOPS} \
1 3 1 3 1 3 1 \
|| fail
}
sizes() {
./in_cksum -l 16 -u $1 -i ${TIMING_LOOPS} 2048
./in_cksum -l 16 -u $1 -i ${TIMING_LOOPS} 40
./in_cksum -l 16 -u $1 -i ${TIMING_LOOPS} 1536
./in_cksum -l 16 -u $1 -i ${TIMING_LOOPS} 576
./in_cksum -l 16 -u $1 -i ${TIMING_LOOPS} 1536 1536 1536 1536 1536 640
${incksum} -l 16 -u $1 -i ${TIMING_LOOPS} 2048 || fail
${incksum} -l 16 -u $1 -i ${TIMING_LOOPS} 40 || fail
${incksum} -l 16 -u $1 -i ${TIMING_LOOPS} 1536 || fail
${incksum} -l 16 -u $1 -i ${TIMING_LOOPS} 576 || fail
${incksum} -l 16 -u $1 -i ${TIMING_LOOPS} 1536 1536 1536 1536 1536 640 \
|| fail
}
atf_test_case mbufs_aligned