Verify backend on CI
This commit is contained in:
parent
23a84b3cd8
commit
7d8da309c2
12 changed files with 204 additions and 6 deletions
|
|
@ -4,20 +4,30 @@ build-buffyboard:
|
||||||
- saas-linux-small-amd64
|
- saas-linux-small-amd64
|
||||||
script:
|
script:
|
||||||
- apk -q add git build-base meson linux-headers inih-dev libinput-dev eudev-dev
|
- apk -q add git build-base meson linux-headers inih-dev libinput-dev eudev-dev
|
||||||
- cd buffyboard
|
|
||||||
- git submodule init
|
- git submodule init
|
||||||
- git submodule update
|
- git submodule update
|
||||||
|
- cd buffyboard
|
||||||
- meson _build
|
- meson _build
|
||||||
- meson compile -C _build
|
- meson compile -C _build
|
||||||
|
|
||||||
build-unl0kr:
|
build-and-test-unl0kr-with-drm:
|
||||||
image: alpine:3.19
|
image: alpine:3.19
|
||||||
tags:
|
tags:
|
||||||
- saas-linux-small-amd64
|
- saas-linux-small-amd64
|
||||||
script:
|
script:
|
||||||
- apk -q add git build-base meson linux-headers inih-dev libinput-dev libxkbcommon-dev libdrm-dev scdoc
|
- apk -q add git bash build-base meson linux-headers inih-dev libinput-dev libxkbcommon-dev libdrm-dev scdoc
|
||||||
- cd unl0kr
|
|
||||||
- git submodule init
|
- git submodule init
|
||||||
- git submodule update
|
- git submodule update
|
||||||
- meson _build
|
- cd unl0kr
|
||||||
- meson compile -C _build
|
- ./test/test-with-drm.sh
|
||||||
|
|
||||||
|
build-and-test-unl0kr-without-drm:
|
||||||
|
image: alpine:3.19
|
||||||
|
tags:
|
||||||
|
- saas-linux-small-amd64
|
||||||
|
script:
|
||||||
|
- apk -q add git bash build-base meson linux-headers inih-dev libinput-dev libxkbcommon-dev scdoc
|
||||||
|
- git submodule init
|
||||||
|
- git submodule update
|
||||||
|
- cd unl0kr
|
||||||
|
- ./test/test-without-drm.sh
|
||||||
|
|
|
||||||
|
|
@ -406,6 +406,7 @@ int main(int argc, char *argv[]) {
|
||||||
switch (conf_opts.general.backend) {
|
switch (conf_opts.general.backend) {
|
||||||
#if LV_USE_LINUX_FBDEV
|
#if LV_USE_LINUX_FBDEV
|
||||||
case UL_BACKENDS_BACKEND_FBDEV:
|
case UL_BACKENDS_BACKEND_FBDEV:
|
||||||
|
bbx_log(BBX_LOG_LEVEL_VERBOSE, "Using framebuffer backend");
|
||||||
disp = lv_linux_fbdev_create();
|
disp = lv_linux_fbdev_create();
|
||||||
lv_linux_fbdev_set_file(disp, "/dev/fb0");
|
lv_linux_fbdev_set_file(disp, "/dev/fb0");
|
||||||
if (conf_opts.quirks.fbdev_force_refresh) {
|
if (conf_opts.quirks.fbdev_force_refresh) {
|
||||||
|
|
@ -415,6 +416,7 @@ int main(int argc, char *argv[]) {
|
||||||
#endif /* LV_USE_LINUX_FBDEV */
|
#endif /* LV_USE_LINUX_FBDEV */
|
||||||
#if LV_USE_LINUX_DRM
|
#if LV_USE_LINUX_DRM
|
||||||
case UL_BACKENDS_BACKEND_DRM:
|
case UL_BACKENDS_BACKEND_DRM:
|
||||||
|
bbx_log(BBX_LOG_LEVEL_VERBOSE, "Using DRM backend");
|
||||||
disp = lv_linux_drm_create();
|
disp = lv_linux_drm_create();
|
||||||
lv_linux_drm_set_file(disp, "/dev/dri/card0", -1);
|
lv_linux_drm_set_file(disp, "/dev/dri/card0", -1);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
5
unl0kr/test/build-with-drm.sh
Executable file
5
unl0kr/test/build-with-drm.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
rm -rf _build
|
||||||
|
meson _build
|
||||||
|
meson compile -C _build
|
||||||
5
unl0kr/test/build-without-drm.sh
Executable file
5
unl0kr/test/build-without-drm.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
rm -rf _build
|
||||||
|
meson _build -Dwith-drm=disabled
|
||||||
|
meson compile -C _build
|
||||||
25
unl0kr/test/helpers.sh
Normal file
25
unl0kr/test/helpers.sh
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function info() {
|
||||||
|
echo -e "[Info] $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
function error() {
|
||||||
|
echo -e "\e[31m[Error]\e[0m $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
function ok() {
|
||||||
|
echo -e "\e[32m[Ok]\e[0m $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
function run_unl0kr() {
|
||||||
|
local log=$1
|
||||||
|
local conf=$2
|
||||||
|
|
||||||
|
./_build/unl0kr -v -C "$conf" > "$log" 2>&1 &
|
||||||
|
pid=$!
|
||||||
|
sleep 3
|
||||||
|
|
||||||
|
kill -9 $pid
|
||||||
|
wait $pid > /dev/null 2>&1
|
||||||
|
}
|
||||||
6
unl0kr/test/test-all.sh
Executable file
6
unl0kr/test/test-all.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
root=$(dirname "${BASH_SOURCE[0]}")
|
||||||
|
|
||||||
|
"$root/test-with-drm.sh"
|
||||||
|
"$root/test-without-drm.sh"
|
||||||
30
unl0kr/test/test-uses-drm-backend-if-selected-via-config-and-available.sh
Executable file
30
unl0kr/test/test-uses-drm-backend-if-selected-via-config-and-available.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
log=tmp.log
|
||||||
|
conf=tmp.conf
|
||||||
|
|
||||||
|
source "$(dirname "${BASH_SOURCE[0]}")/helpers.sh"
|
||||||
|
|
||||||
|
function clean_up() {
|
||||||
|
rm -f "$log" "$conf"
|
||||||
|
}
|
||||||
|
|
||||||
|
trap clean_up EXIT
|
||||||
|
|
||||||
|
info "Writing config"
|
||||||
|
cat << EOF > "$conf"
|
||||||
|
[general]
|
||||||
|
backend=drm
|
||||||
|
EOF
|
||||||
|
|
||||||
|
info "Running unl0kr"
|
||||||
|
run_unl0kr "$log" "$conf"
|
||||||
|
|
||||||
|
info "Verifying output"
|
||||||
|
if ! grep "Using DRM backend" "$log"; then
|
||||||
|
error "Expected DRM backend to be selected"
|
||||||
|
cat "$log"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ok
|
||||||
23
unl0kr/test/test-uses-fb-backend-by-default.sh
Executable file
23
unl0kr/test/test-uses-fb-backend-by-default.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
log=tmp.log
|
||||||
|
|
||||||
|
source "$(dirname "${BASH_SOURCE[0]}")/helpers.sh"
|
||||||
|
|
||||||
|
function clean_up() {
|
||||||
|
rm -f "$log"
|
||||||
|
}
|
||||||
|
|
||||||
|
trap clean_up EXIT
|
||||||
|
|
||||||
|
info "Running unl0kr"
|
||||||
|
run_unl0kr "$log"
|
||||||
|
|
||||||
|
info "Verifying output"
|
||||||
|
if ! grep "Using framebuffer backend" "$log"; then
|
||||||
|
error "Expected framebuffer backend to be selected"
|
||||||
|
cat "$log"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ok
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
log=tmp.log
|
||||||
|
conf=tmp.conf
|
||||||
|
|
||||||
|
source "$(dirname "${BASH_SOURCE[0]}")/helpers.sh"
|
||||||
|
|
||||||
|
function clean_up() {
|
||||||
|
rm -f "$log" "$conf"
|
||||||
|
}
|
||||||
|
|
||||||
|
trap clean_up EXIT
|
||||||
|
|
||||||
|
info "Writing config"
|
||||||
|
cat << EOF > "$conf"
|
||||||
|
[general]
|
||||||
|
backend=drm
|
||||||
|
EOF
|
||||||
|
|
||||||
|
info "Running unl0kr"
|
||||||
|
run_unl0kr "$log" "$conf"
|
||||||
|
|
||||||
|
info "Verifying output"
|
||||||
|
if ! grep "Using framebuffer backend" "$log"; then
|
||||||
|
error "Expected framebuffer backend to be selected"
|
||||||
|
cat "$log"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ok
|
||||||
30
unl0kr/test/test-uses-fb-backend-if-selected-via-config.sh
Executable file
30
unl0kr/test/test-uses-fb-backend-if-selected-via-config.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
log=tmp.log
|
||||||
|
conf=tmp.conf
|
||||||
|
|
||||||
|
source "$(dirname "${BASH_SOURCE[0]}")/helpers.sh"
|
||||||
|
|
||||||
|
function clean_up() {
|
||||||
|
rm -f "$log" "$conf"
|
||||||
|
}
|
||||||
|
|
||||||
|
trap clean_up EXIT
|
||||||
|
|
||||||
|
info "Writing config"
|
||||||
|
cat << EOF > "$conf"
|
||||||
|
[general]
|
||||||
|
backend=fb
|
||||||
|
EOF
|
||||||
|
|
||||||
|
info "Running unl0kr"
|
||||||
|
run_unl0kr "$log" "$conf"
|
||||||
|
|
||||||
|
info "Verifying output"
|
||||||
|
if ! grep "Using framebuffer backend" "$log"; then
|
||||||
|
error "Expected framebuffer backend to be selected"
|
||||||
|
cat "$log"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ok
|
||||||
16
unl0kr/test/test-with-drm.sh
Executable file
16
unl0kr/test/test-with-drm.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
root=$(dirname "${BASH_SOURCE[0]}")
|
||||||
|
|
||||||
|
source "$root/helpers.sh"
|
||||||
|
|
||||||
|
function run() {
|
||||||
|
info "Executing $1"
|
||||||
|
"$1"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
run "$root/build-with-drm.sh"
|
||||||
|
run "$root/test-uses-fb-backend-by-default.sh"
|
||||||
|
run "$root/test-uses-fb-backend-if-selected-via-config.sh"
|
||||||
|
run "$root/test-uses-drm-backend-if-selected-via-config-and-available.sh"
|
||||||
16
unl0kr/test/test-without-drm.sh
Executable file
16
unl0kr/test/test-without-drm.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
root=$(dirname "${BASH_SOURCE[0]}")
|
||||||
|
|
||||||
|
source "$root/helpers.sh"
|
||||||
|
|
||||||
|
function run() {
|
||||||
|
info "Executing $1"
|
||||||
|
"$1"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
run "$root/build-without-drm.sh"
|
||||||
|
run "$root/test-uses-fb-backend-by-default.sh"
|
||||||
|
run "$root/test-uses-fb-backend-if-selected-via-config.sh"
|
||||||
|
run "$root/test-uses-fb-backend-if-drm-selected-via-config-but-unavailable.sh"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue