From e8f82c332a070accb8943974711d44e6420e4351 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Fri, 30 Dec 2016 01:00:20 -0500 Subject: [PATCH] shims: Add basic shims for the key and mouse grabbers --- tests/examples/shims/_common_template.lua | 19 +++++++++++-------- tests/examples/shims/beautiful.lua | 4 ++++ tests/examples/shims/keygrabber.lua | 11 +++++++++++ tests/examples/shims/mousegrabber.lua | 9 +++++++++ 4 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 tests/examples/shims/keygrabber.lua create mode 100644 tests/examples/shims/mousegrabber.lua diff --git a/tests/examples/shims/_common_template.lua b/tests/examples/shims/_common_template.lua index edb37ca1..c1cfd1ce 100644 --- a/tests/examples/shims/_common_template.lua +++ b/tests/examples/shims/_common_template.lua @@ -7,14 +7,17 @@ return function(_, _) -- Set the global shims -- luacheck: globals awesome root tag screen client mouse drawin button - awesome = require( "awesome" ) - root = require( "root" ) - tag = require( "tag" ) - screen = require( "screen" ) - client = require( "client" ) - mouse = require( "mouse" ) - drawin = require( "drawin" ) - button = require( "button" ) + -- luacheck: globals mousegrabber keygrabber + awesome = require( "awesome" ) + root = require( "root" ) + tag = require( "tag" ) + screen = require( "screen" ) + client = require( "client" ) + mouse = require( "mouse" ) + drawin = require( "drawin" ) + button = require( "button" ) + keygrabber = require( "keygrabber" ) + mousegrabber = require( "mousegrabber" ) -- Force luacheck to be silent about setting those as unused globals assert(awesome and root and tag and screen and client and mouse) diff --git a/tests/examples/shims/beautiful.lua b/tests/examples/shims/beautiful.lua index 72a9a711..d9f96fff 100644 --- a/tests/examples/shims/beautiful.lua +++ b/tests/examples/shims/beautiful.lua @@ -51,6 +51,10 @@ function module.get_font() return f end +function module.get() + return module +end + return module -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/examples/shims/keygrabber.lua b/tests/examples/shims/keygrabber.lua new file mode 100644 index 00000000..c778f4ee --- /dev/null +++ b/tests/examples/shims/keygrabber.lua @@ -0,0 +1,11 @@ + +local keygrabber = { + run = function() end, + stop = function() end, + is_running = function() return false end, +} + + +return keygrabber + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/examples/shims/mousegrabber.lua b/tests/examples/shims/mousegrabber.lua new file mode 100644 index 00000000..862e4b83 --- /dev/null +++ b/tests/examples/shims/mousegrabber.lua @@ -0,0 +1,9 @@ +local mousegrabber = { + run = function() end, + stop = function() end, + is_running = function() return false end, +} + +return mousegrabber + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80