mirror of
https://github.com/xroche/httrack.git
synced 2026-07-28 19:43:02 +03:00
* Match captured output with a here-string, not a pipe into grep -q grep -q exits on the first match, so whatever the producer still had to write takes SIGPIPE; under pipefail that becomes the pipeline's status and an assertion that held reports failure. bash issues one write() per line, so any match that is not on the last line is exposed. Converts every test assertion whose producer is a shell builtin or shell function, including two pipelines used as an if condition where the SIGPIPE silently flips the branch. Generalizes the AGENTS.md bullet, which only covered the "&& fail" spelling. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com> * Convert the remaining pipe-into-grep -q sites The self-test drivers survive only because the matched line is the last thing httrack prints; one added line of output turns a pass into 141. Nothing in tests/ pipes into grep -q now. The two zlib drivers claimed the harness might run them under a POSIX /bin/sh: it does not. configure resolves $(BASH) to bash, test-timeout.sh execs it, and 01_zlib-warc-wacz.test already uses "set -o pipefail" (which dash lacks) on the macOS leg. Kept the half that is true, BSD tool flags. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com> --------- Signed-off-by: Xavier Roche <roche@httrack.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
9 lines
211 B
Bash
9 lines
211 B
Bash
#!/bin/bash
|
|
#
|
|
# a log callback consumed the va_list the log file's vfprintf() still needed (#801).
|
|
|
|
set -euo pipefail
|
|
|
|
out=$(httrack -O /dev/null -#test=logcallback)
|
|
grep -q "logcallback self-test OK" <<<"$out"
|