tests: Add basic drawin shim
This commit is contained in:
parent
d50acedb35
commit
66ca66ca87
|
@ -5,13 +5,14 @@ local pango = require("lgi").Pango
|
||||||
local pangocairo = require("lgi").PangoCairo
|
local pangocairo = require("lgi").PangoCairo
|
||||||
|
|
||||||
-- Set the global shims
|
-- Set the global shims
|
||||||
-- luacheck: globals awesome root tag screen client mouse
|
-- luacheck: globals awesome root tag screen client mouse drawin
|
||||||
awesome = require( "awesome" )
|
awesome = require( "awesome" )
|
||||||
root = require( "root" )
|
root = require( "root" )
|
||||||
tag = require( "tag" )
|
tag = require( "tag" )
|
||||||
screen = require( "screen" )
|
screen = require( "screen" )
|
||||||
client = require( "client" )
|
client = require( "client" )
|
||||||
mouse = require( "mouse" )
|
mouse = require( "mouse" )
|
||||||
|
drawin = require( "drawin" )
|
||||||
|
|
||||||
-- Force luacheck to be silent about setting those as unused globals
|
-- Force luacheck to be silent about setting those as unused globals
|
||||||
assert(awesome and root and tag and screen and client and mouse)
|
assert(awesome and root and tag and screen and client and mouse)
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
local gears_obj = require("gears.object")
|
||||||
|
|
||||||
|
local drawin, meta = awesome._shim_fake_class()
|
||||||
|
|
||||||
|
local function new_drawin(_, args)
|
||||||
|
local ret = gears_obj()
|
||||||
|
|
||||||
|
for k, v in pairs(args) do
|
||||||
|
rawset(ret, k, v)
|
||||||
|
end
|
||||||
|
|
||||||
|
return setmetatable(ret, {
|
||||||
|
__index = function(...) return meta.__index(...) end,
|
||||||
|
__newindex = function(...) return meta.__newindex(...) end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return setmetatable(drawin, {
|
||||||
|
__call = new_drawin,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
local file_path, image_path, luacovpath = ...
|
local file_path, image_path, luacovpath = ...
|
||||||
|
|
||||||
-- Set the global shims
|
-- Set the global shims
|
||||||
-- luacheck: globals awesome client tag
|
-- luacheck: globals awesome client tag drawin
|
||||||
awesome = require( "awesome" )
|
awesome = require( "awesome" )
|
||||||
client = require( "client" )
|
client = require( "client" )
|
||||||
tag = require( "tag" )
|
tag = require( "tag" )
|
||||||
|
drawin = require( "drawin" )
|
||||||
|
|
||||||
-- Force luacheck to be silent about setting those as unused globals
|
-- Force luacheck to be silent about setting those as unused globals
|
||||||
assert(awesome and client and tag)
|
assert(awesome and client and tag)
|
||||||
|
|
Loading…
Reference in New Issue