tests: Add basic drawin shim

This commit is contained in:
Emmanuel Lepage Vallee 2016-05-02 23:56:08 -04:00
parent d50acedb35
commit 66ca66ca87
3 changed files with 27 additions and 2 deletions

View File

@ -5,13 +5,14 @@ local pango = require("lgi").Pango
local pangocairo = require("lgi").PangoCairo
-- Set the global shims
-- luacheck: globals awesome root tag screen client mouse
-- luacheck: globals awesome root tag screen client mouse drawin
awesome = require( "awesome" )
root = require( "root" )
tag = require( "tag" )
screen = require( "screen" )
client = require( "client" )
mouse = require( "mouse" )
drawin = require( "drawin" )
-- Force luacheck to be silent about setting those as unused globals
assert(awesome and root and tag and screen and client and mouse)

View File

@ -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

View File

@ -1,10 +1,11 @@
local file_path, image_path, luacovpath = ...
-- Set the global shims
-- luacheck: globals awesome client tag
-- luacheck: globals awesome client tag drawin
awesome = require( "awesome" )
client = require( "client" )
tag = require( "tag" )
drawin = require( "drawin" )
-- Force luacheck to be silent about setting those as unused globals
assert(awesome and client and tag)