summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2023-12-30 21:00:22 +0100
committerRodrigo Arias Mallo <rodarima@gmail.com>2023-12-30 22:04:56 +0100
commit95627efadf55c39901928ee730d22de55cdcc209 (patch)
treecdbba90f9eed51ad189d0ddab90ec02d2c985cc1 /configure.ac
parent1711ba895376fef9eb9b5face92118b674db8015 (diff)
Add automatic rendering tests
These tests render a HTML page in Dillo and save a screenshot which is compared with another one rendered by a reference HTML file which doesn't make use of the feature under test. Running these tests require some additional dependencies to run a Xorg server and capture screenshots of the browser, so they are only enabled when configured with the --enable-html-tests option. Additionally, running Dillo and opening local files requires a working file dpi plugin. So, when running the HTML tests it is required that a working dpid server can be launched by Dillo. To do so, Dillo can be first installed to a prefix directory, the dpidrc file copied to ~/.dillo/ and then the DILLOBIN variable set to the path of the dillo binary under test.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac40
1 files changed, 40 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6dfdf9a0..95e7a23e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,6 +107,12 @@ AC_ARG_WITH([ca-certs-dir],
[AS_HELP_STRING([--with-ca-certs-dir=DIR], [Specify where to find a directory containing trusted CA certificates for TLS])],
CA_CERTS_DIR=$withval)
+
+AC_ARG_ENABLE([html-tests],
+ [AS_HELP_STRING([--enable-html-tests], [Enable HTML tests (requires xvfb, xwd and imagemagick)])],
+ [enable_html_tests=$enableval],
+ [enable_html_tests=no])
+
if test "x$enable_ssl" = "xno"; then
AC_MSG_ERROR([The flag --disable-ssl is deprecated, use --disable-tls])
fi
@@ -550,6 +556,37 @@ pthread_ok=yes, pthread_ok=no)
esac
fi
+dnl ----------
+dnl HTML tests
+dnl ----------
+dnl
+html_tests_ok=no
+if test "x$enable_html_tests" = "xyes" ; then
+ html_tests_ok=yes
+ AC_CHECK_PROG(xvfb_ok, Xvfb, yes, no)
+ AC_CHECK_PROG(xwd_ok, xwd, yes, no)
+ AC_CHECK_PROG(xwininfo_ok, xwininfo, yes, no)
+ AC_CHECK_PROG(convert_ok, convert, yes, no)
+
+ if test "x$xvfb_ok" != "xyes"; then
+ html_tests_ok=no
+ fi
+ if test "x$xwd_ok" != "xyes"; then
+ html_tests_ok=no
+ fi
+ if test "x$xwininfo_ok" != "xyes"; then
+ html_tests_ok=no
+ fi
+ if test "x$convert_ok" != "xyes"; then
+ html_tests_ok=no
+ fi
+ if test "x$html_tests_ok" != "xyes"; then
+ AC_MSG_ERROR([Cannot find all tools to enable HTML tests])
+ fi
+fi
+
+AM_CONDITIONAL([ENABLE_HTML_TESTS], [test "x$html_tests_ok" = "xyes"])
+
dnl --------------------
dnl Command line options
dnl --------------------
@@ -654,6 +691,7 @@ AC_CONFIG_FILES([
test/Makefile
test/unit/Makefile
test/dw/Makefile
+ test/html/Makefile
])
AC_OUTPUT
@@ -675,3 +713,5 @@ _AS_ECHO([ JPEG enabled : ${jpeg_ok}])
_AS_ECHO([ PNG enabled : ${png_ok}])
_AS_ECHO([ GIF enabled : ${enable_gif}])
_AS_ECHO([])
+_AS_ECHO([ HTML tests : ${html_tests_ok}])
+_AS_ECHO([])