aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test-search-cgi.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-search-cgi.sh')
-rwxr-xr-xtest/test-search-cgi.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test-search-cgi.sh b/test/test-search-cgi.sh
index 7541a92..1667a43 100755
--- a/test/test-search-cgi.sh
+++ b/test/test-search-cgi.sh
@@ -37,6 +37,18 @@ set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SPINE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
+# sqlite3 is not required here: the parts that use it fall back to fixed probe
+# values and to skipping the schema version gate. Both are checks, though, and
+# a run that quietly leaves them out still says PASS, so where sqlite3 is
+# absent and nix is to hand, re-run inside a nix shell that has it. With
+# neither, the test runs as before and says what it skipped.
+if ! command -v sqlite3 > /dev/null 2>&1; then
+ if command -v nix > /dev/null 2>&1; then
+ echo "sqlite3 not on PATH, re-running inside nix shell \"nixpkgs#sqlite\""
+ exec nix shell "nixpkgs#sqlite" -c "$0" "$@"
+ fi
+fi
+
SPINE_BIN="${1:-}"
if [ -z "$SPINE_BIN" ]; then
if [ -x "$SPINE_DIR/result/bin/spine" ]; then SPINE_BIN="$SPINE_DIR/result/bin/spine"