awesome/tests/test-signal.lua
Uli Schlachter 2d35886a76 Add awesome.{kill,unix_signal}
kill is a wrapper around the POSIX kill() function and unix_signal is a table
that maps signal numbers to their names and signal names to their numeric value.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-27 19:22:41 +02:00

24 lines
581 B
Lua

--- Tests for spawn + signals
local runner = require("_runner")
local done = false
local function exit_callback(cause, signal)
assert(cause == "signal", cause)
assert(signal == awesome.unix_signal.SIGKILL, signal)
done = true
end
local pid = awesome.spawn({"/bin/sh", "-c", "sleep 60"}, false, false,
false, false, exit_callback)
awesome.kill(pid, awesome.unix_signal.SIGKILL)
runner.run_steps({
function()
if done then
return true
end
end
})
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80