X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Funit_test.sh;h=2f30686d344780f5e4964eb04b59e249dcd1ec6e;hb=97204c8a0eb213af5f4c656cd30f1ecf82c8a520;hp=9e0564bb2494a8c7cc796556aa77087f7f3e5984;hpb=4e4fb5021cc9aa67390f6641a060b85c077a1880;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/test/unit_test.sh b/test/unit_test.sh index 9e0564b..2f30686 100755 --- a/test/unit_test.sh +++ b/test/unit_test.sh @@ -30,14 +30,14 @@ # Make a list of our modules under test so that we don't look at gcov # files that are generated for system lib headers in /usr/* -# (bash makes the process of building a list of names harder than it +# (bash makes the process of building a list of names harder than it # needs to be, so use caution with the printf() call.) # function mk_list { grep -l "Source:\.\./src" *.gcov | while read f do printf "$f " # do NOT use echo or add \n! - done + done } function abort_if_error { @@ -70,18 +70,31 @@ do shift done +export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH +export LIBRARY_PATH=/usr/local/lib:$LIBRARY_PATH + make nuke >/dev/null -make unit_test >/tmp/PID$$.log 2>&1 +make tests >/tmp/PID$$.log 2>&1 abort_if_error $? "unable to make" +echo "tests successfully built" >&2 spew="cat" -./unit_test >/tmp/PID$$.log 2>&1 -abort_if_error $? "unit test failed" -gcov unit_test >/tmp/PID$$.gcov_log 2>&1 # suss out our gcov files +for x in unit_test jhash_test +do + ./$x >/tmp/PID$$.log 2>&1 + abort_if_error $? "test failed: $x" + gcov $x.c >/dev/null 2>&1 +done + +# wrapper_test is driven by jhash_test, but must be covered explicitly +gcov jwrapper_test.c >/dev/null 2>&1 + ./scrub_gcov.sh # remove cruft list=$( mk_list ) +echo "" +echo "[INFO] coverage stats, discounted (raw), for the various modules:" ./parse_gcov.sh $list # generate simple, short, coverage stats rm -f /tmp/PID$$.*