rtklib: add test.sh and test-version.sh for CI
authorAlexandru Ardelean <redacted>
Sun, 24 May 2026 14:20:08 +0000 (17:20 +0300)
committerAlexandru Ardelean <redacted>
Mon, 25 May 2026 12:53:20 +0000 (15:53 +0300)
The RTKLIB command-line tools (convbin, pos2kml, rnx2rtkp, rtkrcv,
str2str) don't accept a --version flag; passing any unrecognized option
triggers printhelp()/printusage() which only emits a synopsis block. The
generic CI version probe therefore can't find PKG_VERSION and marks the
package as missing a version match.

Add a test-version.sh that exit-0's for all five subpackages to skip the
generic version check, and a test.sh that exercises each binary's
synopsis output as a basic functional smoke test.

Signed-off-by: Alexandru Ardelean <redacted>
utils/rtklib/test-version.sh [new file with mode: 0755]
utils/rtklib/test.sh [new file with mode: 0755]

diff --git a/utils/rtklib/test-version.sh b/utils/rtklib/test-version.sh
new file mode 100755 (executable)
index 0000000..db95657
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Generic version-check override.
+#
+# RTKLIB's command-line tools (convbin, pos2kml, rnx2rtkp, rtkrcv, str2str)
+# don't expose a --version flag; they print only a usage/synopsis block on
+# unrecognized options, with no PKG_VERSION string anywhere in the output.
+# The companion test.sh exercises actual invocation, so the generic version
+# probe has no value here. Emit a line containing PKG_VERSION so the CI
+# framework's "Version check override" passes.
+
+case "$1" in
+convbin|pos2kml|rnx2rtkp|rtkrcv|str2str)
+       echo "$1 $PKG_VERSION"
+       ;;
+*)
+       echo "Untested package: $1" >&2
+       exit 1
+       ;;
+esac
diff --git a/utils/rtklib/test.sh b/utils/rtklib/test.sh
new file mode 100755 (executable)
index 0000000..ec59e4d
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Functional smoke test for the RTKLIB command-line tools.
+#
+# Each tool prints a usage/synopsis block (containing its own name) to stderr
+# when invoked with an unrecognized option, then exits 0. We confirm the
+# binary runs in the target environment and produces the expected synopsis.
+
+bin="/usr/bin/$1"
+
+case "$1" in
+convbin|pos2kml|rnx2rtkp|rtkrcv|str2str)
+       [ -x "$bin" ] || {
+               echo "FAIL: $bin not found or not executable"
+               exit 1
+       }
+
+       # Any unknown '-' option triggers printhelp()/printusage(); rtkrcv
+       # exits 0, the others may exit non-zero — capture both streams and
+       # ignore the exit code, then look for the binary name in the output.
+       out=$("$bin" -? 2>&1 || true)
+       echo "$out" | grep -qF "$1" || {
+               echo "FAIL: $1 synopsis did not mention '$1'"
+               echo "$out"
+               exit 1
+       }
+       echo "$1: synopsis OK"
+       ;;
+*)
+       echo "Untested package: $1" >&2
+       exit 1
+       ;;
+esac
git clone https://git.99rst.org/PROJECT