Debian Codegraph @

tests/ci/build-and-test.sh

raw
1 #!/bin/sh
2 set -e
3
4 if [ -d "build" ]; then
5 rm build -rf
6 fi
7 set -x
8
9 meson setup build \
10 -Dmaintainer=true \
11 -Dlocal_checkout=true \
12 -Dlegacy_tools=true \
13 -Ddaemon_tests=true \
14 $@
15
16 DUMMY_DESTDIR=/tmp/install-root/
17 rm -rf $DUMMY_DESTDIR
18
19 #
20 # Build & Install
21 #
22 ninja -C build
23 DESTDIR=$DUMMY_DESTDIR ninja -C build install
24
25 #
26 # Run tests
27 #
28
29 # Run the regular test suite (the end-to-end tests are run separately
30 # below, as they need extra setup and must run as root)
31 meson test -C build \
32 --no-suite e2e \
33 -v \
34 --print-errorlogs
35
36 # Run the end-to-end integration suite. It needs the D-Bus and polkit policy
37 # installed to their system paths so the bus and polkitd honour them; the test
38 # wrapper starts a private system bus and polkitd on demand (and tears them
39 # down) if none are running. It runs as root so packagekitd can own its name.
40 install -Dm644 build/data/org.freedesktop.PackageKit.conf \
41 /usr/share/dbus-1/system.d/org.freedesktop.PackageKit.conf
42 install -Dm644 build/policy/org.freedesktop.packagekit.policy \
43 /usr/share/polkit-1/actions/org.freedesktop.packagekit.policy
44 install -Dm644 policy/org.freedesktop.packagekit.rules \
45 /usr/share/polkit-1/rules.d/org.freedesktop.packagekit.rules
46
47 meson test -C build \
48 --suite e2e \
49 -v \
50 --print-errorlogs