Skip to content

Commit

Permalink
tools: switch tool option parsing test to use pytest
Browse files Browse the repository at this point in the history
pytest is more powerful than unittest, so let's switch to that instead. And in
the process fix a few tests that for some reason succeeded even though they
shouldn't have (e.g. the autorestart test).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
whot committed Mar 17, 2020
1 parent 2b3fd5a commit d0eb8d5
Show file tree
Hide file tree
Showing 5 changed files with 377 additions and 327 deletions.
16 changes: 8 additions & 8 deletions .gitlab-ci.yml
Expand Up @@ -64,10 +64,10 @@ variables:
# See the documentation here: #
# https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html #
###############################################################################
FEDORA_RPMS: 'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx_rtd_theme libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel diffutils'
FEDORA_QEMU_RPMS: 'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx_rtd_theme libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel diffutils valgrind'
UBUNTU_CUSTOM_DEBS: 'git gcc g++ pkg-config meson check libudev-dev libevdev-dev doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx-rtd-theme libwacom-dev libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev'
ARCH_PKGS: 'git gcc pkgconfig meson check libsystemd libevdev doxygen graphviz python-sphinx python-recommonmark python-sphinx_rtd_theme libwacom gtk3 mtdev diffutils'
FEDORA_RPMS: 'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx_rtd_theme python3-pytest-xdist libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel diffutils'
FEDORA_QEMU_RPMS: 'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx_rtd_theme python3-pytest-xdist libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel diffutils valgrind'
UBUNTU_CUSTOM_DEBS: 'git gcc g++ pkg-config meson check libudev-dev libevdev-dev doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx-rtd-theme python3-pytest-xdist libwacom-dev libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev'
ARCH_PKGS: 'git gcc pkgconfig meson check libsystemd libevdev doxygen graphviz python-sphinx python-recommonmark python-sphinx_rtd_theme python-pytest-xdist libwacom gtk3 mtdev diffutils'
FREEBSD_BUILD_PKGS: 'meson'
FREEBSD_PKGS: 'libepoll-shim libudev-devd libevdev libwacom gtk3 libmtdev '
ALPINE_PKGS: 'git gcc build-base pkgconfig meson check-dev eudev-dev libevdev-dev libwacom-dev cairo-dev gtk+3.0-dev mtdev-dev bash'
Expand All @@ -77,12 +77,12 @@ variables:
# changing these will force rebuilding the associated image
# Note: these tags have no meaning and are not tied to a particular
# libinput version
FEDORA_TAG: '2020-02-26.0'
UBUNTU_TAG: '2020-02-26.0'
ARCH_TAG: '2020-02-26.0'
FEDORA_TAG: '2020-03-16.0'
UBUNTU_TAG: '2020-03-16.0'
ARCH_TAG: '2020-03-16.0'
ALPINE_TAG: '2020-02-26.0'
FREEBSD_TAG: '2020-02-26.0'
QEMU_TAG: 'qemu-vm-2020-02-26.0'
QEMU_TAG: 'qemu-vm-2020-03-16.0'

UBUNTU_EXEC: "bash .gitlab-ci/ubuntu_install.sh $UBUNTU_CUSTOM_DEBS"

Expand Down
16 changes: 8 additions & 8 deletions .gitlab-ci/gitlab-ci.tmpl
Expand Up @@ -54,10 +54,10 @@ variables:
# See the documentation here: #
# https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html #
###############################################################################
FEDORA_RPMS: 'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx_rtd_theme libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel diffutils'
FEDORA_QEMU_RPMS: 'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx_rtd_theme libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel diffutils valgrind'
UBUNTU_CUSTOM_DEBS: 'git gcc g++ pkg-config meson check libudev-dev libevdev-dev doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx-rtd-theme libwacom-dev libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev'
ARCH_PKGS: 'git gcc pkgconfig meson check libsystemd libevdev doxygen graphviz python-sphinx python-recommonmark python-sphinx_rtd_theme libwacom gtk3 mtdev diffutils'
FEDORA_RPMS: 'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx_rtd_theme python3-pytest-xdist libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel diffutils'
FEDORA_QEMU_RPMS: 'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx_rtd_theme python3-pytest-xdist libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel diffutils valgrind'
UBUNTU_CUSTOM_DEBS: 'git gcc g++ pkg-config meson check libudev-dev libevdev-dev doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx-rtd-theme python3-pytest-xdist libwacom-dev libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev'
ARCH_PKGS: 'git gcc pkgconfig meson check libsystemd libevdev doxygen graphviz python-sphinx python-recommonmark python-sphinx_rtd_theme python-pytest-xdist libwacom gtk3 mtdev diffutils'
FREEBSD_BUILD_PKGS: 'meson'
FREEBSD_PKGS: 'libepoll-shim libudev-devd libevdev libwacom gtk3 libmtdev '
ALPINE_PKGS: 'git gcc build-base pkgconfig meson check-dev eudev-dev libevdev-dev libwacom-dev cairo-dev gtk+3.0-dev mtdev-dev bash'
Expand All @@ -67,12 +67,12 @@ variables:
# changing these will force rebuilding the associated image
# Note: these tags have no meaning and are not tied to a particular
# libinput version
FEDORA_TAG: '2020-02-26.0'
UBUNTU_TAG: '2020-02-26.0'
ARCH_TAG: '2020-02-26.0'
FEDORA_TAG: '2020-03-16.0'
UBUNTU_TAG: '2020-03-16.0'
ARCH_TAG: '2020-03-16.0'
ALPINE_TAG: '2020-02-26.0'
FREEBSD_TAG: '2020-02-26.0'
QEMU_TAG: 'qemu-vm-2020-02-26.0'
QEMU_TAG: 'qemu-vm-2020-03-16.0'

UBUNTU_EXEC: "bash .gitlab-ci/ubuntu_install.sh $UBUNTU_CUSTOM_DEBS"

Expand Down
9 changes: 6 additions & 3 deletions meson.build
Expand Up @@ -701,13 +701,16 @@ executable('ptraccel-debug',
# subtool lookup
if get_option('buildtype') == 'debug' or get_option('buildtype') == 'debugoptimized'
config_tool_option_test = configuration_data()
config_tool_option_test.set('DISABLE_WARNING', 'yes')
config_tool_option_test.set('MESON_ENABLED_DEBUG_GUI', get_option('debug-gui'))
tool_option_test = configure_file(input: 'tools/test-tool-option-parsing.py',
output: '@BASENAME@',
config_tool_option_test.set('MESON_BUILD_ROOT', meson.current_build_dir())
config_tool_option_test.set('TOOL_PATH', libinput_tool.full_path())
tool_option_test = configure_file(input: 'tools/test_tool_option_parsing.py',
output: '@PLAINNAME@',
configuration : config_tool_option_test)
test('tool-option-parsing',
tool_option_test,
args : ['--tool-path', libinput_tool.full_path()],
args : [tool_option_test, '-n', 'auto'],
suite : ['all', 'root'],
timeout : 240)
endif
Expand Down
308 changes: 0 additions & 308 deletions tools/test-tool-option-parsing.py

This file was deleted.

0 comments on commit d0eb8d5

Please sign in to comment.