Skip to content

Commit

Permalink
Fix test and update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
wismill committed Jun 21, 2023
1 parent 26a40ee commit a1ee3b3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,23 @@ jobs:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade meson PyYAML
sudo apt update
sudo apt install -y \
doxygen libxcb-xkb-dev valgrind ninja-build \
libwayland-dev wayland-protocols bison graphviz
doxygen libxcb-xkb-dev valgrind ninja-build meson \
libwayland-dev wayland-protocols bison graphviz curl
python -m pip install --upgrade PyYAML
- name: Install xkeyboard-config
run: |
# HACK: Force xkeyboard-config version
pushd ~
XKC_VER=2.39
curl -O "https://www.x.org/releases/individual/data/xkeyboard-config/xkeyboard-config-$XKC_VER.tar.xz"
tar -xf "xkeyboard-config-$XKC_VER.tar.xz"
cd "xkeyboard-config-$XKC_VER"
BUILDDIR=build
meson setup $BUILDDIR -Dprefix=/usr
sudo meson install -C $BUILDDIR
popd
- name: Setup
run: |
# -gdwarf-4 - see https://github.com/llvm/llvm-project/issues/56550.
Expand Down
9 changes: 6 additions & 3 deletions test/x11comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ main(void)
pid_t xkbcomp_pid;

char *xhost = NULL;
int xdpy_current;
int xdpy_current = 0;
int xdpy_candidate;

/*
Expand All @@ -71,8 +71,9 @@ main(void)
* 6. Kill the server & clean up.
*/

// NOTE: it is OK if it fails.
ret = xcb_parse_display(NULL, &xhost, &xdpy_current, NULL);
assert(ret != 0);

/*
* IANA assigns TCP port numbers from 6000 through 6063 to X11
* clients. In addition, the current XCB implementaion shows
Expand All @@ -85,7 +86,9 @@ main(void)
if (xdpy_candidate == xdpy_current) {
continue;
}
snprintf(display, sizeof(display), "%s:%d", xhost, xdpy_candidate);
snprintf(display, sizeof(display),
"%s:%d", (xhost != NULL) ? xhost : "",
xdpy_candidate);
ret = posix_spawnp(&xvfb_pid, "Xvfb", NULL, NULL, xvfb_argv, envp);
if (ret == 0) {
break;
Expand Down

0 comments on commit a1ee3b3

Please sign in to comment.