Implement VERBOSE the same way as DEBUG.

This commit is contained in:
Tom Hacohen 2013-04-26 14:01:10 +01:00
parent 50cef78346
commit 6873cad582
1 changed files with 13 additions and 18 deletions

View File

@ -12,6 +12,13 @@ function DEBUG()
[ "$_DEBUG" == "on" ] && $@
}
function VERBOSE()
{
if $_verbose ; then
$@
fi
}
do_help () {
echo "Use $0 to test application screen-layout."
echo "First, you need to compose a tests file as follows:"
@ -127,10 +134,7 @@ do_record () {
return 0
fi
if [ "$_verbose" -ne 0 ]
then
echo "do_record: $_test_name"
fi
VERBOSE echo "do_record: $_test_name"
TSUITE_RECORDING='rec' TSUITE_BASE_DIR=${_base_dir} TSUITE_DEST_DIR=${_dest_dir} TSUITE_FILE_NAME=${_base_dir}/${_test_name}.rec TSUITE_TEST_NAME=${_test_name} LD_PRELOAD=${OUR_LIBPATH}/libexactness.so eval ${_test_cmd}
}
@ -153,10 +157,7 @@ do_simulation () {
fi
if [ "$_verbose" -ne 0 ]
then
echo "do_simulation: $_test_name"
fi
VERBOSE echo "do_simulation: $_test_name"
TSUITE_BASE_DIR=${_base_dir} TSUITE_DEST_DIR=${_dest_dir} TSUITE_FILE_NAME=${file_name} TSUITE_TEST_NAME=${_test_name} LD_PRELOAD=${OUR_LIBPATH}/libexactness.so eval ${_test_cmd}
}
@ -192,18 +193,12 @@ do_play () {
mkdir -p "$_dest_dir" &> /dev/null
fi
if [ "$_verbose" -ne 0 ]
then
echo "do_play: $_test_name"
fi
VERBOSE echo "do_play: $_test_name"
ELM_ENGINE="buffer" TSUITE_BASE_DIR=${_base_dir} TSUITE_DEST_DIR=${_dest_dir} TSUITE_FILE_NAME=${file_name} TSUITE_TEST_NAME=${_test_name} LD_PRELOAD=${OUR_LIBPATH}/libexactness.so eval ${_test_cmd}
}
compare_files () {
if [ "$_verbose" -ne 0 ]
then
echo "compare_files: <$1> and <$2>"
fi
VERBOSE echo "compare_files: <$1> and <$2>"
if [ -e "$1" ]
# First file exists
@ -343,7 +338,7 @@ name_in_args () {
# Script Entry Point
OUR_LIBPATH="@libdir@/exactness"
_verbose=0
_verbose=false
_record=
_play=
_compare=
@ -394,7 +389,7 @@ do
h) do_help
exit 0
;;
v) _verbose=1
v) _verbose=true
;;
?) do_help
exit 0