diff options
-rw-r--r-- | .gitlab-ci.yml | 1 | ||||
-rw-r--r-- | Makefile.am | 8 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rwxr-xr-x | scripts/keysym-generator.py | 11 |
4 files changed, 19 insertions, 4 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 43e4288..b4433b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,6 +58,7 @@ autotools: - autoreconf -ivf - pushd _build - ../configure --prefix="$PWD/../_inst" $CONFIGURE_OPTIONS + - make check - make install - make distcheck - mv xorgproto*.tar.gz .. diff --git a/Makefile.am b/Makefile.am index 4a39da1..3d59178 100644 --- a/Makefile.am +++ b/Makefile.am @@ -487,3 +487,11 @@ EXTRA_DIST = \ AM_DISTCHECK_CONFIGURE_FLAGS = --enable-legacy + +if HAVE_PYTHON +AM_TESTS_ENVIRONMENT = \ + INCLUDESDIR=$(top_srcdir)/include +TESTS = scripts/keysym-generator.py +TEST_EXTENSIONS = .py +PY_LOG_COMPILER = $(PYTHON) +endif diff --git a/configure.ac b/configure.ac index e84642b..523f711 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,9 @@ XORG_WITH_FOP XORG_WITH_XSLTPROC XORG_CHECK_SGML_DOCTOOLS(1.8) +AM_PATH_PYTHON([3.6], , [:]) +AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) + AC_CANONICAL_HOST AC_ARG_ENABLE(legacy, diff --git a/scripts/keysym-generator.py b/scripts/keysym-generator.py index e0db965..a583e80 100755 --- a/scripts/keysym-generator.py +++ b/scripts/keysym-generator.py @@ -13,6 +13,7 @@ import argparse import logging +import os import sys import re import libevdev @@ -385,9 +386,10 @@ def find_xf86keysym_header(): """ paths = tuple(Path.cwd().glob("**/XF86keysym.h")) if not paths: - path = Path("/usr/include/X11/XF86keysym.h") + fallbackdir = Path(os.getenv("INCLUDESDIR") or "/usr/include/") + path = fallbackdir / "X11" / "XF86keysym.h" if not path.exists(): - die("Unable to find XF86keysym.h in CWD or /usr") + die(f"Unable to find XF86keysym.h in CWD or {fallbackdir}") else: if len(paths) > 1: die("Multiple XF86keysym.h in CWD, please use --header") @@ -409,7 +411,7 @@ def main(): subparsers = parser.add_subparsers(help="command-specific help", dest="command") parser_verify = subparsers.add_parser( - "verify", help="Verify the XF86keysym.h matches requirements" + "verify", help="Verify the XF86keysym.h matches requirements (default)" ) parser_verify.set_defaults(func=verify) @@ -443,7 +445,8 @@ def main(): ns.header = Path(ns.header) if ns.command is None: - parser.error("Invalid or missing command") + print("No command specified, defaulting to verify'") + ns.func = verify sys.exit(ns.func(ns)) |