File: Modifiers_-_--interval.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 (22 lines) | stat: -rwxr-xr-x 588 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
#!/bin/sh
#
# Check that the update interval can be set.

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

sleep 1 | "${testSubject}" -f -i 0.1 >/dev/null 2>"${workFile1}"

# There should be more than 6 lines of output.
#
lineCount=$(tr '\r' '\n' < "${workFile1}" | wc -l | tr -dc '0-9')
if ! test "${lineCount}" -gt 6; then
	echo "fewer than 7 lines of output"
	tr '\r' '\n' < "${workFile1}"
	exit 1
fi

exit 0