Code Review
/
ric-plt
/
lib
/
rmr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Address multi-threading issues in SI95
[ric-plt/lib/rmr.git]
/
test
/
unit_test.ksh
diff --git
a/test/unit_test.ksh
b/test/unit_test.ksh
index
7b5d6a8
..
08811f6
100755
(executable)
--- a/
test/unit_test.ksh
+++ b/
test/unit_test.ksh
@@
-333,6
+333,11
@@
show_output=0 # show output from each test execution (-S)
quiet=0
gen_xml=0
replace_flags=1 # replace ##### in gcov for discounted lines
quiet=0
gen_xml=0
replace_flags=1 # replace ##### in gcov for discounted lines
+run_nano_tests=0
+
+export RMR_WARNING=1 # turn on warnings
+
+ulimit -c unlimited
while [[ $1 == "-"* ]]
do
while [[ $1 == "-"* ]]
do
@@
-340,8
+345,10
@@
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)
-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;;
-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
;;
-f) force_discounting=1;
trigger_discount_str="WARN|FAIL|PASS" # check all outcomes for each module
;;
@@
-391,6
+398,11
@@
then
do
if [[ $tfile != *"static_test.c" ]]
then
do
if [[ $tfile != *"static_test.c" ]]
then
+ if(( ! run_nano_tests )) && [[ $tfile == *"nano"* ]]
+ then
+ continue
+ fi
+
flist="${flist}$tfile "
fi
done
flist="${flist}$tfile "
fi
done
@@
-429,17
+441,31
@@
do
add_ignored_func test_nng_em.c # the nng/nano emulated things
for f in *_static_test.c # all static modules here
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
if ! ./${tfile%.c} >/tmp/PID$$.log 2>&1
then
echo "[FAIL] unit test failed for: $tfile"
add_ignored_func $f
done
if ! ./${tfile%.c} >/tmp/PID$$.log 2>&1
then
echo "[FAIL] unit test failed for: $tfile"
- if
(( quiet ))
+ if
[[ -n $capture_file ]]
then
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 "^<FAIL>" /tmp/PID$$.log
+ echo ""
else
else
- cat /tmp/PID$$.log
+ if (( quiet ))
+ then
+ grep "^<" /tmp/PID$$.log|grep -v "^<EM>" # 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
fi
(( ut_errors++ )) # cause failure even if not in strict mode
continue # skip coverage tests for this