Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • libevdev/libevdev
  • mforney/libevdev
  • psreport/libevdev
  • mangix/libevdev
  • whot/libevdev
  • georgefst/libevdev
  • ChaojiangLuo/libevdev
  • zeising/libevdev
  • maksymvo/libevdev
  • ndesh26/libevdev
  • zenwheel/libevdev
  • wswmao/libevdev
  • manu/libevdev
  • renodr/libevdev
  • kaocher82/libevdev
  • mattst88/libevdev
  • simeonschaub/libevdev
  • sdlzx/libevdev
  • OnkelUlla/libevdev
  • JoseExposito/libevdev
  • skitt/libevdev
  • nniro/libevdev
  • illiliti/libevdev
  • qyliss/libevdev
  • bentiss/libevdev
  • eballetbo/libevdev
  • andeston/libevdev
27 results
Show changes
Commits on Source (37)
......@@ -4,22 +4,18 @@
# #
########################################
.templates_sha: &template_sha c1e465762df9d4208a03ed4df6cae15006579838 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
.templates_sha: &template_sha e195d80f35b45cc73668be3767b923fd76c70ed5 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
include:
- project: 'freedesktop/ci-templates'
ref: *template_sha
file:
# Alpine container builder template
- '/templates/alpine.yml'
# Arch container builder template
- '/templates/arch.yml'
# Debian container builder template
- '/templates/debian.yml'
# Fedora container builder template
- '/templates/fedora.yml'
# Ubuntu container builder template
- '/templates/ubuntu.yml'
- '/templates/ci-fairy.yml'
stages:
- prep # rebuild the container images if there is a change
......@@ -31,10 +27,16 @@ stages:
- container_clean # clean up unused container images
- merge-check # check for a merge request
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
variables:
# The upstrem repository we will check for images
FDO_UPSTREAM_REPO: libevdev/libevdev
LIBEVDEV_SKIP_ROOT_TESTS: 1
GIT_DEPTH: 1
MESON_BUILDDIR: 'build dir'
......@@ -59,59 +61,57 @@ variables:
- make check
- if ! [[ -z "$MAKE_ARGS" ]]; then make $MAKE_ARGS; fi
- popd > /dev/null
variables:
LIBEVDEV_SKIP_ROOT_TESTS: 1
.meson_build:
extends:
- .default_artifacts
script:
- .gitlab-ci/meson-build.sh
.fedora:34:
extends: .fdo.distribution-image@fedora
- .gitlab-ci/meson-build.sh --run-test
variables:
FDO_DISTRIBUTION_TAG: '2023-01-04.5'
FDO_DISTRIBUTION_VERSION: '34'
MESON_TEST_ARGS: '--no-suite=needs-uinput'
.fedora:35:
.fedora:40:
extends: .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_TAG: '2023-01-04.5'
FDO_DISTRIBUTION_VERSION: '35'
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: '40'
.ubuntu:22.04:
extends: .fdo.distribution-image@ubuntu
.fedora:41:
extends: .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_TAG: '2023-01-04.5'
FDO_DISTRIBUTION_VERSION: '22.04'
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: '41'
.ubuntu:22.10:
.ubuntu:24.10:
extends: .fdo.distribution-image@ubuntu
variables:
FDO_DISTRIBUTION_TAG: '2023-01-04.5'
FDO_DISTRIBUTION_VERSION: '22.10'
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: '24.10'
.debian:stable:
extends: .fdo.distribution-image@debian
variables:
FDO_DISTRIBUTION_TAG: '2023-01-04.5'
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'stable'
.debian:sid:
extends: .fdo.distribution-image@debian
variables:
FDO_DISTRIBUTION_TAG: '2023-01-04.5'
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'sid'
.arch:rolling:
extends: .fdo.distribution-image@arch
variables:
FDO_DISTRIBUTION_TAG: '2023-01-04.5'
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'rolling'
.alpine:latest:
extends: .fdo.distribution-image@alpine
variables:
FDO_DISTRIBUTION_TAG: '2023-01-04.5'
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'latest'
......@@ -127,14 +127,11 @@ variables:
# $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
#
check-ci-script:
image: golang:alpine
extends:
- .fdo.ci-fairy
stage: prep
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script:
- ci-fairy generate-template
- git diff --exit-code && exit 0 || true
- ci-fairy generate-template --verify && exit 0 || true
- echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
- exit 1
......@@ -143,13 +140,13 @@ check-ci-script:
#
check-commit:
image: golang:alpine
extends:
- .fdo.ci-fairy
stage: prep
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script:
- ci-fairy check-commits --signed-off-by --junit-xml=results.xml
- ci-fairy -vv check-commits --junit-xml=results.xml && exit 0 || true
- echo "Error checking the commit message format. Please verify"
- exit 1
except:
- master@libevdev/libevdev
variables:
......@@ -163,11 +160,9 @@ check-commit:
#
check-merge-request:
image: golang:alpine
extends:
- .fdo.ci-fairy
stage: merge-check
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
artifacts:
......@@ -175,11 +170,13 @@ check-merge-request:
reports:
junit: results.xml
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
.fedora.packages:
variables:
FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer systemd-udev qemu-img qemu-system-x86-core qemu-system-aarch64-core jq python3-click python3-rich'
.ubuntu.packages:
variables:
......@@ -191,123 +188,46 @@ check-merge-request:
.arch.packages:
variables:
FDO_DISTRIBUTION_PACKAGES: 'git gcc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen'
FDO_DISTRIBUTION_PACKAGES: 'git gc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen'
.alpine.packages:
variables:
FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkgconfig python3 check-dev valgrind binutils doxygen xz linux-headers'
# Pulls in the qemu container from upstream or rebuilds it if missing
.fedora:35@qemu-prep:
extends:
- .fedora:35
- .fedora.packages
- .fdo.qemu-build@fedora
stage: prep
tags:
- kvm
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_TAG: qemu-2023-01-04.5
allow_failure: true
# Always rebuilds the container
.fedora:35@qemu-forced-rebuild:
extends:
- .fedora:35@qemu-prep
variables:
FDO_FORCE_REBUILD: 1
only:
- schedules
# This is the actual job
fedora:35@qemu-prep:
extends: .fedora:35@qemu-prep
fedora:35@qemu-forced-rebuild:
extends: .fedora:35@qemu-forced-rebuild
# Pulls in the container from upstream or rebuilds it if missing
fedora:34@container-prep:
fedora:40@container-prep:
extends:
- .fedora:34
- .fedora:40
- .fedora.packages
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
# Always rebuilds the container
fedora:34@container-forced-rebuild:
extends:
- fedora:34@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing
fedora:35@container-prep:
fedora:41@container-prep:
extends:
- .fedora:35
- .fedora:41
- .fedora.packages
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
# Always rebuilds the container
fedora:35@container-forced-rebuild:
extends:
- fedora:35@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing
ubuntu:22.04@container-prep:
ubuntu:24.10@container-prep:
extends:
- .ubuntu:22.04
- .ubuntu:24.10
- .ubuntu.packages
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
# Always rebuilds the container
ubuntu:22.04@container-forced-rebuild:
extends:
- ubuntu:22.04@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing
ubuntu:22.10@container-prep:
extends:
- .ubuntu:22.10
- .ubuntu.packages
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
# Always rebuilds the container
ubuntu:22.10@container-forced-rebuild:
extends:
- ubuntu:22.10@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing
debian:stable@container-prep:
......@@ -319,15 +239,6 @@ debian:stable@container-prep:
variables:
GIT_STRATEGY: none
# Always rebuilds the container
debian:stable@container-forced-rebuild:
extends:
- debian:stable@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing
debian:sid@container-prep:
......@@ -339,15 +250,6 @@ debian:sid@container-prep:
variables:
GIT_STRATEGY: none
# Always rebuilds the container
debian:sid@container-forced-rebuild:
extends:
- debian:sid@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing
arch:rolling@container-prep:
......@@ -359,15 +261,6 @@ arch:rolling@container-prep:
variables:
GIT_STRATEGY: none
# Always rebuilds the container
arch:rolling@container-forced-rebuild:
extends:
- arch:rolling@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing
alpine:latest@container-prep:
......@@ -379,15 +272,6 @@ alpine:latest@container-prep:
variables:
GIT_STRATEGY: none
# Always rebuilds the container
alpine:latest@container-forced-rebuild:
extends:
- alpine:latest@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
#################################################################
# #
......@@ -401,11 +285,9 @@ alpine:latest@container-forced-rebuild:
# the registry and will remove any that are not tagged with the provided
# $container_image:$tag
.container-clean:
extends:
- .fdo.ci-fairy
stage: container_clean
image: golang:alpine
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script:
# Go to your Profile, Settings, Access Tokens
# Create a personal token with 'api' scope, copy the value.
......@@ -420,33 +302,26 @@ alpine:latest@container-forced-rebuild:
only:
- schedules
### fedora 34
fedora:34@container-clean:
### fedora 40
fedora:40@container-clean:
extends:
- .fedora:34
- .fedora:40
- .container-clean
needs: ["fedora:34@container-prep"]
needs: ["fedora:40@container-prep"]
### fedora 35
fedora:35@container-clean:
### fedora 41
fedora:41@container-clean:
extends:
- .fedora:35
- .fedora:41
- .container-clean
needs: ["fedora:35@container-prep"]
needs: ["fedora:41@container-prep"]
### ubuntu 22.04
ubuntu:22.04@container-clean:
### ubuntu 24.10
ubuntu:24.10@container-clean:
extends:
- .ubuntu:22.04
- .ubuntu:24.10
- .container-clean
needs: ["ubuntu:22.04@container-prep"]
### ubuntu 22.10
ubuntu:22.10@container-clean:
extends:
- .ubuntu:22.10
- .container-clean
needs: ["ubuntu:22.10@container-prep"]
needs: ["ubuntu:24.10@container-prep"]
### debian stable
debian:stable@container-clean:
......@@ -496,68 +371,51 @@ alpine:latest@container-clean:
- .meson_build
stage: build
dependencies: []
variables:
NINJA_ARGS: "dist"
fedora:34@autotools-build:
extends:
- .fedora:34
- .autotools-build@template
stage: autotools
needs: ['fedora:34@container-prep']
fedora:34@meson-build:
extends:
- .fedora:34
- .meson-build@template
stage: meson
needs: ['fedora:34@container-prep']
fedora:35@autotools-build:
fedora:40@autotools-build:
extends:
- .fedora:35
- .fedora:40
- .autotools-build@template
stage: autotools
needs: ['fedora:35@container-prep']
needs: ['fedora:40@container-prep']
fedora:35@meson-build:
fedora:40@meson-build:
extends:
- .fedora:35
- .fedora:40
- .meson-build@template
stage: meson
needs: ['fedora:35@container-prep']
needs: ['fedora:40@container-prep']
ubuntu:22.04@autotools-build:
fedora:41@autotools-build:
extends:
- .ubuntu:22.04
- .fedora:41
- .autotools-build@template
stage: autotools
needs: ['ubuntu:22.04@container-prep']
needs: ['fedora:41@container-prep']
ubuntu:22.04@meson-build:
fedora:41@meson-build:
extends:
- .ubuntu:22.04
- .fedora:41
- .meson-build@template
stage: meson
needs: ['ubuntu:22.04@container-prep']
needs: ['fedora:41@container-prep']
ubuntu:22.10@autotools-build:
ubuntu:24.10@autotools-build:
extends:
- .ubuntu:22.10
- .ubuntu:24.10
- .autotools-build@template
stage: autotools
needs: ['ubuntu:22.10@container-prep']
needs: ['ubuntu:24.10@container-prep']
ubuntu:22.10@meson-build:
ubuntu:24.10@meson-build:
extends:
- .ubuntu:22.10
- .ubuntu:24.10
- .meson-build@template
stage: meson
needs: ['ubuntu:22.10@container-prep']
needs: ['ubuntu:24.10@container-prep']
debian:stable@autotools-build:
......@@ -626,10 +484,10 @@ alpine:latest@meson-build:
# because they're supposed to fail equally on all
.fedora-custom-build@autotools-template:
extends:
- .fedora:34
- .fedora:40
- .autotools-build@template
stage: build
needs: ['fedora:34@container-prep']
needs: ['fedora:40@container-prep']
no-valgrind:autotools:
extends: .fedora-custom-build@autotools-template
......@@ -668,10 +526,10 @@ enable-gcov:autotools:
.fedora-custom-build@meson-template:
extends:
- .fedora:34
- .fedora:40
- .meson-build@template
stage: build
needs: ['fedora:34@container-prep']
needs: ['fedora:40@container-prep']
no-valgrind:meson:
extends: .fedora-custom-build@meson-template
......@@ -722,7 +580,7 @@ static-build:meson:
soname:
extends:
- .fedora:34
- .fedora:40
stage: build
script:
- ./autogen.sh --prefix=$PWD/prefix-autotools/
......@@ -731,7 +589,7 @@ soname:
- meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/
- ninja -C "$MESON_BUILDDIR" install
- ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0
needs: ['fedora:34@container-prep']
needs: ['fedora:40@container-prep']
#################################################################
# #
......@@ -747,62 +605,48 @@ soname:
exit 1 ;
fi
.qemu@fedora:35:
# build on the host, then run a systemd service to execute the test suite
# inside the qemu VM handled by b2c
.build-in-b2c@template:
extends:
- .fedora:35
stage: VM
image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG
- .default_artifacts
tags:
- kvm
variables:
MESON_BUILDDIR: build_dir
B2C_KERNEL: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.5/bzImage
B2C_IMAGE: $FDO_DISTRIBUTION_IMAGE
B2C_COMMAND: .gitlab-ci/start-in-systemd.sh
script:
# start our vm, no args required
- /app/vmctl start
- *check_tainted
- "scp -r $PWD vm:"
- echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
- echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
- echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
- echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
- echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
- "scp sshenv vm:~/$CI_PROJECT_NAME/.meson_environment"
- /app/vmctl exec "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
# no matter the results of the tests, we want to fetch the logs
- scp -r vm:$CI_PROJECT_NAME/"$MESON_BUILDDIR" .
- *check_tainted
- /app/vmctl stop
- if [[ ! -e .success ]] ;
then
exit 1 ;
fi
artifacts:
name: "qemu-meson-logs-$CI_JOB_NAME"
when: always
expire_in: 1 week
paths:
- $MESON_BUILDDIR/meson-logs
- console.out
reports:
junit: $MESON_BUILDDIR/junit-*.xml
needs: ['fedora:35@qemu-prep']
# first build in the host container
- .gitlab-ci/meson-build.sh --skip-test
# pull b2c
- curl -L -o /app/boot2container https://gitlab.freedesktop.org/gfx-ci/boot2container/-/raw/2ff65156ba67fa8a0c309a4fc16c5df1a88a3844/vm2c.py
- chmod +x /app/boot2container
# runs the test suite only
- /app/boot2container
qemu:meson:
extends: .qemu@fedora:35
stage: VM
extends:
- .fdo.distribution-image@fedora
- .fedora:41
- .build-in-b2c@template
needs:
- "fedora:41@container-prep"
qemu:meson:valgrind:
extends: .qemu@fedora:35
extends:
- qemu:meson
variables:
MESON_TEST_ARGS: '--setup=valgrind'
meson-from-tarball:
extends:
- .fedora:35
- .fedora:41
stage: tarballs
script:
- export INSTALLDIR="$PWD/_inst"
......@@ -820,11 +664,11 @@ meson-from-tarball:
- ninja -C "$MESON_BUILDDIR" install
- popd > /dev/null
- ls -lR $INSTALLDIR
needs: ['fedora:35@container-prep']
needs: ['fedora:41@container-prep']
autotools-from-tarball:
extends:
- .fedora:35
- .fedora:41
stage: tarballs
script:
- export INSTALLDIR="$PWD/_inst"
......@@ -845,4 +689,4 @@ autotools-from-tarball:
variables:
LIBEVDEV_SKIP_ROOT_TESTS: 1
needs: ['fedora:35@container-prep']
needs: ['fedora:41@container-prep']
......@@ -6,16 +6,16 @@
# #
########################################
.templates_sha: &template_sha c1e465762df9d4208a03ed4df6cae15006579838 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
.templates_sha: &template_sha e195d80f35b45cc73668be3767b923fd76c70ed5 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
include:
- project: 'freedesktop/ci-templates'
ref: *template_sha
file:
{% for distribution in distributions|map(attribute='name')|unique()|sort() %}
# {{ distribution.capitalize() }} container builder template
- '/templates/{{distribution}}.yml'
{% endfor %}
- '/templates/ci-fairy.yml'
stages:
- prep # rebuild the container images if there is a change
......@@ -27,10 +27,16 @@ stages:
- container_clean # clean up unused container images
- merge-check # check for a merge request
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
variables:
# The upstrem repository we will check for images
FDO_UPSTREAM_REPO: libevdev/libevdev
LIBEVDEV_SKIP_ROOT_TESTS: 1
GIT_DEPTH: 1
MESON_BUILDDIR: 'build dir'
......@@ -55,12 +61,16 @@ variables:
- make check
- if ! [[ -z "$MAKE_ARGS" ]]; then make $MAKE_ARGS; fi
- popd > /dev/null
variables:
LIBEVDEV_SKIP_ROOT_TESTS: 1
.meson_build:
extends:
- .default_artifacts
script:
- .gitlab-ci/meson-build.sh
- .gitlab-ci/meson-build.sh --run-test
variables:
MESON_TEST_ARGS: '--no-suite=needs-uinput'
{# Generate templates for every distribution/version combination we want, any
job can then just extends: .name:version and the images will sort
......@@ -88,14 +98,11 @@ variables:
# $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
#
check-ci-script:
image: golang:alpine
extends:
- .fdo.ci-fairy
stage: prep
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script:
- ci-fairy generate-template
- git diff --exit-code && exit 0 || true
- ci-fairy generate-template --verify && exit 0 || true
- echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
- exit 1
......@@ -104,13 +111,13 @@ check-ci-script:
#
check-commit:
image: golang:alpine
extends:
- .fdo.ci-fairy
stage: prep
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script:
- ci-fairy check-commits --signed-off-by --junit-xml=results.xml
- ci-fairy -vv check-commits --junit-xml=results.xml && exit 0 || true
- echo "Error checking the commit message format. Please verify"
- exit 1
except:
- master@libevdev/libevdev
variables:
......@@ -124,11 +131,9 @@ check-commit:
#
check-merge-request:
image: golang:alpine
extends:
- .fdo.ci-fairy
stage: merge-check
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
artifacts:
......@@ -136,6 +141,8 @@ check-merge-request:
reports:
junit: results.xml
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
{% for distro in distributions %}
......@@ -145,39 +152,6 @@ check-merge-request:
{% endfor %}
{% for distro in distributions if distro.want_qemu %}
{% set version = "{}".format(distro.versions|last()) %}
# Pulls in the qemu container from upstream or rebuilds it if missing
.{{ distro.name }}:{{ version }}@qemu-prep:
extends:
- .{{ distro.name }}:{{ version }}
- .{{ distro.name}}.packages
- .fdo.qemu-build@{{distro.name}}
stage: prep
tags:
- kvm
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_TAG: qemu-{{ distro.tag }}
allow_failure: true
# Always rebuilds the container
.{{ distro.name }}:{{ version }}@qemu-forced-rebuild:
extends:
- .{{ distro.name }}:{{ version }}@qemu-prep
variables:
FDO_FORCE_REBUILD: 1
only:
- schedules
# This is the actual job
{{distro.name}}:{{version}}@qemu-prep:
extends: .{{distro.name}}:{{version}}@qemu-prep
{{distro.name}}:{{version}}@qemu-forced-rebuild:
extends: .{{distro.name}}:{{version}}@qemu-forced-rebuild
{% endfor %}
{% for distro in distributions %}
{% for version in distro.versions %}
......@@ -191,15 +165,6 @@ check-merge-request:
variables:
GIT_STRATEGY: none
# Always rebuilds the container
{{ distro.name }}:{{ version }}@container-forced-rebuild:
extends:
- {{ distro.name }}:{{ version }}@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
{% endfor %}
{% endfor %}
......@@ -215,11 +180,9 @@ check-merge-request:
# the registry and will remove any that are not tagged with the provided
# $container_image:$tag
.container-clean:
extends:
- .fdo.ci-fairy
stage: container_clean
image: golang:alpine
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script:
# Go to your Profile, Settings, Access Tokens
# Create a personal token with 'api' scope, copy the value.
......@@ -265,8 +228,6 @@ check-merge-request:
- .meson_build
stage: build
dependencies: []
variables:
NINJA_ARGS: "dist"
{% for distro in distributions %}
{% for version in distro.versions %}
......@@ -432,60 +393,46 @@ soname:
exit 1 ;
fi
{% for distro in distributions if distro.want_qemu %}
{% set version = "{}".format(distro.versions|last()) %}
.qemu@{{distro.name}}:{{version}}:
# build on the host, then run a systemd service to execute the test suite
# inside the qemu VM handled by b2c
.build-in-b2c@template:
extends:
- .{{distro.name}}:{{version}}
stage: VM
image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG
- .default_artifacts
tags:
- kvm
variables:
MESON_BUILDDIR: build_dir
B2C_KERNEL: {{ b2c.kernel }}
B2C_IMAGE: $FDO_DISTRIBUTION_IMAGE
B2C_COMMAND: .gitlab-ci/start-in-systemd.sh
script:
# start our vm, no args required
- /app/vmctl start
- *check_tainted
- "scp -r $PWD vm:"
- echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
- echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
- echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
- echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
- echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
- "scp sshenv vm:~/$CI_PROJECT_NAME/.meson_environment"
- /app/vmctl exec "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
# no matter the results of the tests, we want to fetch the logs
- scp -r vm:$CI_PROJECT_NAME/"$MESON_BUILDDIR" .
- *check_tainted
- /app/vmctl stop
- if [[ ! -e .success ]] ;
then
exit 1 ;
fi
artifacts:
name: "qemu-meson-logs-$CI_JOB_NAME"
when: always
expire_in: 1 week
paths:
- $MESON_BUILDDIR/meson-logs
- console.out
reports:
junit: $MESON_BUILDDIR/junit-*.xml
needs: ['{{distro.name}}:{{version}}@qemu-prep']
# first build in the host container
- .gitlab-ci/meson-build.sh --skip-test
# pull b2c
- curl -L -o /app/boot2container https://gitlab.freedesktop.org/gfx-ci/boot2container/-/raw/{{b2c.version}}/vm2c.py
- chmod +x /app/boot2container
# runs the test suite only
- /app/boot2container
{% for distro in distributions if distro.use_for_qemu_tests %}
{% set version = "{}".format(distro.versions|last()) %}
qemu:meson:
extends: .qemu@{{distro.name}}:{{version}}
stage: VM
extends:
- .fdo.distribution-image@{{distro.name}}
- .{{distro.name}}:{{version}}
- .build-in-b2c@template
needs:
- "{{distro.name}}:{{version}}@container-prep"
qemu:meson:valgrind:
extends: .qemu@{{distro.name}}:{{version}}
extends:
- qemu:meson
variables:
MESON_TEST_ARGS: '--setup=valgrind'
{% endfor %}
{% for distro in distributions if distro.use_for_tarball_tests %}
......
......@@ -3,16 +3,17 @@
#
# We're happy to rebuild all containers when one changes.
.default_tag: &default_tag '2023-01-04.5'
.default_tag: &default_tag '2024-11-25.0'
distributions:
- name: fedora
tag: *default_tag
want_qemu: true
use_for_tarball_tests: true
# only one distro for qemu tests
use_for_qemu_tests: true
versions:
- '34'
- '35'
- '40'
- '41'
packages:
- git
- gcc
......@@ -30,11 +31,18 @@ distributions:
- doxygen
- xz
- clang-analyzer
# below packages are for the qemu runs, so optional
- systemd-udev
- qemu-img
- qemu-system-x86-core
- qemu-system-aarch64-core
- jq
- python3-click
- python3-rich
- name: ubuntu
tag: *default_tag
versions:
- '22.04'
- '22.10'
- '24.10'
packages:
- git
- gcc
......@@ -78,7 +86,7 @@ distributions:
- 'rolling'
packages:
- git
- gcc
- gc
- meson
- automake
- autoconf
......@@ -111,3 +119,7 @@ distributions:
- doxygen
- xz
- linux-headers
b2c:
version: 2ff65156ba67fa8a0c309a4fc16c5df1a88a3844
kernel: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.5/bzImage
#!/usr/bin/env bash
#
# This script is sourced from here:
# https://gitlab.freedesktop.org/whot/meson-helper
#
# SPDX-License-Identifier: MIT
set -x
if [[ -f .meson_environment ]]; then
......@@ -42,15 +47,16 @@ fi
# run and debug locally.
if [[ -z "$CI_JOB_ID" ]] || [[ -z "$CI_JOB_NAME" ]]; then
echo "Missing \$CI_JOB_ID or \$CI_JOB_NAME".
CI_PROJECT_NAME=$(basename "$PWD")
CI_JOB_ID=$(date +%s)
CI_JOB_NAME='libevdev-job-local'
CI_JOB_NAME="$CI_PROJECT_NAME-job-local"
echo "Simulating gitlab environment: "
echo " CI_JOB_ID=$CI_JOB_ID"
echo " CI_JOB_NAME=$CI_JOB_NAME"
fi
if [[ -n "$FDO_CI_CONCURRENT" ]]; then
NINJA_ARGS="-j$FDO_CI_CONCURRENT $NINJA_ARGS"
jobcount="-j$FDO_CI_CONCURRENT"
export MESON_TESTTHREADS="$FDO_CI_CONCURRENT"
fi
......@@ -59,6 +65,7 @@ echo "builddir: $MESON_BUILDDIR"
echo "meson args: $MESON_ARGS"
echo "ninja args: $NINJA_ARGS"
echo "meson test args: $MESON_TEST_ARGS"
echo "job count: ${jobcount-0}"
echo "*************************************************"
set -e
......@@ -70,7 +77,10 @@ fi
meson configure "$MESON_BUILDDIR"
if [[ -z "$MESON_SKIP_BUILD" ]]; then
ninja -C "$MESON_BUILDDIR" $NINJA_ARGS
if [[ -n "$NINJA_ARGS" ]]; then
ninja_args="--ninja-args $NINJA_ARGS"
fi
meson compile -v -C "$MESON_BUILDDIR" $jobcount $ninja_args
fi
if [[ -n "$MESON_RUN_TEST" ]]; then
......
#!/usr/bin/env bash
set -x
systemd_target=basic.target
post_command="/usr/bin/systemctl exit \$EXIT_STATUS"
while [[ $# -gt 0 ]]; do
case $1 in
--debug-mode)
shift
systemd_target=multi-user.target
post_command="echo you can now log in as root (no password) and then turn off by running \'/usr/bin/systemctl exit \$EXIT_STATUS\'"
;;
*)
echo "Unknow commandline argument $1"
exit 1
;;
esac
done
WORKDIR=${FDO_DISTRIBUTION_WORKINGDIR:-$PWD}
B2C_WORKDIR=${FDO_B2C_WORKDIR:-/app}
# remove root password for debugging
sed -i 's/root:!locked::/root:::/' /etc/shadow
# create a libevdev test suite service
cat <<EOF > /etc/systemd/system/libevdev-testsuite.service
[Unit]
Description=libevdev test suite
After=$systemd_target
[Service]
Type=simple
StandardOutput=journal+console
EnvironmentFile=$B2C_WORKDIR/.b2c_env
WorkingDirectory=$WORKDIR
ExecStart=$WORKDIR/.gitlab-ci/meson-build.sh --skip-setup --skip-build --run-test
# exit the container on termination
ExecStopPost=$post_command
[Install]
WantedBy=default.target
EOF
cat /etc/systemd/system/libevdev-testsuite.service
# enable the service
systemctl enable libevdev-testsuite.service
# disable some services we don't need in the CI
systemctl mask network-online.target
systemctl mask network-pre.target
systemctl mask timers.target
systemctl mask dnf-makecache.timer
systemctl mask systemd-logind.service
systemctl mask rpmdb-migrate.service
systemctl mask systemd-network-generator.service
systemctl mask cryptsetup-pre.target
systemctl mask cryptsetup.target
#change default target
systemctl set-default $systemd_target
# start the system
exec /usr/sbin/init
......@@ -7,7 +7,7 @@ AC_PREREQ([2.62])
# change meson version too
AC_INIT([libevdev],
[1.13.0],
[1.13.3],
[https://gitlab.freedesktop.org/libevdev/libevdev/issues/],
[libevdev],
[http://freedesktop.org/wiki/Software/libevdev/])
......
......@@ -602,6 +602,7 @@
#define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */
#define KEY_ROTATE_LOCK_TOGGLE 0x231 /* Display rotation lock */
#define KEY_REFRESH_RATE_TOGGLE 0x232 /* Display refresh rate toggle */
#define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */
#define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */
......@@ -614,6 +615,11 @@
#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */
#define KEY_EMOJI_PICKER 0x249 /* Show/hide emoji picker (HUTRR101) */
#define KEY_DICTATE 0x24a /* Start or Stop Voice Dictation Session (HUTRR99) */
#define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */
#define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */
#define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */
#define KEY_ACCESSIBILITY 0x24e /* Toggles the system bound accessibility UI/command (HUTRR116) */
#define KEY_DO_NOT_DISTURB 0x24f /* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/
#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
......@@ -862,6 +868,7 @@
#define ABS_TOOL_WIDTH 0x1c
#define ABS_VOLUME 0x20
#define ABS_PROFILE 0x21
#define ABS_MISC 0x28
......
......@@ -602,6 +602,7 @@
#define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */
#define KEY_ROTATE_LOCK_TOGGLE 0x231 /* Display rotation lock */
#define KEY_REFRESH_RATE_TOGGLE 0x232 /* Display refresh rate toggle */
#define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */
#define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */
......@@ -614,6 +615,11 @@
#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */
#define KEY_EMOJI_PICKER 0x249 /* Show/hide emoji picker (HUTRR101) */
#define KEY_DICTATE 0x24a /* Start or Stop Voice Dictation Session (HUTRR99) */
#define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */
#define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */
#define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */
#define KEY_ACCESSIBILITY 0x24e /* Toggles the system bound accessibility UI/command (HUTRR116) */
#define KEY_DO_NOT_DISTURB 0x24f /* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/
#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
......@@ -862,6 +868,7 @@
#define ABS_TOOL_WIDTH 0x1c
#define ABS_VOLUME 0x20
#define ABS_PROFILE 0x21
#define ABS_MISC 0x28
......
......@@ -33,7 +33,7 @@ event-names.h: Makefile make-event-names.py
$(PYTHON) $(srcdir)/make-event-names.py $(top_srcdir)/include/linux/@OS@/input.h $(top_srcdir)/include/linux/@OS@/input-event-codes.h > $@
EXTRA_DIST = make-event-names.py libevdev.sym
EXTRA_DIST = make-event-names.py libevdev.sym ../include
CLEANFILES = event-names.h
BUILT_SOURCES = event-names.h
......
......@@ -805,23 +805,34 @@ push_mt_sync_events(struct libevdev *dev,
int rc;
for (int slot = 0; slot < dev->num_slots; slot++) {
/* stopped touches were already terminated in
* terminate_slots */
if (changes[slot].state == TOUCH_STOPPED ||
!bit_is_set(changes[slot].axes, ABS_MT_SLOT))
continue;
bool have_slot_event = false;
queue_push_event(dev, EV_ABS, ABS_MT_SLOT, slot);
last_reported_slot = slot;
if (!bit_is_set(changes[slot].axes, ABS_MT_SLOT))
continue;
for (int axis = ABS_MT_MIN; axis <= ABS_MT_MAX; axis++) {
if (axis == ABS_MT_SLOT ||
!libevdev_has_event_code(dev, EV_ABS, axis))
continue;
if (bit_is_set(changes[slot].axes, axis))
if (bit_is_set(changes[slot].axes, axis)) {
/* We already sent the tracking id -1 in
* terminate_slots so don't do that again. There
* may be other axes like ABS_MT_TOOL_TYPE that
* need to be synced despite no touch being active */
if (axis == ABS_MT_TRACKING_ID &&
*slot_value(dev, slot, axis) == -1)
continue;
if (!have_slot_event) {
queue_push_event(dev, EV_ABS, ABS_MT_SLOT, slot);
last_reported_slot = slot;
have_slot_event = true;
}
queue_push_event(dev, EV_ABS, axis,
*slot_value(dev, slot, axis));
}
}
}
......
......@@ -500,11 +500,11 @@ extern "C" {
* <dd>supported, see libevdev_enable_event_code()</dd>
* <dt>EVIOCGKEYCODE:</dt>
* <dd>currently not supported</dd>
* <dt>EVIOCGKEYCODE:</dt>
* <dd>currently not supported</dd>
* <dt>EVIOCSKEYCODE:</dt>
* <dd>currently not supported</dd>
* <dt>EVIOCSKEYCODE:</dt>
* <dt>EVIOCGKEYCODE_V2:</dt>
* <dd>currently not supported</dd>
* <dt>EVIOCSKEYCODE_V2:</dt>
* <dd>currently not supported</dd>
* <dt>EVIOCGNAME:</dt>
* <dd>supported, see libevdev_get_name()</dd>
......@@ -544,6 +544,10 @@ extern "C" {
* <dt>EVIOCREVOKE:</dt>
* <dd>currently not supported, see
* http://lists.freedesktop.org/archives/input-tools/2014-January/000688.html</dd>
* <dt>EVIOCGMASK:</dt>
* <dd>currently not supported</dd>
* <dt>EVIOCSMASK:</dt>
* <dd>currently not supported</dd>
* </dl>
*
*/
......
project('libevdev', 'c',
version: '1.13.0', # change autotools version too
version: '1.13.3', # change autotools version too
license: 'MIT/Expat',
default_options: [ 'c_std=gnu99', 'warning_level=2' ],
meson_version: '>= 0.56.0')
......@@ -55,8 +55,7 @@ event_names_h = configure_file(input: 'libevdev/libevdev.h',
install_headers('libevdev/libevdev.h',
'libevdev/libevdev-uinput.h',
subdir: 'libevdev-1.0/libevdev')
src_libevdev = [
event_names_h,
src_libevdev = [event_names_h] + files(
'libevdev/libevdev.h',
'libevdev/libevdev-int.h',
'libevdev/libevdev-util.h',
......@@ -67,7 +66,7 @@ src_libevdev = [
'libevdev/libevdev-names.c',
'include/linux/input.h',
'include/linux/uinput.h',
]
)
mapfile = dir_src / 'libevdev.sym'
version_flag = '-Wl,--version-script,@0@'.format(mapfile)
......@@ -81,7 +80,9 @@ lib_libevdev = library('evdev',
install: true
)
dep_libevdev = declare_dependency(link_with: lib_libevdev)
inc_libevdev = include_directories('.')
dep_libevdev = declare_dependency(link_with: lib_libevdev,
include_directories: [inc_libevdev])
pkgconfig.generate(
filebase: 'libevdev',
......@@ -101,34 +102,36 @@ install_man(manpage)
# tools
executable('libevdev-events',
sources: ['tools/libevdev-events.c'],
include_directories: [includes_include],
dependencies: dep_libevdev,
install: false)
executable('libevdev-list-codes',
sources: ['tools/libevdev-list-codes.c'],
include_directories: [includes_include],
dependencies: dep_libevdev,
install: false)
executable('touchpad-edge-detector',
sources: ['tools/touchpad-edge-detector.c'],
include_directories: [includes_include],
dependencies: [dep_libevdev, dep_lm],
install: true)
executable('mouse-dpi-tool',
sources: ['tools/mouse-dpi-tool.c'],
include_directories: [includes_include],
dependencies: dep_libevdev,
install: true)
executable('libevdev-tweak-device',
sources: ['tools/libevdev-tweak-device.c'],
include_directories: [includes_include],
dependencies: dep_libevdev,
install: true)
install_man('tools/libevdev-tweak-device.1',
'tools/touchpad-edge-detector.1',
'tools/mouse-dpi-tool.1')
if not get_option('tools').disabled()
executable('libevdev-events',
sources: ['tools/libevdev-events.c'],
include_directories: [includes_include],
dependencies: dep_libevdev,
install: false)
executable('libevdev-list-codes',
sources: ['tools/libevdev-list-codes.c'],
include_directories: [includes_include],
dependencies: dep_libevdev,
install: false)
executable('touchpad-edge-detector',
sources: ['tools/touchpad-edge-detector.c'],
include_directories: [includes_include],
dependencies: [dep_libevdev, dep_lm],
install: true)
executable('mouse-dpi-tool',
sources: ['tools/mouse-dpi-tool.c'],
include_directories: [includes_include],
dependencies: dep_libevdev,
install: true)
executable('libevdev-tweak-device',
sources: ['tools/libevdev-tweak-device.c'],
include_directories: [includes_include],
dependencies: dep_libevdev,
install: true)
install_man('tools/libevdev-tweak-device.1',
'tools/touchpad-edge-detector.1',
'tools/mouse-dpi-tool.1')
endif
# tests
dep_check = dependency('check', version: '>= 0.9.9',
......@@ -230,8 +233,6 @@ endif
doxygen = find_program('doxygen', required: get_option('documentation'))
if doxygen.found()
doxygen = find_program('doxygen')
src_doxygen = files(
# source files
dir_src / 'libevdev.h',
......
......@@ -2,6 +2,10 @@ option('tests',
type: 'feature',
value: 'enabled',
description: 'Build the tests')
option('tools',
type: 'feature',
value: 'enabled',
description: 'Build the tools')
option('documentation',
type: 'feature',
value: 'enabled',
......
......@@ -1008,6 +1008,206 @@ START_TEST(test_syn_delta_tracking_ids_btntool)
}
END_TEST
START_TEST(test_syn_delta_mt_tool_type)
{
struct uinput_device* uidev;
struct libevdev *dev;
int rc;
struct input_event ev;
int i;
const int num_slots = 15;
int slot = -1;
unsigned long terminated[NLONGS(num_slots)];
struct input_absinfo abs[7] = {
{ .value = ABS_X, .maximum = 1000 },
{ .value = ABS_Y, .maximum = 1000 },
{ .value = ABS_MT_POSITION_X, .maximum = 1000 },
{ .value = ABS_MT_POSITION_Y, .maximum = 1000 },
{ .value = ABS_MT_TOOL_TYPE, .maximum = MT_TOOL_PALM },
{ .value = ABS_MT_SLOT, .maximum = num_slots },
{ .value = ABS_MT_TRACKING_ID, .minimum = -1, .maximum = 0xff },
};
test_create_abs_device(&uidev, &dev,
ARRAY_LENGTH(abs), abs,
EV_SYN, SYN_REPORT,
-1);
for (i = num_slots; i >= 0; i--) {
int tool_type = MT_TOOL_FINGER;
switch (i) {
case 0:
case 1:
case 2:
case 3:
tool_type = MT_TOOL_FINGER;
break;
case 4:
case 5:
case 6:
case 7:
tool_type = MT_TOOL_PALM;
break;
}
uinput_device_event_multiple(uidev,
EV_ABS, ABS_MT_SLOT, i,
EV_ABS, ABS_MT_TRACKING_ID, i,
EV_ABS, ABS_X, 100 + i,
EV_ABS, ABS_Y, 500 + i,
EV_ABS, ABS_MT_POSITION_X, 100 + i,
EV_ABS, ABS_MT_POSITION_Y, 500 + i,
EV_ABS, ABS_MT_TOOL_TYPE, tool_type,
EV_SYN, SYN_REPORT, 0,
-1, -1);
do {
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
ck_assert_int_ne(rc, LIBEVDEV_READ_STATUS_SYNC);
} while (rc >= 0);
}
/* we have a bunch of touches now, and libevdev knows it. Change all
* touches */
for (i = num_slots; i >= 0; i--) {
uinput_device_event(uidev, EV_ABS, ABS_MT_SLOT, i);
switch (i) {
/* Slot 0 is a finger and stays a finger */
case 0:
/* Slot 4 is a palm and stays a palm */
case 4:
uinput_device_event_multiple(uidev,
EV_ABS, ABS_X, 200 + i,
EV_ABS, ABS_Y, 700 + i,
EV_ABS, ABS_MT_POSITION_X, 200 + i,
EV_ABS, ABS_MT_POSITION_Y, 700 + i,
-1, -1);
break;
/* Slot 1 is a finger and changes active touch to palm */
case 1:
uinput_device_event(uidev, EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_PALM);
break;
/* Slot 2 is a finger and terminates */
case 2:
/* Slot 6 is a palm and terminates */
case 6:
uinput_device_event(uidev, EV_ABS, ABS_MT_TRACKING_ID, -1);
break;
/* Slot 3 is a finger and restarts as finger */
case 3:
/* Slot 5 is a palm and restarts as finger */
case 5:
uinput_device_event_multiple(uidev,
EV_ABS, ABS_MT_TRACKING_ID, num_slots + i,
EV_ABS, ABS_X, 200 + i,
EV_ABS, ABS_Y, 700 + i,
EV_ABS, ABS_MT_POSITION_X, 200 + i,
EV_ABS, ABS_MT_POSITION_Y, 700 + i,
EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER,
-1, -1);
break;
/* Slot 7 is a palm and restarts and terminates again as finger */
case 7:
uinput_device_event(uidev, EV_ABS, ABS_MT_TRACKING_ID, -1);
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
uinput_device_event_multiple(uidev,
EV_ABS, ABS_MT_TRACKING_ID, num_slots + i,
EV_ABS, ABS_X, 200 + i,
EV_ABS, ABS_Y, 700 + i,
EV_ABS, ABS_MT_POSITION_X, 200 + i,
EV_ABS, ABS_MT_POSITION_Y, 700 + i,
EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER,
-1, -1);
uinput_device_event(uidev, EV_ABS, ABS_MT_TRACKING_ID, -1);
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
break;
}
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
}
/* Force sync */
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_FORCE_SYNC, &ev);
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SYNC);
/* now check for the right tracking IDs */
memset(terminated, 0, sizeof(terminated));
slot = -1;
while ((rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_SYNC, &ev)) != -EAGAIN) {
if (libevdev_event_is_code(&ev, EV_SYN, SYN_REPORT))
continue;
if (libevdev_event_is_code(&ev, EV_ABS, ABS_MT_SLOT)) {
slot = ev.value;
continue;
}
if (libevdev_event_is_code(&ev, EV_ABS, ABS_X) ||
libevdev_event_is_code(&ev, EV_ABS, ABS_Y))
continue;
ck_assert_int_ne(slot, -1);
if (libevdev_event_is_code(&ev, EV_ABS, ABS_MT_TRACKING_ID)) {
switch (slot) {
case 0:
case 1:
case 4:
ck_abort_msg("No ABS_MT_TRACKING_ID expected for this slot");
break;
case 2:
case 6:
case 7:
ck_assert_int_eq(ev.value, -1);
break;
case 3:
case 5:
if (!bit_is_set(terminated, slot)) {
ck_assert_int_eq(ev.value, -1);
set_bit(terminated, slot);
} else {
ck_assert_int_eq(ev.value, num_slots + slot);
}
break;
}
continue;
}
if (libevdev_event_is_code(&ev, EV_ABS, ABS_MT_TOOL_TYPE)) {
switch (slot) {
case 0:
case 2:
case 3:
case 4:
case 6:
ck_abort_msg("No ABS_MT_TOOL_TYPE expected for this slot");
break;
case 1:
ck_assert_int_eq(ev.value, MT_TOOL_PALM);
break;
case 5:
case 7:
ck_assert_int_eq(ev.value, MT_TOOL_FINGER);
break;
}
continue;
}
switch(ev.code) {
case ABS_MT_POSITION_X:
ck_assert_int_eq(ev.value, 200 + slot);
break;
case ABS_MT_POSITION_Y:
ck_assert_int_eq(ev.value, 700 + slot);
break;
default:
ck_abort();
}
}
uinput_device_free(uidev);
libevdev_free(dev);
}
END_TEST
START_TEST(test_syn_delta_late_sync)
{
struct uinput_device* uidev;
......@@ -2060,6 +2260,7 @@ TEST_SUITE_ROOT_PRIVILEGES(libevdev_events)
add_test(s, test_syn_delta_late_sync);
add_test(s, test_syn_delta_tracking_ids);
add_test(s, test_syn_delta_tracking_ids_btntool);
add_test(s, test_syn_delta_mt_tool_type);
add_test(s, test_skipped_sync);
add_test(s, test_incomplete_sync);
......
......@@ -108,7 +108,7 @@ int main(void)
srunner_add_suite(sr, t->setup());
}
srunner_run_all(sr, CK_NORMAL);
srunner_run_all(sr, CK_ENV);
failed = srunner_ntests_failed(sr);
srunner_free(sr);
......
......@@ -2,6 +2,36 @@
set -e
make
rsync --delete -avz doc/html/ freedesktop.org:/srv/www.freedesktop.org/www/software/libevdev/doc/latest
tag="$1"
case $tag in
-h|--help)
echo "Usage: $0 <tag>"
echo "Builds the libevdev documentation and rsyncs it to the freedesktop.org server."
echo ""
echo "Options:"
echo " tag ... the tag to build (default: master)"
exit 0
;;
1*)
# Helper so we can run it with the numerical tag only, tags
# are all prefixed with libevdev
tag="libevdev-$tag"
;;
**)
;;
esac
tag=${tag:-master}
dir=$(mktemp -d --tmpdir='' libevdev-doc.XXX)
git clone --depth 1 --branch "$tag" https://gitlab.freedesktop.org/libevdev/libevdev.git "$dir"
pushd $dir
builddir=_doc_build
rm -rf "$builddir"
meson setup "$builddir"
ninja -C "$builddir"
# Strip libevdev- prefix from the tag and replace master with latest, whichever applies
htmldir=${tag/#libevdev-/}
htmldir=${htmldir/master/latest}
rsync --delete -avz "$builddir/html/" freedesktop.org:/srv/www.freedesktop.org/www/software/libevdev/doc/${htmldir}
popd