Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
0339c3c99b
!34 增加测试超时
From: @laokz 
Reviewed-by: @open-bot 
Signed-off-by: @open-bot
2024-11-14 02:28:38 +00:00
laokz
ae8fecf6e5 Increase tests timeout 2024-11-02 15:33:22 +08:00
openeuler-ci-bot
96def37475
!31 [sync] PR-29: Add check require libxkbcommon
From: @openeuler-sync-bot 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
2024-04-11 08:46:55 +00:00
lingsheng
260aadd01b Add check require libxkbcommon
Signed-off-by: lingsheng <860373352@qq.com>
(cherry picked from commit 1a0489ed3c245b90a2a4f9240ff10196ddad8d1d)
2024-04-11 16:32:35 +08:00
openeuler-ci-bot
62ca5ababb
!24 enable make check
From: @zppzhangpan 
Reviewed-by: @leeffo 
Signed-off-by: @leeffo
2023-09-26 09:43:10 +00:00
zppzhangpan
126a9a0041 enable make check 2023-09-21 14:16:41 +08:00
openeuler-ci-bot
bd9f39eab0
!22 update to 2.39
From: @zppzhangpan 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
2023-08-02 08:45:40 +00:00
zhangpan
dad9841e98 update to 2.39 2023-07-19 07:38:44 +00:00
openeuler-ci-bot
0cb4d1dd95
!16 fix taiwan to China Taiwan
From: @leeffo 
Reviewed-by: @weidongkl 
Signed-off-by: @
2023-05-08 03:37:23 +00:00
liweiganga
3d9a5ab349 fix taiwan to China Taiwan 2023-05-06 15:08:20 +08:00
4 changed files with 128 additions and 3 deletions

View File

@ -0,0 +1,101 @@
From f7e5a8c0ec9801554fec74ac8fc575523e3f6779 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu, 29 Jun 2023 10:17:16 +1000
Subject: [PATCH] meson: run the pytest test suite as part of meson test
If pytest is available, run the test suite during meson test.
This requires a bit of fiddling around because the test suite expects
the XKB directory to be properly laid out but that doesn't happen with
meson until install. Luckily all we need to do here is copy our KcCGST
directories over to the build directory and then we can use that as
XKB_CONFIG_ROOT for pytest.
An optional hook for pytest-xdist is integrated too - on my machine the
test run goes from 25s to 10s with xdist on -n auto. This does require
a conftest.py so we don't hog all the cores available on the CI runners.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reference:https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/commit/f7e5a8c0ec9801554fec74ac8fc575523e3f6779
Conflict:NA
---
meson.build | 28 ++++++++++++++++++++++++++++
tests/conftest.py | 16 ++++++++++++++++
tests/copydir.sh | 5 +++++
3 files changed, 49 insertions(+)
create mode 100644 tests/conftest.py
create mode 100755 tests/copydir.sh
diff --git a/meson.build b/meson.build
index 91a4b4c3..4bb3a08d 100644
--- a/meson.build
+++ b/meson.build
@@ -58,4 +58,32 @@ if xsltproc.found()
endif
+# pytest suite
+pymod = import('python')
+python = pymod.find_installation('python3',
+ modules: ['pytest'],
+ required: false)
+pytest = find_program('pytest-3', 'pytest', required: false)
+enable_pytest = python.found() and pytest.found()
+if enable_pytest
+ pytest_args = ['--verbose', '--log-level=DEBUG']
+ # use pytest xdist if available, it really speeds up the tests cases
+ optional_python_modules = ['xdist']
+ if pymod.find_installation('python3', modules: optional_python_modules, required: false).found()
+ pytest_args += ['-n', 'auto']
+ endif
+
+ # copy our data files over to the build directory so we can use the
+ # builddir as XKB_CONFIG_ROOT
+ foreach dir: ['compat', 'geometry', 'keycodes', 'symbols', 'types']
+ run_command('tests/copydir.sh', dir, check: true)
+ endforeach
+
+ test('pytest', pytest,
+ args: pytest_args,
+ env: ['XKB_CONFIG_ROOT=@0@'.format(meson.build_root())],
+ workdir: meson.source_root(),
+ timeout: 60)
+endif
+
subdir('po')
diff --git a/tests/conftest.py b/tests/conftest.py
new file mode 100644
index 00000000..9befeb7a
--- /dev/null
+++ b/tests/conftest.py
@@ -0,0 +1,16 @@
+import os
+import sys
+from pathlib import Path
+
+tests_dir = Path(__file__).parent.resolve()
+sys.path.insert(0, str(tests_dir))
+
+try:
+ import xdist # noqa: F401
+
+ # Otherwise we get unknown hook 'pytest_xdist_auto_num_workers'
+ def pytest_xdist_auto_num_workers(config):
+ return os.getenv("FDO_CI_CONCURRENT", None)
+
+except ImportError:
+ pass
diff --git a/tests/copydir.sh b/tests/copydir.sh
new file mode 100755
index 00000000..6f48c1fc
--- /dev/null
+++ b/tests/copydir.sh
@@ -0,0 +1,5 @@
+#!/bin/sh -ex
+
+dir="$1"
+mkdir -p "$MESON_BUILD_ROOT/$MESON_SUBDIR"
+cp -r "$MESON_SOURCE_ROOT/$MESON_SUBDIR/$dir/" "$MESON_BUILD_ROOT/$MESON_SUBDIR/"
--
GitLab

