summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorColomban Wendling <cwendling@hypra.fr>2023-04-05 15:39:25 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2023-07-27 20:01:17 +0200
commit3426dcfec2b4d5c755024c355f323ecc9f656e4a (patch)
treee663aa5d73e470e2ca8cef603607185ca751e9cf /configure.ac
parent3121642fb1927c9cb1aa35c6b3e6afa818459117 (diff)
vcl gtk3: Introduce AT-SPI2 tests for the GTK3 accessibility layer
Add tests for the GTK3 accessibility platform layer. These tests compare the internal LO representation with what is visible to the platform, and thus the user's accessibility tools. In most cases the tests are fairly trivial as LO's internals are not far off AT-SPI2's expectations. There are however notable exceptions like for example the text attributes, that have a wildly different representation and require more complex checks matching what LO's platform layer does, the other way around. These tests use libatspi2 directly, but as the C API is awful to work with regarding resource management, there are wrappers to handle the complexity using RAII. The resulting API is fairly trivial to use. As these tests require using the GTK3 VCL plugin and for the a11y tree to be visible to AT-SPI2, they are run under XVFB using a separate dbus session through dbus-launch. Working on this has already lead to reporting and/or solving some issues: * https://gerrit.libreoffice.org/c/core/+/151303 * https://gerrit.libreoffice.org/c/core/+/151650 * https://gerrit.libreoffice.org/c/core/+/152456 * https://gerrit.libreoffice.org/c/core/+/152457 * https://bugs.documentfoundation.org/show_bug.cgi?id=155625 * https://bugs.documentfoundation.org/show_bug.cgi?id=155705 * https://gerrit.libreoffice.org/c/core/+/152748 Only a subset of the a11y APIs are covered for the moment, but the current state should make it easy to extend upon. Change-Id: I1a047864ce8dc1f1bc3056ad00159f7fd5e5b7d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153069 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac62
1 files changed, 62 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3dea1ce2bd47..ca0bdbcadfe7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1199,6 +1199,8 @@ test "${test_gtk3_kde5+set}" != set -a "$test_kf5" = yes -a "$test_gtk3" = yes &
test "${test_system_fontconfig+set}" != set -a "${test_system_freetype+set}" = set && test_system_fontconfig="$test_system_freetype"
test "${test_system_freetype+set}" != set -a "${test_system_fontconfig+set}" = set && test_system_freetype="$test_system_fontconfig"
+test "${test_atspi_tests+set}" = set || test_atspi_tests="$test_gtk3"
+
# convenience / platform overriding "fixes"
# Don't sort!
test "$test_kf5" = yes -a "$test_qt5" = no && test_kf5=no
@@ -1711,6 +1713,10 @@ AC_ARG_ENABLE(gtk4,
AS_HELP_STRING([--enable-gtk4],
[Determines whether to use Gtk+ 4.0 vclplug on platforms where Gtk+ 4.0 is available.]))
+AC_ARG_ENABLE(atspi-tests,
+ AS_HELP_STRING([--disable-atspi-tests],
+ [Determines whether to enable AT-SPI2 tests for the GTK3 vclplug.]))
+
AC_ARG_ENABLE(introspection,
AS_HELP_STRING([--enable-introspection],
[Generate files for GObject introspection. Requires --enable-gtk3. (Typically used by
@@ -11776,6 +11782,61 @@ if test "$enable_introspection" = yes; then
fi
fi
+# AT-SPI2 tests require gtk3, xvfb-run, dbus-launch and atspi-2
+test enable_atspi_tests = yes && test_atspi_tests=yes
+if test "$test_atspi_tests" = yes && ! test "$ENABLE_GTK3" = TRUE; then
+ if test "$enable_atspi_tests" = yes; then
+ AC_MSG_ERROR([--enable-atspi-tests requires --enable-gtk3])
+ fi
+ test_atspi_tests=no
+fi
+if test "$test_atspi_tests" = yes; then
+ AC_PATH_PROGS([XVFB_RUN], [xvfb-run], no)
+ if ! test "$XVFB_RUN" = no; then
+ dnl make sure the found xvfb-run actually works
+ AC_MSG_CHECKING([whether $XVFB_RUN works...])
+ if $XVFB_RUN true >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ XVFB_RUN=no
+ fi
+ fi
+ if test "$XVFB_RUN" = no; then
+ if test "$enable_atspi_tests" = yes; then
+ AC_MSG_ERROR([xvfb-run required by --enable-atspi-tests not found])
+ fi
+ test_atspi_tests=no
+ fi
+fi
+if test "$test_atspi_tests" = yes; then
+ AC_PATH_PROGS([DBUS_LAUNCH], [dbus-launch], no)
+ if test "$DBUS_LAUNCH" = no; then
+ if test "$enable_atspi_tests" = yes; then
+ AC_MSG_ERROR([dbus-launch required by --enable-atspi-tests not found])
+ fi
+ test_atspi_tests=no
+ fi
+fi
+if test "$test_atspi_tests" = yes; then
+ PKG_CHECK_MODULES([ATSPI2], [atspi-2 gobject-2.0],,
+ [if test "$enable_atspi_tests" = yes; then
+ AC_MSG_ERROR([$ATSPI2_PKG_ERRORS])
+ else
+ test_atspi_tests=no
+ fi])
+fi
+if test "x$test_atspi_tests" = xyes; then
+ PKG_CHECK_MODULES([ATSPI2_2_32], [atspi-2 >= 2.32],
+ [have_atspi_scroll_to=1],
+ [have_atspi_scroll_to=0])
+ AC_DEFINE_UNQUOTED([HAVE_ATSPI2_SCROLL_TO], [$have_atspi_scroll_to],
+ [Whether AT-SPI2 has the scrollTo API])
+fi
+ENABLE_ATSPI_TESTS=
+test "$test_atspi_tests" = yes && ENABLE_ATSPI_TESTS=TRUE
+AC_SUBST([ENABLE_ATSPI_TESTS])
+
dnl ===================================================================
dnl check for dbus support
dnl ===================================================================
@@ -14936,6 +14997,7 @@ AC_CONFIG_FILES([config_host.mk
sysui/desktop/macosx/Info.plist
vs-code.code-workspace.template:.vscode/vs-code-template.code-workspace.in])
+AC_CONFIG_HEADERS([config_host/config_atspi.h])
AC_CONFIG_HEADERS([config_host/config_buildconfig.h])
AC_CONFIG_HEADERS([config_host/config_buildid.h])
AC_CONFIG_HEADERS([config_host/config_box2d.h])