11#! /bin/sh -eu
2-
2+
3+ # see also (taken from) .github/scripts/Linux/utils/Dockerfile.ubuntu
4+ ubuntu_packages="
5+ libasound2t64\
6+ libegl1\
7+ libfontconfig1\
8+ libglx-mesa0\
9+ libgmp10\
10+ libharfbuzz0b\
11+ libopengl0\
12+ libp11-kit0\
13+ libx11-6\
14+ openbox\
15+ xvfb"
16+
317case " $RUNNER_OS " in
418 Linux)
19+ sudo apt update
20+ sudo apt -y install $ubuntu_packages
21+ Xvfb :99 -screen 0 1920x1080x24 &
22+ export DISPLAY=:99
23+ openbox &
24+
525 ug_build=UltraGrid-continuous-x86_64.AppImage
626 prepare () {
727 chmod +x " $ug_build "
@@ -33,11 +53,9 @@ prepare
3353
3454# # used by run_test_data.sh
3555# # @param $1 args
36- # # @param $2 timeout (optional, default 5)
37- # # @param $3 opts (optional) - should_fail
56+ # # @param $2 opts (optional) - should_fail, should_timeout
3857add_test () {
3958 eval " test_${test_count} _args=\$ {1?}"
40- eval " test_${test_count} _timeout=\$ {2:-5}"
4159 eval " test_${test_count} _opts=\$ {3-}"
4260 test_count=$(( test_count + 1 ))
4361}
@@ -49,19 +67,19 @@ set +e
4967i=0
5068while [ $i -lt $test_count ]; do
5169 eval " args=\$ test_${i} _args"
52- eval " timeout=\$ test_${i} _timeout"
5370 eval " opts=\$ test_${i} _opts"
5471
55- timeout " $timeout " " $run " " $args "
72+ timeout=5
73+ timeout $timeout " $run " $args
5674 rc=$?
5775
5876 if [ $rc = 124 ]; then
59- printf " UG with arguments %s timeout (limit: %d sec)!\n " \
60- " $args " " $ timeout"
61- exit 1
62- fi
63-
64- if expr -- " $opts " : ' .*should_fail' > /dev/null; then
77+ if ! expr -- " $opts " : ' .*should_timeout ' > /dev/null ; then
78+ printf " UG with arguments %s timeout (limit: %d sec)!\n " \
79+ " $args " " $timeout "
80+ exit 1
81+ fi
82+ elif expr -- " $opts " : ' .*should_fail' > /dev/null; then
6583 if [ $rc -eq 0 ]; then
6684 printf " UG with arguments %s should have failed but\
6785 returned 0!\n" " $args "
0 commit comments