File: shell-tests

package info (click to toggle)
gnome-shell 49.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,540 kB
  • sloc: javascript: 74,965; ansic: 66,151; xml: 1,797; sh: 919; python: 666; makefile: 51
file content (60 lines) | stat: -rwxr-xr-x 1,718 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# autopkgtest check: Run the to verify gnome-shell works correctly
# (C) 2025 Canonical Ltd.
# Author: Marco Trevisan <marco.trevisan@canonical.com>

set -eu

XDG_RUNTIME_DIR="$AUTOPKGTEST_TMP/runtime-dir"
mkdir -m 700 "$XDG_RUNTIME_DIR"
export XDG_RUNTIME_DIR

build_dir=$AUTOPKGTEST_TMP/build_dir
meson "$build_dir" --prefix=/usr
ninja -C "$build_dir" src/gnome-shell-perf-helper

export G_DEBUG="fatal-criticals"
export META_DBUS_RUNNER_DISABLE_LOGIND_PASSTHROUGH=1
export G_MESSAGES_DEBUG="GNOME Shell"
export GNOME_SHELL_BUILDDIR="$build_dir/src"
export SHELL_BACKGROUND_IMAGE="$PWD/data/background.png"

if grep -qFw ID=ubuntu /etc/os-release; then
	export GNOME_SHELL_SESSION_MODE="user"
else
	export GNOME_SHELL_SESSION_MODE="ubuntu"
fi

patch -d "${GNOME_SHELL_BUILDDIR}" -p1 --merge <<"EOF"
--- a/gnome-shell-test-tool	2025-09-12 01:59:13.539304200 +0200
+++ b/gnome-shell-test-tool	2025-09-12 01:59:40.329774473 +0200
@@ -42,7 +42,7 @@
     args = []
     if wrap:
         args += wrap.split(' ')
-    args.append(os.path.join(self_dir, 'gnome-shell'))
+    args.append('/usr/bin/gnome-shell')
 
     args.append('--automation-script')
     args.append(options.script)
EOF

printf "Running as: "; id
echo "Environment:"
env | LC_ALL=C sort -u

declare -A tests
tests[basic]=""
tests[closeWithActiveWindows]=""
tests[headlessStart]="--hotplug"
tests[fittsy]=""

for i in "${!tests[@]}"; do
    echo "##### Running test $i"
    dbus-run-session -- \
        xvfb-run -a -e /proc/self/fd/2 -s '-noreset -screen 0 1280x1024x24' \
            "${GNOME_SHELL_BUILDDIR}/gnome-shell-test-tool" \
                --headless \
                "$PWD/tests/shell/$i.js" \
                ${tests[$i]}
done