mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
parent
c1e4a0a6fd
commit
5f973573bb
@ -12,5 +12,6 @@ before_install:
|
|||||||
- chmod +x ./.travis/travis_install.sh
|
- chmod +x ./.travis/travis_install.sh
|
||||||
- ./.travis/travis_install.sh
|
- ./.travis/travis_install.sh
|
||||||
script:
|
script:
|
||||||
- chmod +x ./.travis/travis_build.sh
|
- chmod +x ./.travis/travis_build.sh ./test/testrunner.sh
|
||||||
- ./.travis/travis_build.sh
|
- ./.travis/travis_build.sh
|
||||||
|
- ./test/testrunner.sh
|
||||||
|
@ -1,28 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
STATS_FAILED=0
|
|
||||||
STATS_SUCCESS=0
|
|
||||||
STATS_TOTAL=0
|
|
||||||
|
|
||||||
|
|
||||||
# exec_test "test name" test_exec --with --args
|
|
||||||
function exec_test()
|
|
||||||
{
|
|
||||||
local test_name="$1"
|
|
||||||
shift
|
|
||||||
(( STATS_TOTAL++ ))
|
|
||||||
echo "execute test: '$test_name'"
|
|
||||||
if $@
|
|
||||||
then
|
|
||||||
echo -e " ... success"
|
|
||||||
(( STATS_SUCCESS++ ))
|
|
||||||
else
|
|
||||||
echo -e " ... failed"
|
|
||||||
(( STATS_FAILED++ ))
|
|
||||||
fi
|
|
||||||
echo
|
|
||||||
}
|
|
||||||
|
|
||||||
# for executing in non travis environment
|
# for executing in non travis environment
|
||||||
[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$( uname -s | tr '[:upper:]' '[:lower:]' )"
|
[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$( uname -s | tr '[:upper:]' '[:lower:]' )"
|
||||||
|
|
||||||
@ -51,23 +28,3 @@ then
|
|||||||
make -j$(nproc) package || exit 4
|
make -j$(nproc) package || exit 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
######################################
|
|
||||||
## EXEC TESTS
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "Hyperion test execution"
|
|
||||||
echo
|
|
||||||
exec_test "hyperiond is executable and show version" bin/hyperiond --version
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo
|
|
||||||
echo "TEST SUMMARY"
|
|
||||||
echo "============"
|
|
||||||
echo " total: $STATS_TOTAL"
|
|
||||||
echo " success: $STATS_SUCCESS"
|
|
||||||
echo " failed: $STATS_FAILED"
|
|
||||||
|
|
||||||
[ $STATS_FAILED -gt 0 ] && exit 200
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
50
test/testrunner.sh
Normal file
50
test/testrunner.sh
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
STATS_FAILED=0
|
||||||
|
STATS_SUCCESS=0
|
||||||
|
STATS_TOTAL=0
|
||||||
|
|
||||||
|
|
||||||
|
# exec_test "test name" test_exec --with --args
|
||||||
|
function exec_test()
|
||||||
|
{
|
||||||
|
local test_name="$1"
|
||||||
|
shift
|
||||||
|
(( STATS_TOTAL++ ))
|
||||||
|
echo "execute test: '$test_name'"
|
||||||
|
if $@
|
||||||
|
then
|
||||||
|
echo -e " ... success"
|
||||||
|
(( STATS_SUCCESS++ ))
|
||||||
|
else
|
||||||
|
echo -e " ... failed"
|
||||||
|
(( STATS_FAILED++ ))
|
||||||
|
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 " failed: $STATS_FAILED"
|
||||||
|
|
||||||
|
[ $STATS_FAILED -gt 0 ] && exit 200
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user