X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=test%2Funit_test.ksh;h=08811f604193b6f66845dbc2f8099a8f582f8385;hb=6d112571b27574ae857da7cb8dc8758ffee4ff60;hp=214f94d9c6cdf394e1e3583600e0aa7002becd99;hpb=6511ac74cdc367a94bffeb3743624775acd52c5b;p=ric-plt%2Flib%2Frmr.git diff --git a/test/unit_test.ksh b/test/unit_test.ksh index 214f94d..08811f6 100755 --- a/test/unit_test.ksh +++ b/test/unit_test.ksh @@ -337,6 +337,8 @@ run_nano_tests=0 export RMR_WARNING=1 # turn on warnings +ulimit -c unlimited + while [[ $1 == "-"* ]] do case $1 in @@ -346,6 +348,7 @@ do -N) run_nano_tests=1;; -c) module_cov_target=$2; shift;; + -e) capture_file=$2; >$capture_file; shift;; # capture errors from failed tests rather than spewing on tty -f) force_discounting=1; trigger_discount_str="WARN|FAIL|PASS" # check all outcomes for each module ;; @@ -449,11 +452,20 @@ do if ! ./${tfile%.c} >/tmp/PID$$.log 2>&1 then echo "[FAIL] unit test failed for: $tfile" - if (( quiet )) + if [[ -n $capture_file ]] then - grep "^<" /tmp/PID$$.log # in quiet mode just dump <...> messages which are assumed from the test programme not appl + echo "all errors captured in $capture_file, listing only fail message on tty" + echo "$tfile --------------------------------------" >>$capture_file + cat /tmp/PID$$.log >>$capture_file + grep "^" /tmp/PID$$.log + echo "" else - cat /tmp/PID$$.log + if (( quiet )) + then + grep "^<" /tmp/PID$$.log|grep -v "^" # in quiet mode just dump <...> messages which are assumed from the test programme not appl + else + cat /tmp/PID$$.log + fi fi (( ut_errors++ )) # cause failure even if not in strict mode continue # skip coverage tests for this