rtl-sdr: add test.sh
authorSeo Suchan <redacted>
Sun, 7 Jun 2026 22:02:49 +0000 (07:02 +0900)
committerJosef Schlehofer <redacted>
Tue, 9 Jun 2026 22:07:48 +0000 (00:07 +0200)
although rtl-sdr doesn't print version, test at least if compiled binary runs

Written-by: Josef Schlehofer <redacted>
Test-by: Josef Schlehofer <redacted>
Suggested-by: Josef Schlehofer <redacted>
Signed-off-by: Seo Suchan <redacted>
utils/rtl-sdr/test-version.sh
utils/rtl-sdr/test.sh [new file with mode: 0644]

index 587b90acd353518c1a07cb0249689bacad1e7d38..ade5f77a5104ee2ad01101e79a3ae15bf1d5eda8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# shellckeck shell=busybox
+# shellcheck shell=busybox
 
 case "$PKG_NAME" in
 rtl-sdr|librtlsdr)
diff --git a/utils/rtl-sdr/test.sh b/utils/rtl-sdr/test.sh
new file mode 100644 (file)
index 0000000..d8820fb
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# shellcheck shell=busybox
+
+case "$1" in
+rtl-sdr)
+    rtl_sdr 2>&1 | grep -q "RTL2832"
+    rtl_tcp -h 2>&1 | grep -q "RTL2832"
+    rtl_test -h 2>&1 | grep -q "RTL2832"
+    rtl_fm -h 2>&1 | grep -q "RTL2832"
+    rtl_eeprom -h 2>&1 | grep -q "RTL2832"
+    rtl_adsb -h 2>&1 | grep -q "ADS-B"
+    rtl_power -h 2>&1 | grep -q "RTL2832"
+    ;;
+librtlsdr)
+    # Pure shared library, checked by packaging and linking tools
+    exit 0
+    ;;
+*)
+    echo "test.sh: unknown subpackage '$1' — refusing to silently pass" >&2
+    echo "test.sh: update utils/rtl-sdr/test.sh to cover this subpackage" >&2
+    exit 1
+    ;;
+esac
git clone https://git.99rst.org/PROJECT