- added some color
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1135 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
3bc3b4f6d5
commit
f41586b731
|
@ -51,6 +51,17 @@ if [ -z "$__p15init__" ]; then
|
||||||
p15init="$p15init --reader $P15_READER"
|
p15init="$p15init --reader $P15_READER"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Get terminal control sequences
|
||||||
|
if tty >/dev/null 2>&1; then
|
||||||
|
__red=`tput setaf 1`
|
||||||
|
__green=`tput setaf 2`
|
||||||
|
__black=`tput setaf 0`
|
||||||
|
else
|
||||||
|
__red=
|
||||||
|
__green=
|
||||||
|
__black=
|
||||||
|
fi
|
||||||
|
|
||||||
# Redirect output to log file, but keep copies of
|
# Redirect output to log file, but keep copies of
|
||||||
# stdout/stderr descriptors on fd 3 and 4
|
# stdout/stderr descriptors on fd 3 and 4
|
||||||
exec 3>&1 4>&2 >$p15log 2>&1
|
exec 3>&1 4>&2 >$p15log 2>&1
|
||||||
|
@ -68,7 +79,7 @@ function atexit {
|
||||||
if ! $test_failed; then
|
if ! $test_failed; then
|
||||||
msg <<-EOF
|
msg <<-EOF
|
||||||
:::
|
:::
|
||||||
::: Test set completed successfully
|
::: ${__green}Test set completed successfully${__black}
|
||||||
:::
|
:::
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
@ -102,7 +113,7 @@ function yesno {
|
||||||
function fail {
|
function fail {
|
||||||
|
|
||||||
(
|
(
|
||||||
echo "*** $*"
|
echo "*** ${__red}$*${__black}"
|
||||||
if [ -f $p15log ]; then
|
if [ -f $p15log ]; then
|
||||||
echo "--- Command output ---"
|
echo "--- Command output ---"
|
||||||
cat $p15log
|
cat $p15log
|
||||||
|
|
Loading…
Reference in New Issue