File: help

package info (click to toggle)
rtl-wmbus 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,696 kB
  • sloc: ansic: 2,625; makefile: 71; sh: 48; python: 46
file content (24 lines) | stat: -rwxr-xr-x 690 bytes parent folder | download
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