From 9668644fcf14902627e7e894073ca80669aec2f0 Mon Sep 17 00:00:00 2001 From: pithikos Date: Tue, 13 Jan 2015 10:10:06 +0000 Subject: [PATCH] Nicer output --- tests/memleaks | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/memleaks b/tests/memleaks index 50c6b1c..b93b9fe 100755 --- a/tests/memleaks +++ b/tests/memleaks @@ -31,9 +31,9 @@ function test_thread_free { #threads # This is the same with test_many_thread_allocs but multiplied function test_thread_free_multi { #threads #times echo "Testing multiple threads creation and destruction in pool(threads=$1 times=$2)" - echo "(this might take a while)" gcc src/no_work.c ../thpool.c -pthread -o test for ((i = 1; i <= $2; i++)); do + python -c "import sys; sys.stdout.write('$i/$2\r')" output=$(valgrind --leak-check=full --track-origins=yes ./test "$1" 2>&1 > /dev/null) heap_usage=$(echo "$output" | grep "total heap usage") allocs=$(extract_num "[0-9]* allocs" "$heap_usage") @@ -44,8 +44,9 @@ function test_thread_free_multi { #threads #times if (( "$allocs" != "$frees" )); then err "Allocated $allocs times but freed only $frees" "$output" fi - echo "Allocs: $allocs Frees: $frees" + #echo "Allocs: $allocs Frees: $frees" done + echo }