File: Display_-_--bytes.test

package info (click to toggle)
pv 1.10.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,076 kB
  • sloc: ansic: 8,421; sh: 6,426; makefile: 131; sed: 16
file content (18 lines) | stat: -rwxr-xr-x 537 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
#
# Check that the byte counter counts.

# Allow all tests to be skipped, e.g. during a release build
test "${SKIP_ALL_TESTS}" = "1" && exit 77

true "${testSubject:?not set - call this from 'make check'}"
true "${workFile1:?not set - call this from 'make check'}"

dd if=/dev/zero bs=100 count=1 2>/dev/null \
| "${testSubject}" -f -b >/dev/null 2>"${workFile1}"

counterValue=$(tr '\r' '\n' < "${workFile1}" | tr -d ' ')
test "${counterValue}" = "100B" && exit 0

echo "unexpected byte counter value: ${counterValue}"
exit 1