/
githubmirror
/
strace
Обзор
Документация
Войти
/
githubmirror
/
strace
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/strace--color-tty.test
39 строк
858 B
Dmitry V. Levin
tests: robustify strace--color-tty.test
16 апр 2026, 11:00
16 апр 2026, 11:00
a91e4cb
Код
Авторство
О чём код?
#!/bin/sh -efu # # Check --color=auto with a tty. # # Copyright (c) 2026 Dmitry V. Levin <ldv@strace.io> # Copyright (c) 2026 The strace developers. # All rights reserved. # # SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" unset STRACE_COLORS unset NO_COLOR TERM=linux export TERM check_prog script run_prog ../getpid > /dev/null cmd="../getpid > /dev/null" set -- script -q -e -c "$cmd" /dev/null "$@" || framework_skip_ "$* failed with code $?" csi="$(printf '\033\\[')" printf '%s\n' ".*${csi}33mgetpid.*${csi}0m.*" > "$EXP" cmd="$STRACE --trace=getpid $cmd" set -- script -q -e -c "$cmd" /dev/null "$@" > "$LOG" || dump_log_and_fail_with "$* failed with code $?" match_grep "$LOG" "$EXP" TERM=dumb printf '%s\n' "!.*${csi}.*" > "$EXP" "$@" > "$LOG" || dump_log_and_fail_with "$* failed with code $?" match_grep "$LOG" "$EXP"