From 9dba9bbc90ffdab820a044e47722ef459b9cf73c Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 18 Dec 2016 11:20:55 +0100 Subject: [PATCH 1/4] Fix luacheck installation on Travis A trivial typo in .travis.yml caused luacheck to never run. Signed-off-by: Uli Schlachter --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 55014ebb..c50c925c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,7 +86,7 @@ install: # Install busted for "make check-unit". - travis_retry sudo luarocks install busted # Install luacheck for "make check-qa". - - if [ "$DO_QUECKQA" = 1 ]; then travis_retry sudo luarocks install luacheck; fi + - if [ "$DO_CHECKQA" = 1 ]; then travis_retry sudo luarocks install luacheck; fi # Install ldoc for building docs. - travis_retry sudo luarocks install ldoc 1.4.4 From 226bb2cc31596e9cd19f08fbaeb3ad4ba061227e Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 18 Dec 2016 18:57:58 +0100 Subject: [PATCH 2/4] Fix luacheck warnings in themes/xresources/assets.lua These were introduced by commit 12e1bd67473d5. Signed-off-by: Uli Schlachter --- tests/examples/wibox/logo/logo_and_name.lua | 2 +- themes/xresources/assets.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/examples/wibox/logo/logo_and_name.lua b/tests/examples/wibox/logo/logo_and_name.lua index ef160856..6530e4e6 100644 --- a/tests/examples/wibox/logo/logo_and_name.lua +++ b/tests/examples/wibox/logo/logo_and_name.lua @@ -13,7 +13,7 @@ wibox.widget { draw = function(_, _, cr) assets.gen_logo(cr, 128, 128, nil, "#535d6c") cr:translate(128 + 128/16, 0) - assets.gen_awesome_name(cr, 0, 158, nil, "#535d6c", alt_fg, true) + assets.gen_awesome_name(cr, 158, nil, "#535d6c", alt_fg) end, widget = wibox.widget.base.make_widget } diff --git a/themes/xresources/assets.lua b/themes/xresources/assets.lua index 3c7f4e8a..9f6bbfa0 100644 --- a/themes/xresources/assets.lua +++ b/themes/xresources/assets.lua @@ -61,7 +61,7 @@ local function make_letter(cr, n, lines, size, bg, fg, alt_fg) end lines = lines or {} - color = alt_fg or fg + local color = alt_fg or fg cr:set_source(gears.color(color)) cr:rectangle( 0, (size+letter_gap)*n, @@ -83,7 +83,7 @@ local function make_letter(cr, n, lines, size, bg, fg, alt_fg) cr:set_operator(cairo.Operator.OVER) end -function theme_assets.gen_awesome_name(cr, width, height, bg, fg, alt_fg, vertical) +function theme_assets.gen_awesome_name(cr, height, bg, fg, alt_fg) local ls = height/10 -- letter_size local letter_line = ls/18 @@ -178,7 +178,7 @@ function theme_assets.wallpaper(bg, fg, alt_fg, s) cr:set_source(gears.color(bg)) cr:paint() - theme_assets.gen_awesome_name(cr, width, height, bg, fg, alt_fg, true) + theme_assets.gen_awesome_name(cr, height, bg, fg, alt_fg) return img end From 939453cabea77bfdd8c0b1956527e82608340ca7 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 18 Dec 2016 18:59:58 +0100 Subject: [PATCH 3/4] Fix luacheck warnings in the logo-tests Ever since these files were added, these problems existed. I have no idea what alt_fg is supposed to mean, but since a value of nil is apparently ok, I just pass in nil directly. Signed-off-by: Uli Schlachter --- tests/examples/wibox/logo/logo.lua | 4 ---- tests/examples/wibox/logo/logo_and_name.lua | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/examples/wibox/logo/logo.lua b/tests/examples/wibox/logo/logo.lua index 7d9009fa..734ad2b8 100644 --- a/tests/examples/wibox/logo/logo.lua +++ b/tests/examples/wibox/logo/logo.lua @@ -1,10 +1,6 @@ local parent = ... --DOC_HIDE local wibox = require( "wibox" ) --DOC_HIDE -local beautiful = require( "beautiful" ) --DOC_HIDE local assets = require( "xresources.assets" ) --DOC_HIDE -local color = require( "gears.color" ) --DOC_HIDE - -local size = 128 --DOC_HIDE parent:add( --DOC_HIDE diff --git a/tests/examples/wibox/logo/logo_and_name.lua b/tests/examples/wibox/logo/logo_and_name.lua index 6530e4e6..126d7dbe 100644 --- a/tests/examples/wibox/logo/logo_and_name.lua +++ b/tests/examples/wibox/logo/logo_and_name.lua @@ -1,10 +1,6 @@ local parent = ... --DOC_HIDE local wibox = require( "wibox" ) --DOC_HIDE -local beautiful = require( "beautiful" ) --DOC_HIDE local assets = require( "xresources.assets" ) --DOC_HIDE -local color = require( "gears.color" ) --DOC_HIDE - -local size = 128 --DOC_HIDE parent:add( --DOC_HIDE @@ -13,7 +9,7 @@ wibox.widget { draw = function(_, _, cr) assets.gen_logo(cr, 128, 128, nil, "#535d6c") cr:translate(128 + 128/16, 0) - assets.gen_awesome_name(cr, 158, nil, "#535d6c", alt_fg) + assets.gen_awesome_name(cr, 158, nil, "#535d6c", nil) end, widget = wibox.widget.base.make_widget } From 11af40b916f596067451f4759bbfeb89f338033e Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 18 Dec 2016 19:11:39 +0100 Subject: [PATCH 4/4] Fix luacheck warnings in tests/_multi_screen.lua This is a partial revert of commit 7901a1c6479aea. The end result is the same, but the change from that commit is reverted and instead the same thing is done in a different way. Signed-off-by: Uli Schlachter --- tests/_multi_screen.lua | 97 ++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 46 deletions(-) diff --git a/tests/_multi_screen.lua b/tests/_multi_screen.lua index d7757f10..c333db87 100644 --- a/tests/_multi_screen.lua +++ b/tests/_multi_screen.lua @@ -1,3 +1,6 @@ +-- FIXME See commit 7901a1c6479aea +local skip_wallpapers_due_to_weird_slowdowns = true + -- Helper module to replicate a set of steps across multiple screen scenarios -- Ideas for improvements: -- * Export an iterator so the suits can call the screen change step by step @@ -348,58 +351,60 @@ local colors = { -- Paint it black local function clear_screen() --- for s in screen do --FIXME very, very slow on Travis --- local sur = surface.widget_to_surface( --- wibox.widget { --- bg = "#000000", --- widget = wibox.container.background --- }, --- s.geometry.width, --- s.geometry.height --- ) --- wallpaper.fit(sur, s, "#000000") --- end + if skip_wallpapers_due_to_weird_slowdowns then + return + end + for s in screen do + local sur = surface.widget_to_surface( + wibox.widget { + bg = "#000000", + widget = wibox.container.background + }, + s.geometry.width, + s.geometry.height + ) + wallpaper.fit(sur, s, "#000000") + end end -- Make it easier to debug the tests by showing the screen geometry when the -- tests are executed. local function show_screens() - --FIXME very, very slow on Travis --- wallpaper.set(color("#000000")) -- Should this clear the wallpaper? It doesn't --- --- -- Add a wallpaper on each screen --- for i=1, screen.count() do --- local s = screen[i] --- --- local w = wibox.widget { --- { --- text = table.concat{ --- "Screen: ",i,"\n", --- s.geometry.width,"x",s.geometry.height, --- "+",s.geometry.x,",",s.geometry.y --- }, --- valign = "center", --- align = "center", --- widget = wibox.widget.textbox, --- }, --- bg = colors[i], --- fg = "#ffffff", --- shape_border_color = "#ff0000", --- shape_border_width = 1, --- shape = shape.rectangle, --- widget = wibox.container.background --- } --- local sur = surface.widget_to_surface( --- w, --- s.geometry.width, --- s.geometry.height --- ) --- wallpaper.fit(sur, s) --- end + if skip_wallpapers_due_to_weird_slowdowns then + wallpaper.maximized = function() end + return + end + wallpaper.set(color("#000000")) -- Should this clear the wallpaper? It doesn't - --TODO remove this line, all it does it saving some time in the tests until - -- the bug is fixed. - wallpaper.maximized = function() end + -- Add a wallpaper on each screen + for i=1, screen.count() do + local s = screen[i] + + local w = wibox.widget { + { + text = table.concat{ + "Screen: ",i,"\n", + s.geometry.width,"x",s.geometry.height, + "+",s.geometry.x,",",s.geometry.y + }, + valign = "center", + align = "center", + widget = wibox.widget.textbox, + }, + bg = colors[i], + fg = "#ffffff", + shape_border_color = "#ff0000", + shape_border_width = 1, + shape = shape.rectangle, + widget = wibox.container.background + } + local sur = surface.widget_to_surface( + w, + s.geometry.width, + s.geometry.height + ) + wallpaper.fit(sur, s) + end end local function add_steps(real_steps, new_steps)