mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 15:41:54 +00:00
Birdtest: Improve a tests lancher script
This commit is contained in:
parent
9a49b70d1b
commit
8f5f52838e
@ -23,3 +23,4 @@ distclean: clean
|
||||
|
||||
clean-tests:
|
||||
find . -name '*_test' | xargs rm -f
|
||||
rm -f $(objdir)/test/birdtest.o
|
@ -13,10 +13,19 @@ num_succ_tests=0
|
||||
num_fail_tests=0
|
||||
echo -e " == Start all $num_all_tests unit tests ==\n"
|
||||
for test in $all_tests ; do
|
||||
echo -e " [$((num_test++))/$num_all_tests] $test"
|
||||
./$test \
|
||||
&& num_succ_tests=$((num_succ_tests+1)) \
|
||||
|| num_fail_tests=$((num_fail_tests+1))
|
||||
./$test ; exit_code=$?
|
||||
cols=$(tput cols)
|
||||
offset=$((cols-17))
|
||||
fmt=" [%2d/%-2d] %-${offset}s"
|
||||
printf "$fmt" $((num_test++)) $num_all_tests "$test"
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
printf "[\e[1;32m OK \e[0m]"
|
||||
num_succ_tests=$((num_succ_tests+1))
|
||||
else
|
||||
printf "[\e[1;31mFAIL\e[0m]"
|
||||
num_fail_tests=$((num_fail_tests+1))
|
||||
fi
|
||||
printf "\n"
|
||||
done
|
||||
|
||||
num_all_tests_src=0
|
||||
|
Loading…
Reference in New Issue
Block a user