Debian Codegraph @

debian/tests/gui

raw
1 #!/bin/bash
2 ## debian/tests/gui
3 ## Test that notepadqq starts graphically and prints no warnings
4
5 # Create temporary work directory
6 tmpd=$(mktemp -d)
7
8 # Create a support directories for home and xdg
9 export HOME=${tmpd}/home
10 export XDG_RUNTIME_DIR=${tmpd}/xdg
11 mkdir -p -m 777 ${HOME}
12 mkdir -p -m 700 ${XDG_RUNTIME_DIR}
13
14 # Create temporary log file
15 k=$(mktemp)
16
17 # Run nqq on a fake display
18 (QTWEBENGINE_CHROMIUM_FLAGS=--disable-gpu xvfb-run -a notepadqq &> ${k}) &
19
20 # Give it some time to generate warnings
21 sleep 5
22
23 # Close it
24 kill -QUIT %1
25 wait %1 2>/dev/null
26
27 # Count warnings
28 errs=$(wc -w < ${k})
29
30 cat $k
31
32 # Cleanup
33 pkill Xvfb
34 rm -rf "${tmpd}"
35
36 # Ensure that there are no warnings
37 [ ${errs} -eq 0 ]