mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-08-28 18:15:42 +00:00
c019e11cc0
There are several points in swupd that we find conditions that should never happen, but we try to correct them anyway to be more reliable. Because of that we may hide programming mistakes that are corrected later. So, to make sure we are going to catch those problems in debug mode in our development machines and test environment, I am suggesting a UNEXPECTED() macro that aborts swupd if --enable-debug was used to build swupd. I am adding some examples on what we could do with that. Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
30 lines
1.1 KiB
Bash
Executable File
30 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Install all dependencies available on ubuntu-latest from github actions to
|
|
# build swupd and run all tests.
|
|
# Builds swupd with configuration needed to run swupd tests
|
|
|
|
set -e
|
|
CORES=2
|
|
|
|
# Install dependencies from ubuntu
|
|
sudo apt-get install python3-docutils
|
|
sudo apt-get install check
|
|
sudo apt-get install bats
|
|
sudo ln -s /bin/systemctl /usr/bin/systemctl
|
|
|
|
# Use rst2man from python3
|
|
sudo ln -s /usr/share/docutils/scripts/python3/rst2man /usr/bin/rst2man.py
|
|
|
|
# Build Swupd
|
|
autoreconf --verbose --warnings=none --install --force
|
|
./configure CFLAGS="$CFLAGS -fsanitize=address -Werror" --prefix=/usr --with-fallback-capaths="$PWD"/swupd_test_certificates --with-systemdsystemunitdir=/usr/lib/systemd/system --with-config-file-path="$PWD"/testconfig --enable-debug
|
|
make -j$CORES
|
|
|
|
# Needed to initialize the host for auto-update. Without these steps auto-update
|
|
# within a --path would just not work
|
|
sudo mkdir -p /usr/lib/systemd/system/
|
|
sudo cp data/swupd-update.service /usr/lib/systemd/system/
|
|
sudo cp data/swupd-update.timer /usr/lib/systemd/system/
|
|
sudo systemctl enable swupd-update.timer
|
|
sudo systemctl restart swupd-update.timer
|