Binary file not shown.

Binary file not shown.

View File

@ -1,15 +1,17 @@
Name: xkeyboard-config
Version: 2.38
Release: 1
Version: 2.39
Release: 4
Summary: The X Keyboard Extension
License: MIT
URL: https://www.freedesktop.org/wiki/Software/XKeyboardConfig
Source0: https://xorg.freedesktop.org/archive/individual/data/%{name}/%{name}-%{version}.tar.xz
Patch6000: backport-run-the-pytest-test-suite-as-part-of-meson-test.patch
BuildArch: noarch
BuildRequires: gettext gettext-devel libtool libxslt perl(XML::Parser) pkgconfig(glib-2.0) xkbcomp meson
BuildRequires: pkgconfig(x11) >= 1.4.3 pkgconfig(xorg-macros) >= 1.12 pkgconfig(xproto) >= 7.0.20
BuildRequires: pkgconfig(x11) >= 1.4.3 pkgconfig(xorg-macros) >= 1.12 pkgconfig(xproto) >= 7.0.20 pytest
BuildRequires: libxkbcommon
%description
The non-arch keyboard configuration database for X Window. The goal is to
@ -29,6 +31,10 @@ Header files for xkeyboard-config
%prep
%autosetup -n %{name}-%{version} -p1
# fix taiwan to china taiwan
sed -i 's|Taiwanese|Chinese Taiwan|' po/* rules/base.xml symbols/cn symbols/sun_vndr/tw symbols/tw
sed -i 's|Taiwan)|Taiwan China)|' po/* geometry/sun rules/base.xml symbols/tw
%build
%meson -Dcompat-rules=true -Dxorg-rules-symlinks=true
%meson_build
@ -44,6 +50,9 @@ Header files for xkeyboard-config
popd
}
%check
%meson_test -t 3
%files
%defattr(-,root,root)
%doc AUTHORS
@ -61,6 +70,21 @@ Header files for xkeyboard-config
%{_mandir}/man7/xkeyboard-config.*
%changelog
* Mon Nov 04 2024 laokz <zhangkai@iscas.ac.cn> - 2.39-4
- Increase tests timeout
* Thu Apr 11 2024 lingsheng <lingsheng1@h-partners.com> - 2.39-3
- Add check require libxkbcommon
* Thu Sep 21 2023 zhangpan <zhangpan103@h-partners.com> - 2.39-2
- enable make check
* Wed Jul 19 2023 zhangpan <zhangpan103@h-partners.com> - 2.39-1
- update to 2.39
* Sat May 06 2023 leeffo <liweiganga@uniontech.com> - 2.38-2
- fix taiwan to china taiwan
* Mon Feb 06 2023 zhangpan <zhangpan@h-partners.com> - 2.38-1
- update to 2.38