Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 018108dc authored by Harald Sitter's avatar Harald Sitter 🌼

force a11y and manually manage atspi helpers

- options to launcher crash on ubuntu, instead set QT_ env vars to force
  a11y (only in test helper so chances are low that the atspi helpers get
  dbus invoked)
- spawn atspi registry in addition to the launcher
- manually send kill to both the launcher and the registryd to prevent
  process leakage in noisolation (i.e. CI) use cases
parent aaa0bc27
......@@ -20,17 +20,27 @@ endif()
if(NOT XVFB_RUN_EXECTUABLE)
find_program(XVFB_RUN_EXECTUABLE xvfb-run)
endif()
set(ATSPI_PATHS
/usr/lib/at-spi2-core/ # debians
/usr/lib/at-spi2/ # suses
)
if(NOT ATSPI_BUS_LAUNCHER_EXECUTABLE)
find_program(ATSPI_BUS_LAUNCHER_EXECUTABLE
NAMES at-spi-bus-launcher
PATHS
/usr/lib/at-spi2-core/ # debians
/usr/lib/at-spi2/ # suses
PATHS ${ATSPI_PATHS}
DOC "AT-SPI accessibility dbus launcher")
endif()
if(NOT ATSPI_REGISTRYD_EXECUTABLE)
find_program(ATSPI_REGISTRYD_EXECUTABLE
NAMES at-spi2-registryd
PATHS ${ATSPI_PATHS}
DOC "AT-SPI accessibility registry daemon")
endif()
if(RUBY_EXECUTABLE AND XVFB_RUN_EXECTUABLE AND ATSPI_BUS_LAUNCHER_EXECUTABLE
AND GDB_EXECUTABLE AND RUBY_ATSPI EQUAL 0 AND RUBY_XMLRPC EQUAL 0)
AND ATSPI_REGISTRYD_EXECUTABLE AND GDB_EXECUTABLE
AND RUBY_ATSPI EQUAL 0 AND RUBY_XMLRPC EQUAL 0)
set(WITH_DRKONI_INTEGRATION_TESTING TRUE)
endif()
add_feature_info(DrKonqiIntegrationTesting WITH_DRKONI_INTEGRATION_TESTING
......
......@@ -2,7 +2,8 @@ add_test(NAME drkonqi_integration_suite
COMMAND ${RUBY_EXECTUABLE}
${CMAKE_CURRENT_SOURCE_DIR}/suite
--drkonqi $<TARGET_FILE:drkonqi>
--at-spi-bus-launcher ${ATSPI_BUS_LAUNCHER_EXECUTABLE})
--at-spi-bus-launcher ${ATSPI_BUS_LAUNCHER_EXECUTABLE}
--at-spi-registryd ${ATSPI_REGISTRYD_EXECUTABLE})
# Hack to get rb files to show in qtc.
file(GLOB RUBIES suite *.rb)
......
......@@ -101,10 +101,16 @@ OptionParser.new do |opts|
'Path to --at-spi-bus-launcher bin to use for testing.') do |v|
ENV['AT_SPI_BUS_LAUNCHER_PATH'] = v
end
opts.on('--at-spi-registryd PATH',
'Path to registry bin to use for testing.') do |v|
ENV['AT_SPI_REGISTRY_PATH'] = v
end
end.parse!
ENV['DRKONQI_PATH'] ||= '/usr/lib/x86_64-linux-gnu/libexec/drkonqi'
ENV['AT_SPI_BUS_LAUNCHER_PATH'] ||= '/usr/lib/at-spi2-core/at-spi-bus-launcher'
ENV['AT_SPI_REGISTRY_PATH'] ||= '/usr/lib/at-spi2-core/at-spi2-registryd'
ENV['KDE_FORK_SLAVES'] = '1'
ENV['DRKONQI_IGNORE_QUALITY'] = '1'
......
......@@ -20,15 +20,23 @@ STDOUT.sync = true # force immediate flushing without internal caching
DRKONQI_PATH = ENV['DRKONQI_PATH']
AT_SPI_BUS_LAUNCHER_PATH = ENV['AT_SPI_BUS_LAUNCHER_PATH']
warn "Testing against #{DRKONQI_PATH} with #{AT_SPI_BUS_LAUNCHER_PATH}"
AT_SPI_REGISTRY_PATH = ENV['AT_SPI_REGISTRY_PATH']
warn "Testing against #{DRKONQI_PATH} with #{AT_SPI_BUS_LAUNCHER_PATH} " \
" and #{AT_SPI_REGISTRY_PATH}"
# Dies together with our dbus.
# Make sure to enable a11y and screen-reader explicitly so qt definitely
# activates its a11y bindings.
spawn(AT_SPI_BUS_LAUNCHER_PATH,
'--launch-immediately',
'--a11y=1',
'--screen-reader=1')
# Only set inside the test to prevent dbus activation of supporting services.
# We'll force a11y here as depending on the distribution a11y may not be enabled
# by default.
ENV['QT_ACCESSIBILITY'] = '1'
ENV['QT_LINUX_ACCESSIBILITY_ALWAYS_ON'] = '1'
# We kill these after our test run. When isolated they would die with our
# bus, on CI systems we employ no isolation and instead need to manage them
# manually.
# NB: do not give additional options to the launcher. Ubuntu broke theirs
# causing crashes...
launcher_pid = spawn(AT_SPI_BUS_LAUNCHER_PATH, '--launch-immediately')
registry_pid = spawn(AT_SPI_REGISTRY_PATH)
require 'atspi'
require 'minitest/autorun'
......@@ -87,3 +95,8 @@ class ATSPITest < Minitest::Test
toggle(accessible)
end
end
Minitest.after_run do
Process.kill('KILL', launcher_pid)
Process.kill('KILL', registry_pid)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment