Start dbus in the container for being able to run the test suite

We don't need a full systemd service, just dbus-daemon to be started.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires
2017-07-26 12:10:52 +02:00
parent 7c313a31fd
commit 7e9566b00f
3 changed files with 12 additions and 25 deletions

View File

@@ -45,12 +45,18 @@ libratbag_references:
name: Ninja scan-build
environment:
NINJA_ARGS: scan-build
start_dbus: &start_dbus
run:
name: Start dbus daemon
command: |
mkdir /run/dbus
/usr/bin/dbus-daemon --system --fork
fedora_install: &fedora_install
run:
name: Install prerequisites
command: dnf install -y tree git gcc gcc-c++ meson check-devel libudev-devel libevdev-devel doxygen graphviz valgrind python3-gobject
command: dnf install -y tree git gcc gcc-c++ meson check-devel libudev-devel libevdev-devel doxygen graphviz valgrind python3-gobject python3-evdev
fedora_settings: &fedora_settings
@@ -58,6 +64,7 @@ fedora_settings: &fedora_settings
steps:
- *fedora_install
- checkout
- *start_dbus
- *build_and_test
- *install
- *check_uninstall
@@ -74,8 +81,9 @@ ubuntu_settings: &ubuntu_settings
apt-get install -y software-properties-common
add-apt-repository universe
apt-get update
apt-get install -y tree git gcc g++ pkg-config meson check libudev-dev libevdev-dev libsystemd-dev doxygen graphviz valgrind python3-gi
apt-get install -y tree git gcc g++ pkg-config meson check libudev-dev libevdev-dev libsystemd-dev doxygen graphviz valgrind python3-gi python3-evdev
- checkout
- *start_dbus
- *build_and_test
- *install
- *check_uninstall

View File

@@ -516,8 +516,8 @@ configure_file(input : 'tools/ratbagctl.devel.in',
configure_file(input : 'tools/ratbagctl.test.in',
output : 'ratbagctl.test',
configuration : config_ratbagctl_devel)
ratbagctl_test_wrapper = find_program('tools/ratbagctl.test.wrapper')
test('ratbagctl-test', ratbagctl_test_wrapper, args: [meson.build_root()])
ratbagctl_test = find_program('build/ratbagctl.test')
test('ratbagctl-test', ratbagctl_test, args: ['-v'])
#### output files ####
configure_file(output: 'config.h', install: false, configuration: config_h)

View File

@@ -1,21 +0,0 @@
#!/bin/sh
#
# Wrapper to execute ratbagctl.test. Required because meson does not allow
# a configure_file() output to be used as test. And besides, we need to run
# this as root anyway.
#
if [ `whoami` != "root" ]; then
echo "This test must be run as root"
# Skippedy skip skip
exit 77
fi
if ! [ -z "$CIRCLECI" ]; then
echo "CircleCI does not have DBus. Skipping test"
# Skippedy skip skip
exit 77
fi
MESON_BUILD_ROOT="$1"
"$MESON_BUILD_ROOT"/ratbagctl.test