summaryrefslogtreecommitdiffstats
path: root/mk
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:39:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:39:28 +0000
commit924f5ea83e48277e014ebf0d19a27187cb93e2f7 (patch)
tree75920a275bba045f6d108204562c218a9a26ea15 /mk
parentAdding upstream version 2.1.7. (diff)
downloadpacemaker-upstream.tar.xz
pacemaker-upstream.zip
Adding upstream version 2.1.8~rc1.upstream/2.1.8_rc1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/tap.mk17
-rw-r--r--mk/unittest.mk15
2 files changed, 22 insertions, 10 deletions
diff --git a/mk/tap.mk b/mk/tap.mk
index fd6d4e2..e06f9a8 100644
--- a/mk/tap.mk
+++ b/mk/tap.mk
@@ -1,5 +1,5 @@
#
-# Copyright 2021-2023 the Pacemaker project contributors
+# Copyright 2021-2024 the Pacemaker project contributors
#
# The version control history for this file may have further details.
#
@@ -7,15 +7,18 @@
# or later (GPLv2+) WITHOUT ANY WARRANTY.
#
-AM_TESTS_ENVIRONMENT= \
- G_DEBUG=gc-friendly \
- MALLOC_CHECK_=2 \
- MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
+AM_TESTS_ENVIRONMENT = G_DEBUG=gc-friendly
+AM_TESTS_ENVIRONMENT += MALLOC_CHECK_=2
+AM_TESTS_ENVIRONMENT += MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
+AM_TESTS_ENVIRONMENT += PCMK_CTS_CLI_DIR=$(top_srcdir)/cts/cli
+AM_TESTS_ENVIRONMENT += PCMK_schema_directory=$(top_builddir)/xml
+
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tests/tap-driver.sh
LOG_COMPILER = $(top_srcdir)/tests/tap-test
CLEANFILES = *.log *.trs
-WRAPPED = calloc \
+WRAPPED = abort \
+ calloc \
endgrent \
fopen \
getenv \
@@ -23,10 +26,10 @@ WRAPPED = calloc \
getgrent \
getpwnam_r \
readlink \
+ realloc \
setenv \
setgrent \
strdup \
- uname \
unsetenv
if WRAPPABLE_FOPEN64
diff --git a/mk/unittest.mk b/mk/unittest.mk
index ea397f2..f563ea3 100644
--- a/mk/unittest.mk
+++ b/mk/unittest.mk
@@ -1,5 +1,5 @@
#
-# Copyright 2022 the Pacemaker project contributors
+# Copyright 2022-2024 the Pacemaker project contributors
#
# The version control history for this file may have further details.
#
@@ -12,8 +12,17 @@ AM_CPPFLAGS = -I$(top_builddir)/include \
-I$(top_srcdir)/lib/common
AM_CFLAGS = -DPCMK__UNIT_TESTING
+# Add -fno-builtin and -fno-inline to allow mocking realloc.
+AM_CFLAGS += -fno-builtin
+AM_CFLAGS += -fno-inline
AM_LDFLAGS = $(LDFLAGS_WRAP)
-LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \
- -lcmocka
+LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la
+if BUILD_COVERAGE
+LDADD += -lgcov
+endif
+LDADD += -lcmocka
+# When -fno-builtin is used, -lm also needs to be added. See the comments in
+# lib/common/Makefile.am for libcrmcommon_test_la_CFLAGS.
+LDADD += -lm