24 lines
718 B
Bash
Executable File
24 lines
718 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Check that the progress bar moves when data is coming in.
|
|
|
|
# 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 -p -i 0.1 -L 500 >/dev/null 2>"${workFile1}"
|
|
|
|
# There should be more than 2 different lines of output.
|
|
#
|
|
lineCount=$(tr '\r' '\n' < "${workFile1}" | sort | uniq -u | wc -l | tr -dc '0-9')
|
|
if ! test "${lineCount}" -gt 2; then
|
|
echo "fewer than 3 different progress lines (${lineCount})"
|
|
tr '\r' '\n' < "${workFile1}" | sort | uniq -u
|
|
exit 1
|
|
fi
|
|
|
|
exit 0
|