Skip to content

Commit b8d4835

Browse files
committed
tmp
1 parent 5f2db73 commit b8d4835

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

.github/scripts/run_tests.sh

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
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+
317
case "$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"
@@ -34,7 +54,7 @@ prepare
3454
## used by run_test_data.sh
3555
## @param $1 args
3656
## @param $2 timeout (optional, default 5)
37-
## @param $3 opts (optional) - should_fail
57+
## @param $3 opts (optional) - should_fail, should_timeout
3858
add_test() {
3959
eval "test_${test_count}_args=\${1?}"
4060
eval "test_${test_count}_timeout=\${2:-5}"
@@ -52,16 +72,16 @@ while [ $i -lt $test_count ]; do
5272
eval "timeout=\$test_${i}_timeout"
5373
eval "opts=\$test_${i}_opts"
5474

55-
timeout "$timeout" "$run" "$args"
75+
timeout "$timeout" "$run" $args
5676
rc=$?
5777

5878
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
79+
if ! expr -- "$opts" : '.*should_timeout' >/dev/null; then
80+
printf "UG with arguments %s timeout (limit: %d sec)!\n" \
81+
"$args" "$timeout"
82+
exit 1
83+
fi
84+
elif expr -- "$opts" : '.*should_fail' >/dev/null; then
6585
if [ $rc -eq 0 ]; then
6686
printf "UG with arguments %s should have failed but\
6787
returned 0!\n" "$args"

.github/scripts/run_tests_data.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
add_test -v # basic sanity test
22
add_test --nonexistent-param 5 should_fail
3+
add_test "-d sdl" 5 should_timeout
34

0 commit comments

Comments
 (0)