diff options
| -rw-r--r-- | org/tests_for_document_abstraction_shell_scripts.org | 16 | ||||
| -rwxr-xr-x | test/test-abstraction-ssp.sh | 4 | ||||
| -rwxr-xr-x | test/test-search-cgi.sh | 12 |
3 files changed, 32 insertions, 0 deletions
diff --git a/org/tests_for_document_abstraction_shell_scripts.org b/org/tests_for_document_abstraction_shell_scripts.org index 30771be..932f1cd 100644 --- a/org/tests_for_document_abstraction_shell_scripts.org +++ b/org/tests_for_document_abstraction_shell_scripts.org @@ -232,6 +232,10 @@ fi echo "Generating current .ssp files..." rm -rf "$TMP_DIR" mkdir -p "$TMP_DIR" +# --abstraction is what puts this run in parallel: --show-abstraction on its +# own does not appear in spine's parallelise() list, so it runs serially and +# the parallel-vs-serial comparison below would compare a serial run with +# itself. Do not drop it. $SPINE_BIN --abstraction --show-abstraction --skip-output --output="$SCRIPT_DIR/current" "$SAMPLES_DIR"/* 2>&1 | tail -1 # flatten find "$SCRIPT_DIR/current" -name "*.ssp" ! -path "$TMP_DIR/*" -exec mv {} "$TMP_DIR/" \; @@ -973,6 +977,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" diff --git a/test/test-abstraction-ssp.sh b/test/test-abstraction-ssp.sh index 133cfb6..bb44d1c 100755 --- a/test/test-abstraction-ssp.sh +++ b/test/test-abstraction-ssp.sh @@ -104,6 +104,10 @@ fi echo "Generating current .ssp files..." rm -rf "$TMP_DIR" mkdir -p "$TMP_DIR" +# --abstraction is what puts this run in parallel: --show-abstraction on its +# own does not appear in spine's parallelise() list, so it runs serially and +# the parallel-vs-serial comparison below would compare a serial run with +# itself. Do not drop it. $SPINE_BIN --abstraction --show-abstraction --skip-output --output="$SCRIPT_DIR/current" "$SAMPLES_DIR"/* 2>&1 | tail -1 # flatten find "$SCRIPT_DIR/current" -name "*.ssp" ! -path "$TMP_DIR/*" -exec mv {} "$TMP_DIR/" \; 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" |
