File: Display_-_--timer_-_displayed_value_changes.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 (23 lines) | stat: -rwxr-xr-x 666 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
#
# Check that the elapsed time counter does count up.

# 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'}"

# Transfer a zero amount of data, but take 3 seconds to do it.
#
(sleep 3 | "${testSubject}" -f -t >/dev/null) 2>&1 | tr '\r' '\n' > "${workFile1}"

# Count the number of different timer values; it should be >1.
#
valueCount=$(sort < "${workFile1}" | uniq -u | wc -l | tr -dc '0-9')
if ! test "${valueCount}" -gt 1; then
	echo "timer value did not change"
	exit 1
fi

exit 0