diff options
| author | Egor Tensin <egor@tensin.name> | 2026-09-29 22:46:39 +0500 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-09-29 22:46:39 +0500 |
| commit | d6805caeed6f7d2a008af3227dc120e1c834440e (patch) | |
| tree | 9d803f786ed15d66d25bc81daf475375fd748905 /test/lib/log.sh | |
| parent | test: remove unnecessary global variables (diff) | |
| download | config-links-d6805caeed6f7d2a008af3227dc120e1c834440e.tar.gz config-links-d6805caeed6f7d2a008af3227dc120e1c834440e.zip | |
test: refactor out logging for calling executables
Diffstat (limited to 'test/lib/log.sh')
| -rw-r--r-- | test/lib/log.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lib/log.sh b/test/lib/log.sh index b26e16a..34124cf 100644 --- a/test/lib/log.sh +++ b/test/lib/log.sh @@ -10,6 +10,17 @@ log() { done } +log_run() { + if [ "$#" -lt 1 ]; then + log "usage: ${FUNCNAME[0]} ARGV0 [ARG...]" + return 1 + fi + + local msg='Running:' + msg="$msg$( printf -- ' %q' "$@" )" + log "$msg" +} + fail() { local msg for msg; do |
