X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Funit_test.ksh;h=f74e4382414f83915b772b5d9490b5bae26d31cc;hb=f68c2ced7de2bdfc475a9282cde91a67d83325de;hp=929976ce4491348b4017c9d3dfab5a24258e21e6;hpb=5efb1e608cf966752c02b676d6fae09f951f71e9;p=ric-plt%2Flib%2Frmr.git diff --git a/test/unit_test.ksh b/test/unit_test.ksh index 929976c..f74e438 100755 --- a/test/unit_test.ksh +++ b/test/unit_test.ksh @@ -305,22 +305,24 @@ function mk_xml { # ----------------------------------------------------------------------------------------------------------------- # we assume that the project has been built in the ../[.]build directory -if [[ -d ../build/lib ]] +if [[ -d ../build ]] then - export LD_LIBRARY_PATH=../build/lib + export LD_LIBRARY_PATH=../build/lib:../build/lib64 else - if [[ -d ../.build/lib ]] + if [[ -d ../.build ]] then - export LD_LIBRARY_PATH=../.build/lib + export LD_LIBRARY_PATH=../.build/lib:../.build/lib64 export C_INCLUDE_PATH=../.build/include else - echo "[WARN] cannot find ../[.]build/lib; things might not work" + echo "[WARN] cannot find build directory (tried ../build and ../.build); things might not work" echo "" fi fi -export C_INCLUDE_PATH="../src/common/include:$C_INCLUDE_PATH" +export LIBRARY_PATH=$LD_LIBRARY_PATH + +export C_INCLUDE_PATH="../src/rmr/common/include:$C_INCLUDE_PATH" module_cov_target=80 builder="make -B %s" # default to plain ole make @@ -331,6 +333,7 @@ show_output=0 # show output from each test execution (-S) quiet=0 gen_xml=0 replace_flags=1 # replace ##### in gcov for discounted lines +run_nano_tests=0 while [[ $1 == "-"* ]] do @@ -338,6 +341,7 @@ do -C) builder="$2"; shift;; # custom build command -G) builder="gmake %s";; -M) builder="mk -a %s";; # use plan-9 mk (better, but sadly not widly used) + -N) run_nano_tests=1;; -c) module_cov_target=$2; shift;; -f) force_discounting=1; @@ -353,7 +357,7 @@ do -x) gen_xml=1 force_discounting=1 trigger_discount_str="WARN|FAIL|PASS" # check all outcomes for each module - rm *cov.xml + rm -fr *cov.xml ;; -h) usage; exit 0;; @@ -389,6 +393,11 @@ then do if [[ $tfile != *"static_test.c" ]] then + if(( ! run_nano_tests )) && [[ $tfile == *"nano"* ]] + then + continue + fi + flist="${flist}$tfile " fi done @@ -397,7 +406,7 @@ else fi -rm *.gcov # ditch the previous coverage files +rm -fr *.gcov # ditch the previous coverage files ut_errors=0 # unit test errors (not coverage errors) errors=0 @@ -427,6 +436,11 @@ do add_ignored_func test_nng_em.c # the nng/nano emulated things for f in *_static_test.c # all static modules here do + if(( ! run_nano_tests )) && [[ $f == *"nano"* ]] + then + continue + fi + add_ignored_func $f done