Skip to content
Snippets Groups Projects
Commit 5a48c95a authored by Guido Gunther's avatar Guido Gunther :zzz:
Browse files

Merge branch 'smoketest' into 'master'

Add smoketest

See merge request Librem5/phosh!78
parents b8fb0421 801a08d9
No related branches found
No related tags found
No related merge requests found
variables:
DEPS: build-essential git libwlroots-examples wget gnome-session
gdb weston
before_script:
- apt-get -y update
- apt-get -y install build-essential git libgirepository1.0-dev valac
# We need libhandy in Debian for that
#- apt-get -y build-dep .
- apt-get -y install libgnome-desktop-3-dev libgtk-3-dev libpam0g-dev libupower-glib-dev libwayland-dev meson xvfb xauth
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- apt-get -y install wget gnupg
- echo "deb http://ci.puri.sm/ scratch librem5" > /etc/apt/sources.list.d/ci.list
- wget -O- https://ci.puri.sm/ci-repo.key | apt-key add -
- apt-get -y update
- apt-get -y build-dep .
- apt-get -y install $DEPS
- ulimit -c unlimited
build-native:
stage: build
.tags: &tags
tags:
- librem5
build:native:
<<: *tags
stage: build
artifacts:
paths:
- _build
script:
- export LC_ALL=C.UTF-8
- git clone --depth=1 https://source.puri.sm/Librem5/libhandy
- cd libhandy
- meson . _build -Dgtk_doc=false -Dtests=false -Dexamples=false -Dglade_catalog=false
- ninja -C _build install
- cd ..
- meson . _build
- ninja -C _build
test:native:
<<: *tags
stage: test
dependencies:
- build:native
script:
- export LC_ALL=C.UTF-8
- xvfb-run ninja -C _build test
test:smoke:one-output:
<<: *tags
stage: test
dependencies:
- build:native
script:
- export G_DEBUG=fatal-criticals
- export WLR_X11_OUTPUTS=1
- tests/smoke
test:smoke:two-outputs:
<<: *tags
stage: test
dependencies:
- build:native
script:
- export G_DEBUG=fatal-criticals
- export WLR_X11_OUTPUTS=2
- tests/smoke
......@@ -46,7 +46,9 @@ update_icon (PhoshBatteryInfo *self, gpointer unused)
g_debug ("Updating battery icon");
g_return_if_fail (PHOSH_IS_BATTERY_INFO (self));
priv = phosh_battery_info_get_instance_private (self);
g_return_if_fail (priv->device);
g_object_get (priv->device, "icon-name", &icon_name, NULL);
......@@ -65,12 +67,14 @@ setup_display_device (PhoshBatteryInfo *self)
if (priv->upower == NULL) {
g_warning ("Failed to connect to upowerd: %s", err->message);
g_clear_error (&err);
return;
}
/* TODO: this is a oversimplified sync call */
priv->device = up_client_get_display_device (priv->upower);
if (priv->device == NULL) {
g_warning ("Failed to get upowerd display device");
return;
}
priv->update_icon_id = g_signal_connect_swapped (priv->device,
......@@ -84,11 +88,13 @@ static void
phosh_battery_info_constructed (GObject *object)
{
PhoshBatteryInfo *self = PHOSH_BATTERY_INFO (object);
PhoshBatteryInfoPrivate *priv = phosh_battery_info_get_instance_private (self);
G_OBJECT_CLASS (phosh_battery_info_parent_class)->constructed (object);
setup_display_device (self);
update_icon (self, NULL);
if (priv->device)
update_icon (self, NULL);
}
......
#!/bin/bash
RET=1
set -x
set -e
WORKDIR=$(mktemp -d)
PHOSH_LOG="${WORKDIR}/phosh.log"
WLROOTS_LOG="${WORKDIR}/rootston.log"
ROOTSTON_CONFIG="${WORKDIR}/rootston.ini"
function cleanup () {
[ ! -f core ] || echo bt | gdb -c core _build/src/phosh
[ "${RET}" -eq 0 ] || cat ${WLROOTS_LOG} || true
[ "${RET}" -eq 0 ] || cat ${PHOSH_LOG} || true
[ -z "${XVFB_PID}" ] || kill -9 "${XVFB_PID}" || true
[ -z "${PHOSH_PID}" ] || kill -9 "${PHOSH_PID}" >& /dev/null || true
[ -z "${WORKDIR}" ] || rm -rf "${WORKDIR}"
}
trap cleanup EXIT
cat <<EOF > "${ROOTSTON_CONFIG}"
[output:X11-1]
mode = 768x1024
[output:X11-2]
mode = 1280x800
EOF
XVFB_OPTS="-screen 0 768x1024x24 -ac +extension GLX +render -noreset"
export WLR_BACKENDS=x11
export XDG_RUNTIME_DIR="${WORKDIR}"
xvfb-run -s "${XVFB_OPTS}" -a /usr/lib/wlroots/rootston \
-C "${ROOTSTON_CONFIG}" \
-E "printenv | grep WAYLAND_DISPLAY= > ${WORKDIR}/wl-info" \
>& "${WLROOTS_LOG}" &
XVFB_PID=$!
echo "xvfb PID is $XVFB_PID"
# Wait for startup
WAIT=5
while [ ${WAIT} -gt 0 ]; do
[ ! -f "${WORKDIR}/wl-info" ] || break
sleep 1
((WAIT-=1))
done
. "${WORKDIR}"/wl-info
export WAYLAND_DISPLAY
weston-info
_build/run >& "${PHOSH_LOG}" &
PHOSH_PID=$!
echo "Phosh's PID is $PHOSH_PID"
sleep 1 # give it some time to start
echo -n "Checking if phosh is alive..."
kill -0 $PHOSH_PID
echo "yes."
kill -15 $PHOSH_PID
echo -n "Checking if phosh shutted down..."
sleep 1
! kill -0 $PHOSH_PID >&/dev/null
echo "yes."
if grep "WARNING" "${PHOSH_LOG}"; then
echo "Found error log messages"
cat ${PHOSH_LOG}
# We're having warnings due to missing DBus
# services and gnome-session depending on X11
#exit 1
fi
if grep -E "CRITICAL" "${PHOSH_LOG}"; then
echo "Found error log messages"
cat ${PHOSH_LOG}
exit 1
fi
echo "Started/stopped phosh successfully"
RET=0
exit $RET
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment