Use Lua executable variable for check-integration

This commit is contained in:
Lucas Schwiderski 2021-03-06 17:35:25 +01:00
parent 19bf83b409
commit 6d0eb8660d
No known key found for this signature in database
GPG Key ID: AA12679AAA6DF4D8
7 changed files with 17 additions and 17 deletions

View File

@ -412,14 +412,14 @@ if ("${TEST_MANUAL_SCREENS}" MATCHES "1")
endif() endif()
add_custom_target(check-integration add_custom_target(check-integration
${CMAKE_COMMAND} -E env CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ${TESTS_RUN_ENV} ./tests/run.sh \$\${TEST_RUN_ARGS:--W} ${CMAKE_COMMAND} -E env CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' LUA_EXECUTABLE='${LUA_EXECUTABLE}' ${TESTS_RUN_ENV} ./tests/run.sh \$\${TEST_RUN_ARGS:--W}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Running integration tests" COMMENT "Running integration tests"
DEPENDS ${PROJECT_AWE_NAME} DEPENDS ${PROJECT_AWE_NAME}
USES_TERMINAL) USES_TERMINAL)
add_dependencies(check-integration test-gravity) add_dependencies(check-integration test-gravity)
add_custom_target(check-themes add_custom_target(check-themes
${CMAKE_COMMAND} -E env CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' ${TESTS_RUN_ENV} ./tests/themes/run.sh ${CMAKE_COMMAND} -E env CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}' LUA_EXECUTABLE='${LUA_EXECUTABLE}' ${TESTS_RUN_ENV} ./tests/themes/run.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Testing themes" COMMENT "Testing themes"
USES_TERMINAL USES_TERMINAL

View File

@ -106,7 +106,7 @@ local pipe
local function init() local function init()
if initialized then return end if initialized then return end
initialized = true initialized = true
local cmd = { "lua", "-e", test_client_source } local cmd = { os.getenv("LUA_EXECUTABLE"), "-e", test_client_source }
local _, _, stdin, stdout, stderr = awesome.spawn(cmd, false, true, true, true) local _, _, stdin, stdout, stderr = awesome.spawn(cmd, false, true, true, true)
pipe = Gio.UnixOutputStream.new(stdin, true) pipe = Gio.UnixOutputStream.new(stdin, true)
stdout = Gio.UnixInputStream.new(stdout, true) stdout = Gio.UnixInputStream.new(stdout, true)

View File

@ -48,7 +48,7 @@ runner.run_steps{
-- Clear the clipboard to get to a known state -- Clear the clipboard to get to a known state
function() function()
spawn.with_line_callback({ "lua", "-e", acquire_and_clear_clipboard }, spawn.with_line_callback({ os.getenv("LUA_EXECUTABLE"), "-e", acquire_and_clear_clipboard },
{ exit = function() continue = true end }) { exit = function() continue = true end })
return true return true
end, end,
@ -79,7 +79,7 @@ runner.run_steps{
-- Now set the clipboard to some text -- Now set the clipboard to some text
continue = false continue = false
spawn.with_line_callback({ "lua", "-e", acquire_clipboard_text }, spawn.with_line_callback({ os.getenv("LUA_EXECUTABLE"), "-e", acquire_clipboard_text },
{ stdout = function(line) { stdout = function(line)
assert(line == "initialisation done", assert(line == "initialisation done",
"Unexpected line: " .. line) "Unexpected line: " .. line)
@ -143,7 +143,7 @@ runner.run_steps{
-- Now set the clipboard to an image -- Now set the clipboard to an image
continue = false continue = false
spawn.with_line_callback({ "lua", "-e", acquire_clipboard_pixbuf }, spawn.with_line_callback({ os.getenv("LUA_EXECUTABLE"), "-e", acquire_clipboard_pixbuf },
{ stdout = function(line) { stdout = function(line)
assert(line == "initialisation done", assert(line == "initialisation done",
"Unexpected line: " .. line) "Unexpected line: " .. line)

View File

@ -86,7 +86,7 @@ runner.run_steps({
end end
end) end)
awesome.sync() awesome.sync()
spawn.with_line_callback({ "lua", "-e", check_targets_and_text }, spawn.with_line_callback({ os.getenv("LUA_EXECUTABLE"), "-e", check_targets_and_text },
{ stdout = function(line) { stdout = function(line)
assert(line == "done", "Unexpected line: " .. line) assert(line == "done", "Unexpected line: " .. line)
continue = true continue = true
@ -124,7 +124,7 @@ runner.run_steps({
end end
end) end)
awesome.sync() awesome.sync()
spawn.with_line_callback({ "lua", "-e", check_targets_and_text }, spawn.with_line_callback({ os.getenv("LUA_EXECUTABLE"), "-e", check_targets_and_text },
{ stdout = function(line) { stdout = function(line)
assert(line == "done", "Unexpected line: " .. line) assert(line == "done", "Unexpected line: " .. line)
continue = true continue = true
@ -161,7 +161,7 @@ runner.run_steps({
end end
end) end)
awesome.sync() awesome.sync()
spawn.with_line_callback({ "lua", "-e", check_large_transfer }, spawn.with_line_callback({ os.getenv("LUA_EXECUTABLE"), "-e", check_large_transfer },
{ stdout = function(line) { stdout = function(line)
assert(line == "done", "Unexpected line: " .. line) assert(line == "done", "Unexpected line: " .. line)
continue = true continue = true
@ -177,7 +177,7 @@ runner.run_steps({
-- Now test that :release() works -- Now test that :release() works
selection_object:release() selection_object:release()
awesome.sync() awesome.sync()
spawn.with_line_callback({ "lua", "-e", check_empty_selection }, spawn.with_line_callback({ os.getenv("LUA_EXECUTABLE"), "-e", check_empty_selection },
{ stdout = function(line) { stdout = function(line)
assert(line == "done", "Unexpected line: " .. line) assert(line == "done", "Unexpected line: " .. line)
continue = true continue = true
@ -196,7 +196,7 @@ runner.run_steps({
"Failed to acquire the clipboard selection") "Failed to acquire the clipboard selection")
selection_object:connect_signal("release", function() selection_released = true end) selection_object:connect_signal("release", function() selection_released = true end)
awesome.sync() awesome.sync()
spawn.with_line_callback({ "lua", "-e", acquire_and_clear_clipboard }, spawn.with_line_callback({ os.getenv("LUA_EXECUTABLE"), "-e", acquire_and_clear_clipboard },
{ exit = function() continue = true end }) { exit = function() continue = true end })
return true return true
end, end,

View File

@ -62,7 +62,7 @@ runner.run_steps{
-- Clear the clipboard to get to a known state -- Clear the clipboard to get to a known state
function() function()
check_state(0, 0) check_state(0, 0)
spawn.with_line_callback({ "lua", "-e", acquire_and_clear_clipboard }, spawn.with_line_callback({ os.getenv("LUA_EXECUTABLE"), "-e", acquire_and_clear_clipboard },
{ exit = function() continue = true end }) { exit = function() continue = true end })
return true return true
end, end,
@ -81,7 +81,7 @@ runner.run_steps{
-- Set the clipboard -- Set the clipboard
continue = false continue = false
spawn.with_line_callback({ "lua", "-e", acquire_clipboard }, spawn.with_line_callback({ os.getenv("LUA_EXECUTABLE"), "-e", acquire_clipboard },
{ stdout = function(line) { stdout = function(line)
assert(line == "initialisation done", assert(line == "initialisation done",
"Unexpected line: " .. line) "Unexpected line: " .. line)
@ -100,7 +100,7 @@ runner.run_steps{
-- Now clear the clipboard again -- Now clear the clipboard again
continue = false continue = false
spawn.with_line_callback({ "lua", "-e", acquire_and_clear_clipboard }, spawn.with_line_callback({ os.getenv("LUA_EXECUTABLE"), "-e", acquire_and_clear_clipboard },
{ exit = function() continue = true end }) { exit = function() continue = true end })
return true return true

View File

@ -11,7 +11,7 @@ local exit_yay, exit_snd = nil, nil
-- * spawn with startup notification is covered by test-spawn-snid.lua -- * spawn with startup notification is covered by test-spawn-snid.lua
local tiny_client = function(class) local tiny_client = function(class)
return {"lua", "-e", [[ return {os.getenv("LUA_EXECUTABLE"), "-e", [[
local lgi = require 'lgi' local lgi = require 'lgi'
local Gtk = lgi.require('Gtk') local Gtk = lgi.require('Gtk')
local class = ']]..class..[[' local class = ']]..class..[['

View File

@ -18,8 +18,8 @@ function app:on_activate()
end end
app:run {''} app:run {''}
]] ]]
local tiny_client = {"lua", "-e", string.format(tiny_client_code_template, "")} local tiny_client = {os.getenv("LUA_EXECUTABLE"), "-e", string.format(tiny_client_code_template, "")}
local tiny_client_undecorated = {"lua", "-e", local tiny_client_undecorated = {os.getenv("LUA_EXECUTABLE"), "-e",
string.format(tiny_client_code_template, [[ string.format(tiny_client_code_template, [[
window.decorated = false window.decorated = false
]]) ]])