X-Git-Url: http://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/4081782832b7dc8b7426cedcec9a4495229dda6c..0ee27791cef1166e467dc0b3eba88656d835ab32:/tests/libs.at diff --git a/tests/libs.at b/tests/libs.at index 1d327cc..f7cf534 100644 --- a/tests/libs.at +++ b/tests/libs.at @@ -1,4 +1,4 @@ -dnl Copyright © 2019-2020, 2022 Nick Bowler +dnl Copyright © 2019-2020, 2022-2023 Nick Bowler dnl dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2. dnl This is free software: you are free to do what the fuck you want to. @@ -355,3 +355,43 @@ AT_CHECK([grep '#.*G_IMPLEMENT_INLINES' config.h], [0], ]) AT_CLEANUP + +AT_SETUP([DX_CHECK_SYSLOG]) + +AT_DATA([syslog.h], +[[/* since syslog is normally in the standard C library, to make negative +link tests possible we use a dummy external name */ +extern void dx_closelog(void); + +static void openlog(const char *, int, int) { dx_closelog(); } +static void syslog(int, const char *, ...) { dx_closelog(); } +static void closelog(void) { dx_closelog(); } + +#define LOG_PID 1 +#define LOG_USER 2 +#define LOG_ERR 0 +]]) + +AT_DATA([test.in], +[[@ac_cv_header_syslog_h@ +@dx_cv_have_syslog@ +]]) + +TEST_CONFIGURE_AC([[DX_CHECK_SYSLOG +AC_SUBST([ac_cv_header_syslog_h]) +AC_SUBST([dx_cv_have_syslog]) +AC_CONFIG_FILES([test]) +]]) +TEST_AUTORECONF + +TEST_CONFIGURE([CFLAGS=-I.]) +AT_CHECK([cat test], [0], [yes +no +]) + +TEST_CONFIGURE([CFLAGS=-I. LIBS="$builddir/t/libdummy.a"]) +AT_CHECK([cat test], [0], [yes +yes +]) + +AT_CLEANUP