File: basic-options

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 (29 lines) | stat: -rwxr-xr-x 751 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
25
26
27
28
29
#!/bin/sh
set -e

echo "Testing basic rtl_wmbus options with empty input"

# Test invalid option handling - should fail gracefully
if rtl_wmbus -z 2>&1 | grep -qi "usage"; then
    echo "PASS: Invalid option shows usage"
else
    echo "FAIL: Invalid option does not show usage"
    exit 1
fi

# Test that binary exists and is executable
if command -v rtl_wmbus >/dev/null 2>&1; then
    echo "PASS: rtl_wmbus binary is in PATH and executable"
else
    echo "FAIL: rtl_wmbus binary not found in PATH"
    exit 1
fi

# Test that we can check the version programmatically
VERSION=$(rtl_wmbus -V 2>&1 | head -n1)
if [ -n "$VERSION" ]; then
    echo "PASS: Version string retrieved: $VERSION"
else
    echo "FAIL: Could not retrieve version"
    exit 1
fi