citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 1ff56267c35600f6fbf1236b59ae9688bc0790cd
parent a22216170b8c650f39df4cf1cc2557e36a118970
Author: Kyle Milz <kyle@0x30.net>
Date:   Fri, 19 Aug 2016 21:31:12 -0600

test: move total exec counting into function

Diffstat:
Mt/rt_dynamic.sh | 13+------------
Mtest/utils.sh | 21+++++++++++++++++++++
2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/t/rt_dynamic.sh b/t/rt_dynamic.sh @@ -7,18 +7,7 @@ echo 1..2 ./program 45 & pid=$! -let n=0 -let lst=0 -let cur=0 -let bad=0 -while [ $n -lt 60 ]; do - cur=`$TEST_TOOLS/citrun-dump -t` - [ $cur -lt $lst ] && let bad++ - let lst=cur - let n++ -done -[ $bad -eq 0 ] && echo ok 2 - program count increased 60 times - +test_total_execs 2 kill -USR1 $pid wait diff --git a/test/utils.sh b/test/utils.sh @@ -13,6 +13,27 @@ cd $tmpdir echo "ok 1 - tmp dir created" # +# Run citrun-dump -t 60 times and check that each time was greater than the last +# +function test_total_execs +{ + test_num=${1} + + let n=0 + let lst=0 + let cur=0 + let bad=0 + while [ $n -lt 60 ]; do + cur=`$TEST_TOOLS/citrun-dump -t` + [ $cur -le $lst ] && let bad++ + let lst=cur + let n++ + done + [ $bad -eq 0 ] && echo ok $test_num - program count increased 60 times +} + + +# # Differences two instrumented files. Knocks the header off of the "*.citrun" # file. #