0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-10-18 09:58:43 +00:00
bird/tools/run_tests.sh
Pavel Tvrdík f26cf70152 Birdtest: Refactore tests and build system
Rename directory:
  birdtest/* -> test/*

Rename Makefile rule:
  build-tests -> tests

Move run-all-test shell script from Makefile to stand-alone shell script

Simplify Makefile test build system
2015-03-23 17:40:13 +01:00

32 lines
835 B
Bash
Executable File

#!/bin/sh
objdir=$1
srcdir=$2
all_tests=$(find $objdir -name '*_test')
num_all_tests=0
for i in $all_tests; do num_all_tests=$((num_all_tests + 1)); done
num_test=1
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))
done
num_all_tests_src=0
for i in $(find $srcdir -name '*_test.c'); do num_all_tests_src=$((num_all_tests_src + 1)); done
num_build_fail_tests=$((num_all_tests_src - num_all_tests))
echo ""
echo " ------------------------------"
echo " Success: $num_succ_tests"
echo " Failure: $num_fail_tests"
echo " Build-Failure: $num_build_fail_tests"
echo " ------------------------------"