1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!/bin/sh
set -e
echo "Testing rtl_wmbus (help output)"
# rtl_wmbus without arguments prints help when stdin is a terminal
# Use script to provide a pseudo-terminal, or use -z for invalid option
OUTPUT=$(rtl_wmbus -z 2>&1 || true)
if echo "$OUTPUT" | grep -q "Usage"; then
echo "PASS: Help output contains usage information"
else
echo "FAIL: Help output does not contain usage information"
exit 1
fi
# Check that help mentions key options
for opt in "-o" "-a" "-d" "-s" "-v" "-V" "-h"; do
if echo "$OUTPUT" | grep -q -- "$opt"; then
echo "PASS: Help mentions option $opt"
else
echo "FAIL: Help does not mention option $opt"
exit 1
fi
done
|