From: Ian Jackson Date: Wed, 14 Jun 2023 23:36:29 +0000 (+0100) Subject: test/capture-log: Make it possible to disable capturing X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=3e77333d771988fe9496ed5900cebca9319dea67;p=hippotat.git test/capture-log: Make it possible to disable capturing When running in CI, we want everything to come out in one scrool. Signed-off-by: Ian Jackson --- diff --git a/test/capture-log b/test/capture-log index 4da14f2..3ab012e 100755 --- a/test/capture-log +++ b/test/capture-log @@ -5,6 +5,14 @@ set -e set -o pipefail +actually_capture () { + if [ "$BUILD_VERBOSE" ]; then + tee "$log" | sed "s#^#$log #" + else + cat >"$log" + fi +} + log="$1"; shift mkdir -p tmp -"$@" 2>&1 | ts >"$log" +"$@" 2>&1 | ts | actually_capture