Skip to content

Commit 786bd08

Browse files
vigneshramanmripard
authored andcommitted
drm/ci: Add jobs to run KUnit tests
Add jobs to run KUnit tests using tools/testing/kunit/kunit.py tool. Signed-off-by: Vignesh Raman <[email protected]> Acked-by: Helen Koike <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
1 parent deac70a commit 786bd08

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

drivers/gpu/drm/ci/gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ include:
111111
- drivers/gpu/drm/ci/build.yml
112112
- drivers/gpu/drm/ci/test.yml
113113
- drivers/gpu/drm/ci/check-devicetrees.yml
114+
- drivers/gpu/drm/ci/kunit.yml
114115
- 'https://gitlab.freedesktop.org/gfx-ci/lab-status/-/raw/main/lab-status.yml'
115116

116117

@@ -121,6 +122,7 @@ stages:
121122
- build-for-tests
122123
- build-only
123124
- static-checks
125+
- kunit
124126
- code-validation
125127
- amdgpu
126128
- i915

drivers/gpu/drm/ci/kunit.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: MIT
3+
4+
set -euxo pipefail
5+
6+
: "${KERNEL_ARCH:?ERROR: KERNEL_ARCH must be set}"
7+
: "${LLVM_VERSION:?ERROR: LLVM_VERSION must be set}"
8+
9+
./drivers/gpu/drm/ci/setup-llvm-links.sh
10+
11+
export PATH="/usr/bin:$PATH"
12+
13+
./tools/testing/kunit/kunit.py run \
14+
--arch "${KERNEL_ARCH}" \
15+
--make_options LLVM=1 \
16+
--kunitconfig=drivers/gpu/drm/tests

drivers/gpu/drm/ci/kunit.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.kunit-packages: &kunit-packages
2+
- apt-get update -qq
3+
# Minimum supported version of LLVM for building x86 kernels is 15.0.0.
4+
# In mesa-ci containers, LLVM_VERSION is defined as a container-level property and is currently set to 19.
5+
- apt-get install -y --no-install-recommends clang-${LLVM_VERSION} lld-${LLVM_VERSION} llvm-${LLVM_VERSION}
6+
7+
.kunit-base:
8+
stage: kunit
9+
timeout: "30m"
10+
variables:
11+
GIT_DEPTH: 1
12+
script:
13+
- drivers/gpu/drm/ci/kunit.sh
14+
15+
kunit:arm32:
16+
extends:
17+
- .build:arm32
18+
- .kunit-base
19+
before_script:
20+
- *kunit-packages
21+
- apt-get install -y --no-install-recommends qemu-system-arm
22+
23+
kunit:arm64:
24+
extends:
25+
- .build:arm64
26+
- .kunit-base
27+
before_script:
28+
- *kunit-packages
29+
- apt-get install -y --no-install-recommends qemu-system-aarch64
30+
31+
kunit:x86_64:
32+
extends:
33+
- .build:x86_64
34+
- .kunit-base
35+
before_script:
36+
- *kunit-packages
37+
- apt-get install -y --no-install-recommends qemu-system-x86

0 commit comments

Comments
 (0)