fix(rtable): Potential memory leak in rte replace
[ric-plt/lib/rmr.git] / test / app_test / run_app_test.ksh
index 7ad4934..90ef2cf 100644 (file)
@@ -73,16 +73,18 @@ nano_sender=0                               # start nano version if set (-N)
 nano_receiver=0
 wait=1
 rebuild=0
+verbose=0
 
 while [[ $1 == -* ]]
 do
-       case $1 in 
+       case $1 in
                -B)     rebuild=1;;
                -d)     delay=$2; shift;;
                -N)     nano_sender=1
                        nano_receiver=1
                        ;;
                -n)     nmsg=$2; shift;;
+               -v)     verbose=1;;
 
                *)      echo "unrecognised option: $1"
                        echo "usage: $0 [-B] [-d micor-sec-delay] [-N] [-n num-msgs]"
@@ -94,23 +96,18 @@ do
        shift
 done
 
-if (( rebuild )) 
+if (( verbose ))
 then
-       build_path=../../.build
+       echo "2" >.verbose
+       export RMR_VCTL_FILE=".verbose"
+fi
 
-       (
-               set -e
-               mkdir -p $build_path
-               cd ${build_path%/*}                             # cd barfs on ../../.build, so we do this
-               cd ${build_path##*/}
-               cmake ..
-               make package
-       )
-       if (( $? != 0 ))
-       then
-               echo "build failed"
-               exit 1
-       fi
+if (( rebuild ))
+then
+       build_path=../../.build
+       set -e
+       ksh ./rebuild.ksh
+       set +e
 else
        build_path=${BUILD_PATH:-"../../.build"}        # we prefer .build at the root level, but allow user option
 
@@ -122,7 +119,13 @@ else
        fi
 fi
 
-export LD_LIBRARY_PATH=$build_path:$build_path/lib
+if [[ -d $build_path/lib64 ]]
+then
+       export LD_LIBRARY_PATH=$build_path:$build_path/lib64
+else
+       export LD_LIBRARY_PATH=$build_path:$build_path/lib
+fi
+
 export LIBRARY_PATH=$LD_LIBRARY_PATH
 export RMR_SEED_RT=${RMR_SEED_RT:-./local.rt}          # allow easy testing with different rt
 
@@ -137,6 +140,7 @@ then
 fi
 
 run_rcvr &
+sleep 2                                # if sender starts faster than rcvr we can drop, so pause a bit
 run_sender &
 
 wait
@@ -151,6 +155,7 @@ else
 fi
 
 rm /tmp/PID$$.*
+rm -f .verbose
 
 exit $(( !! (src + rrc) ))