| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
CONFIG="$AUTOPKGTEST_TMP/rc.lua" |
| 4 |
SUCCESS_FILE="$AUTOPKGTEST_TMP/success" |
| 5 |
cat > "$CONFIG" <<DONE |
| 6 |
local gears = require("gears") |
| 7 |
local orig_error = error |
| 8 |
local had_error = false |
| 9 |
function error(...) |
| 10 |
had_error = true |
| 11 |
-- quit() only sets a flag and doesn't quit immediately :-( |
| 12 |
awesome.quit() |
| 13 |
orig_error(...) |
| 14 |
end |
| 15 |
-- Quit in 5 seconds, if everything worked |
| 16 |
local t = gears.timer({ timeout = 5 }) |
| 17 |
local connect = t.connect_signal or t.add_signal |
| 18 |
connect(t, "timeout", function() |
| 19 |
-- Create the success file, everything worked fine |
| 20 |
if not had_error then |
| 21 |
io.open("$SUCCESS_FILE", "w") |
| 22 |
end |
| 23 |
awesome.quit() |
| 24 |
end) |
| 25 |
t:start() |
| 26 |
dofile("/etc/xdg/awesome/rc.lua") |
| 27 |
DONE |
| 28 |
|
| 29 |
export TMPDIR="$AUTOPKGTEST_TMP/" |
| 30 |
xvfb-run -s '-screen 0 1024x768x24' dbus-launch --exit-with-session awesome -c "$CONFIG" & |
| 31 |
PID=$! |
| 32 |
sleep 10 |
| 33 |
kill -9 $PID 2> /dev/null |
| 34 |
if [ -e "$SUCCESS_FILE" ]; then exit 0; else exit 1; fi |