mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-20 00:09:01 +00:00
add semi-weekly CI tests
for additional testing in addition to what is done by dist check tested is eg. the Reed-Solomon problem that occured between 1.8.5 and 1.8.6
This commit is contained in:
117
.github/scripts/run_scheduled_tests.sh
vendored
Executable file
117
.github/scripts/run_scheduled_tests.sh
vendored
Executable file
@@ -0,0 +1,117 @@
|
||||
#!/bin/sh -eu
|
||||
#
|
||||
# THis scripts is called by .github/workflows/semi-weeekly_tests.yml
|
||||
# The idea is to do some further functional UltraGrid tests
|
||||
|
||||
# see also (taken from) .github/scripts/Linux/utils/Dockerfile.ubuntu
|
||||
ubuntu_packages="
|
||||
libasound2t64\
|
||||
libegl1\
|
||||
libfontconfig1\
|
||||
libglx-mesa0\
|
||||
libgmp10\
|
||||
libharfbuzz0b\
|
||||
libopengl0\
|
||||
libp11-kit0\
|
||||
libx11-6\
|
||||
openbox\
|
||||
xvfb"
|
||||
|
||||
case "$RUNNER_OS" in
|
||||
Linux)
|
||||
sudo apt update
|
||||
sudo apt -y install $ubuntu_packages
|
||||
Xvfb :99 -screen 0 1920x1080x24 &
|
||||
export DISPLAY=:99
|
||||
openbox &
|
||||
|
||||
ug_build=UltraGrid-continuous-x86_64.AppImage
|
||||
prepare() {
|
||||
chmod +x "$ug_build"
|
||||
./"$ug_build" --appimage-extract
|
||||
}
|
||||
run_uv=squashfs-root/AppRun
|
||||
run_reflector="squashfs-root/AppRun -o hd-rum-transcode"
|
||||
;;
|
||||
Windows)
|
||||
ug_build=UltraGrid-continuous-win64.zip
|
||||
prepare() {
|
||||
unzip "$ug_build"
|
||||
}
|
||||
run_uv=UltraGrid-continuous-win64/uv.exe
|
||||
run_reflector=UltraGrid-continuous-win64/hd-rum-transcode.exe
|
||||
;;
|
||||
macOS)
|
||||
ug_build=UltraGrid-continuous-arm64.dmg
|
||||
prepare() {
|
||||
hdiutil mount "$ug_build"
|
||||
}
|
||||
brew install coreutils
|
||||
alias timeout=gtimeout
|
||||
run_uv=/Volumes/ULTRAGRID/uv-qt.app/Contents/MacOS/uv
|
||||
run_reflector=/Volumes/ULTRAGRID/uv-qt.app/Contents/MacOS/\
|
||||
hd-rum-transcode
|
||||
esac
|
||||
|
||||
curl -LOf https://github.com/CESNET/UltraGrid/releases/download/continuous/\
|
||||
"$ug_build"
|
||||
|
||||
prepare
|
||||
|
||||
## used by run_test_data.sh
|
||||
## @param $1 args
|
||||
## @param $2 opts (optional, separated by comma):
|
||||
## - should_fail - expected outcome of the command is failure
|
||||
## - should_timeout - the command is expected to keep running
|
||||
## (will be terminated by timeout)
|
||||
## - run_reflector - instead of uv, pass the args to hd-rum-transcode
|
||||
add_test() {
|
||||
eval "test_${test_count}_args=\${1?}"
|
||||
eval "test_${test_count}_opts=\${2-}"
|
||||
test_count=$((test_count + 1))
|
||||
}
|
||||
|
||||
test_count=0
|
||||
. "$(dirname "$0")"/run_scheduled_tests_data.sh
|
||||
|
||||
set +e
|
||||
i=0
|
||||
while [ $i -lt $test_count ]; do
|
||||
eval "args=\$test_${i}_args"
|
||||
eval "opts=\$test_${i}_opts"
|
||||
|
||||
exec=$run_uv
|
||||
tool=uv
|
||||
if expr -- "$opts" : '.*run_reflector' >/dev/null; then
|
||||
tool=reflector
|
||||
exec=$run_reflector
|
||||
fi
|
||||
|
||||
timeout=5
|
||||
timeout $timeout $exec $args
|
||||
rc=$?
|
||||
|
||||
if [ $rc = 124 ]; then
|
||||
if ! expr -- "$opts" : '.*should_timeout' >/dev/null; then
|
||||
printf "$tool with arguments %s timeout (limit: %d sec)!\n" \
|
||||
"$args" "$timeout"
|
||||
exit 1
|
||||
fi
|
||||
elif expr -- "$opts" : '.*should_fail' >/dev/null; then
|
||||
if [ $rc -eq 0 ]; then
|
||||
printf "$tool with arguments %s should have failed but\
|
||||
returned 0!\n" "$args"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
if [ $rc -ne 0 ]; then
|
||||
printf "$tool with arguments %s returned %d but should have\
|
||||
succeeeded!\n" "$args" "$rc"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
14
.github/scripts/run_scheduled_tests_data.sh
vendored
Normal file
14
.github/scripts/run_scheduled_tests_data.sh
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# test cases for run_scheduled_tests.sh
|
||||
#
|
||||
# For the documentation of add_test parameters see the
|
||||
# run_scheduled_tests.sh file.
|
||||
|
||||
# UltraGrid
|
||||
add_test -v # basic sanity test
|
||||
add_test --nonexistent-param should_fail
|
||||
add_test "-d sdl" should_timeout
|
||||
add_test "-t testcard -c lavc:e=libx265 -f rs -d dummy" should_timeout
|
||||
|
||||
# reflector
|
||||
add_test -v run_reflector # basic sanity test
|
||||
add_test "8M 5004" run_reflector,should_timeout
|
||||
Reference in New Issue
Block a user