summaryrefslogtreecommitdiffstats
path: root/debian/tests/build-login
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:35:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:35:19 +0000
commitb7e8d5af06ee840cc48217ca4629cf28aeeb3c50 (patch)
tree6aa8dc840b085de50db46e2ad0725eae248fef02 /debian/tests/build-login
parentAdding upstream version 252.22. (diff)
downloadsystemd-b7e8d5af06ee840cc48217ca4629cf28aeeb3c50.tar.xz
systemd-b7e8d5af06ee840cc48217ca4629cf28aeeb3c50.zip
Adding debian version 252.22-1~deb12u1.debian/252.22-1_deb12u1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/build-login')
-rwxr-xr-xdebian/tests/build-login38
1 files changed, 38 insertions, 0 deletions
diff --git a/debian/tests/build-login b/debian/tests/build-login
new file mode 100755
index 0000000..def83b1
--- /dev/null
+++ b/debian/tests/build-login
@@ -0,0 +1,38 @@
+#!/bin/sh
+# autopkgtest check: Test build against libsystemd-login-dev
+# (C) 2014 Canonical Ltd.
+# Author: Martin Pitt <martin.pitt@ubuntu.com>
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+cat <<EOF > loginmonitor.c
+#include <assert.h>
+#include <stdio.h>
+#include <systemd/sd-login.h>
+
+int main(int argc, char **argv)
+{
+ sd_login_monitor* mon = NULL;
+ int res;
+
+ res = sd_login_monitor_new(NULL, &mon);
+ if (res < 0) {
+ fprintf(stderr, "sd_login_monitor_new failed with value %i\n", res);
+ return 1;
+ }
+
+ assert(sd_login_monitor_get_fd(mon) > 0);
+ sd_login_monitor_unref(mon);
+
+ return 0;
+}
+EOF
+
+gcc -Wall -Werror -o loginmonitor loginmonitor.c `pkg-config --cflags --libs libsystemd`
+echo "build: OK"
+[ -x loginmonitor ]
+./loginmonitor
+echo "run: OK"