Cleanup listener based on sonar grumblings
[ric-app/mc.git] / sidecars / listener / test / run_unit_test.ksh
similarity index 95%
rename from sidecars/listener/run_unit_test.ksh
rename to sidecars/listener/test/run_unit_test.ksh
index fc099d0..e027583 100755 (executable)
@@ -68,6 +68,11 @@ function purge_dirs {
 # woudl do (but seems not to).
 #
 function ensure_pkgs {
+       if (( no_rmr_load ))
+       then
+               return
+       fi
+
        if (( force_rmr_load )) || [[ -d /usr/local/include/rmr ]]
        then
                echo "[INFO] found RMR installed in /usr/local"
@@ -127,6 +132,7 @@ while [[ $1 == -* ]]
 do
        case $1 in
                -f)     force_rmr_load=1;;
+               -N) no_rmr_load=1;;                                     # for local testing
 
                *)      echo "unrecognised option: $1"
                        exit 1
@@ -205,7 +211,7 @@ then
 fi
 
 
-show_coverage.ksh unit_test.c                                                          # compute coverage and generate .gcov files
+./show_coverage.ksh unit_test.c                                                                # compute coverage and generate .gcov files
 echo "Coverage with discounting (raw values in parens)"
 ./discount_chk.ksh $(ls *gcov|egrep -v "^test_|unit_test.c")
 
@@ -218,5 +224,7 @@ else
        rm -f *test*.gcov
 fi
 
+cp *.gcov ../                          # the CI job defines the listener dir as the spot to find these, so put them there
+
 rm -f /tmp/PID$$.*
 exit $rc