tasn pushed a commit to branch master.

commit 6873cad582919cdad6a2c378358b2e1d9f54f680
Author: Tom Hacohen <[email protected]>
Date:   Fri Apr 26 14:01:10 2013 +0100

    Implement VERBOSE the same way as DEBUG.
---
 src/scripts/exactness.in | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/src/scripts/exactness.in b/src/scripts/exactness.in
index 8719eb6..27e26bd 100755
--- a/src/scripts/exactness.in
+++ b/src/scripts/exactness.in
@@ -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

-- 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr

Reply via email to