summaryrefslogtreecommitdiffstats
path: root/debian/tests/build-with-static-libsystemd
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:53 +0000
commit87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68 (patch)
tree263fc56d7d40512aaa09193905008a3f4e3b0018 /debian/tests/build-with-static-libsystemd
parentAdding upstream version 255.4. (diff)
downloadsystemd-87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68.tar.xz
systemd-87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68.zip
Adding debian version 255.4-1.debian/255.4-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/build-with-static-libsystemd')
-rwxr-xr-xdebian/tests/build-with-static-libsystemd38
1 files changed, 38 insertions, 0 deletions
diff --git a/debian/tests/build-with-static-libsystemd b/debian/tests/build-with-static-libsystemd
new file mode 100755
index 0000000..6b91009
--- /dev/null
+++ b/debian/tests/build-with-static-libsystemd
@@ -0,0 +1,38 @@
+#!/bin/sh
+# autopkgtest check: Test build against static libsystemd
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+cat <<EOF > uuid-gen.c
+#include <assert.h>
+#include <stdio.h>
+
+#include <systemd/sd-id128.h>
+
+int main(void)
+{
+ sd_id128_t id;
+ char id_str[SD_ID128_STRING_MAX];
+ int r;
+
+ r = sd_id128_randomize(&id);
+ if (r < 0) {
+ fprintf(stderr, "Failed to generate id: %s\n", strerror(-r));
+ return 1;
+ }
+
+ assert(sd_id128_to_string(id, id_str) > 0);
+ printf("uuid: %s\n", id_str);
+
+ return 0;
+}
+EOF
+
+gcc -Wall -Werror -o uuid-gen uuid-gen.c -l:libsystemd.a -lcap
+echo "build: OK"
+[ -x uuid-gen ]
+./uuid-gen
+echo "run: OK"