hyperion.ng/test/testrunner.sh
redPanther 36124c9afb make blackboder component enable/disable at runtime (#228)
* make enable/disable of bborder work

* fix typo

* smoothing can be disabled via config again

* fix smoothing
2016-09-08 16:32:42 +02:00

62 lines
1002 B
Bash

#!/bin/bash
STATS_FAILED=0
STATS_SUCCESS=0
STATS_SKIPPED=0
STATS_TOTAL=0
# exec_test "test name" test_exec --with --args
function exec_test()
{
local test_name="$1"
if [ ! -e "$2" ]
then
echo "skip test: '$test_name'"
(( STATS_SKIPPED++ ))
return
fi
shift
(( STATS_TOTAL++ ))
echo "execute test: '$test_name'"
if $@
then
echo -e " ... success"
(( STATS_SUCCESS++ ))
return 0
else
echo -e " ... failed"
(( STATS_FAILED++ ))
return 1
fi
echo
}
######################################
## EXEC TESTS
cd build || exit 1
echo
echo "Hyperion test execution"
echo
exec_test "hyperiond is executable and show version" bin/hyperiond --version
for cfg in ../config/*json*
do
exec_test "test $(basename $cfg)" bin/test_configfile $cfg
done
echo
echo
echo "TEST SUMMARY"
echo "============"
echo " total: $STATS_TOTAL"
echo " success: $STATS_SUCCESS"
echo " skipped: $STATS_SKIPPED"
echo " failed: $STATS_FAILED"
sleep 2
[ $STATS_FAILED -gt 0 ] && exit 200
exit 0