2016-07-17 18:45:42 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-07-09 23:07:31 +02:00
|
|
|
[ "${BUILD_TYPE}" == "Release" ] && exit 0
|
|
|
|
|
2016-07-17 18:45:42 +02:00
|
|
|
STATS_FAILED=0
|
|
|
|
STATS_SUCCESS=0
|
2016-09-08 16:32:42 +02:00
|
|
|
STATS_SKIPPED=0
|
2016-07-17 18:45:42 +02:00
|
|
|
STATS_TOTAL=0
|
|
|
|
|
|
|
|
# exec_test "test name" test_exec --with --args
|
|
|
|
function exec_test()
|
|
|
|
{
|
|
|
|
local test_name="$1"
|
2016-09-07 22:27:43 +02:00
|
|
|
if [ ! -e "$2" ]
|
|
|
|
then
|
|
|
|
echo "skip test: '$test_name'"
|
2016-09-08 16:32:42 +02:00
|
|
|
(( STATS_SKIPPED++ ))
|
2016-09-07 22:27:43 +02:00
|
|
|
return
|
|
|
|
fi
|
2016-07-17 18:45:42 +02:00
|
|
|
shift
|
|
|
|
(( STATS_TOTAL++ ))
|
|
|
|
echo "execute test: '$test_name'"
|
|
|
|
if $@
|
|
|
|
then
|
|
|
|
echo -e " ... success"
|
|
|
|
(( STATS_SUCCESS++ ))
|
2016-08-23 20:07:12 +02:00
|
|
|
return 0
|
2016-07-17 18:45:42 +02:00
|
|
|
else
|
|
|
|
echo -e " ... failed"
|
|
|
|
(( STATS_FAILED++ ))
|
2016-08-23 20:07:12 +02:00
|
|
|
return 1
|
2016-07-17 18:45:42 +02:00
|
|
|
fi
|
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
|
|
|
######################################
|
2019-07-09 23:07:31 +02:00
|
|
|
############# EXEC TESTS #############
|
|
|
|
######################################
|
|
|
|
|
2016-07-17 18:45:42 +02:00
|
|
|
cd build || exit 1
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Hyperion test execution"
|
|
|
|
echo
|
|
|
|
exec_test "hyperiond is executable and show version" bin/hyperiond --version
|
2016-08-23 20:07:12 +02:00
|
|
|
|
2019-07-09 23:07:31 +02:00
|
|
|
for cfg in ../config/*json.default
|
2016-07-17 18:45:42 +02:00
|
|
|
do
|
|
|
|
exec_test "test $(basename $cfg)" bin/test_configfile $cfg
|
|
|
|
done
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo "TEST SUMMARY"
|
|
|
|
echo "============"
|
2019-07-09 23:07:31 +02:00
|
|
|
echo " total: $STATS_TOTAL"
|
|
|
|
echo "success: $STATS_SUCCESS"
|
|
|
|
echo "skipped: $STATS_SKIPPED"
|
|
|
|
echo " failed: $STATS_FAILED"
|
2016-07-17 18:45:42 +02:00
|
|
|
|
2016-08-11 07:13:55 +02:00
|
|
|
sleep 2
|
|
|
|
|
2016-07-17 18:45:42 +02:00
|
|
|
[ $STATS_FAILED -gt 0 ] && exit 200
|
|
|
|
exit 0
|