diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-06-06 23:11:31 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-06-06 23:11:31 -0500 |
commit | 9919a69180a8b2edd9368e1e5fa0ba2e80af70ae (patch) | |
tree | a371b4eec834608b181b4bde1929a4f157918d13 | |
parent | 63674cd048f2763638d155cf515be08cc41e99f9 (diff) | |
download | abuild-9919a69180a8b2edd9368e1e5fa0ba2e80af70ae.tar.gz abuild-9919a69180a8b2edd9368e1e5fa0ba2e80af70ae.tar.bz2 abuild-9919a69180a8b2edd9368e1e5fa0ba2e80af70ae.tar.xz abuild-9919a69180a8b2edd9368e1e5fa0ba2e80af70ae.zip |
abuild: Add checkx11 option
This allows test suites that require X11 and/or D-Bus to run.
-rw-r--r-- | APKBUILD.5 | 6 | ||||
-rw-r--r-- | abuild.in | 12 |
2 files changed, 18 insertions, 0 deletions
@@ -302,6 +302,12 @@ The reason for disabling the check phase should be noted in a comment. Specifies that the package's test suite will be run in .Xr fakeroot 8 . This is necessary for some test suites which fail when run as non-root. +.It Cm checkx11 +Specifies that the package's test suite requires a running X11 server. +This will spawn a D-Bus session bus connected to an Xvfb on display +number 7. The framebuffer can be monitored by running the command +.Cm xwud -in /tmp/Xvfb_screen0 +if desired. .It Cm !dbg Specifies that the package should not be built with a debug information package. @@ -73,6 +73,7 @@ want_check() { [ -n "$ABUILD_BOOTSTRAP" ] && return 1 cross_compiling && return 1 options_has "!check" && return 1 + options_has "checkx11" && checkdepends="$checkdepends xvfb dbus-x11" return 0 } @@ -1533,6 +1534,9 @@ build_abuildrepo() { if options_has "checkroot"; then _check=check_fakeroot fi + if options_has "checkx11"; then + _check=check_x11 + fi if ! want_check; then _check=true fi @@ -1787,6 +1791,14 @@ check_fakeroot() { do_fakeroot "$abuild_path" $forceroot $color_opt $keep_build check } +# wrap check() for tests requiring X11 and/or D-Bus +check_x11() { + cd "$startdir" + Xvfb :7 -screen 0 1280x1024x24 -fbdir /tmp & + trap "kill %1" 0 + env DISPLAY=:7 dbus-run-session "$abuild_path" $forceroot $color_opt $keep_build check +} + # build and package in fakeroot rootpkg() { cd "$startdir" |