From 718d91355d2aaaa2ca1e761a560dfbf6c239fbe7 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 2 Jul 2017 23:25:04 +0200 Subject: [PATCH] tests: fix test-menubar for when there are no desktop files (#1898) --- tests/test-menubar.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test-menubar.lua b/tests/test-menubar.lua index 304bee0c..6c31c353 100644 --- a/tests/test-menubar.lua +++ b/tests/test-menubar.lua @@ -3,6 +3,13 @@ local runner = require("_runner") local menubar = require("menubar") +local menubar_refreshed = false +local orig_refresh = menubar.refresh +function menubar.refresh(...) + menubar_refreshed = true + orig_refresh(...) +end + -- XXX We are building Lua 5.3 with -DLUA_USE_APICHECK=1 and this catches some -- bugs in lgi. Thus, do not run this test with Lua 5.3 until lgi is fixed. -- We run into the same bug when doing code-coverage analysis, supposedly @@ -41,7 +48,7 @@ runner.run_steps { end -- Test that the async population of the menubar is done - if #menubar.menu_entries > 0 then + if menubar_refreshed then menubar.hide() awesome.sync() return true