diff --git a/lib/pengine/Makefile.am b/lib/pengine/Makefile.am index 2badbaec99..7ffb5cdda1 100644 --- a/lib/pengine/Makefile.am +++ b/lib/pengine/Makefile.am @@ -1,55 +1,70 @@ # # Copyright 2004-2022 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # include $(top_srcdir)/mk/common.mk -SUBDIRS = tests +# Without "." here, check-recursive will run through the subdirectories first +# and then run "make check" here. This will fail, because there's things in +# the subdirectories that need check_LTLIBRARIES built first. Adding "." here +# changes the order so the subdirectories are processed afterwards. +SUBDIRS = . tests ## libraries lib_LTLIBRARIES = libpe_rules.la libpe_status.la +check_LTLIBRARIES = libpe_rules_test.la libpe_status_test.la ## SOURCES noinst_HEADERS = variant.h pe_status_private.h libpe_rules_la_LDFLAGS = -version-info 29:2:3 libpe_rules_la_CFLAGS = $(CFLAGS_HARDENED_LIB) libpe_rules_la_LDFLAGS += $(LDFLAGS_HARDENED_LIB) libpe_rules_la_LIBADD = $(top_builddir)/lib/common/libcrmcommon.la libpe_rules_la_SOURCES = rules.c rules_alerts.c common.c libpe_status_la_LDFLAGS = -version-info 33:0:5 libpe_status_la_CFLAGS = $(CFLAGS_HARDENED_LIB) libpe_status_la_LDFLAGS += $(LDFLAGS_HARDENED_LIB) libpe_status_la_LIBADD = $(top_builddir)/lib/common/libcrmcommon.la # Use += rather than backlashed continuation lines for parsing by bumplibs libpe_status_la_SOURCES = libpe_status_la_SOURCES += bundle.c libpe_status_la_SOURCES += clone.c libpe_status_la_SOURCES += common.c libpe_status_la_SOURCES += complex.c libpe_status_la_SOURCES += failcounts.c libpe_status_la_SOURCES += group.c libpe_status_la_SOURCES += native.c libpe_status_la_SOURCES += pe_actions.c libpe_status_la_SOURCES += pe_health.c libpe_status_la_SOURCES += pe_digest.c libpe_status_la_SOURCES += pe_notif.c libpe_status_la_SOURCES += pe_output.c libpe_status_la_SOURCES += remote.c libpe_status_la_SOURCES += rules.c libpe_status_la_SOURCES += status.c libpe_status_la_SOURCES += tags.c libpe_status_la_SOURCES += unpack.c libpe_status_la_SOURCES += utils.c +libpe_rules_test_la_SOURCES = $(libpe_rules_la_SOURCES) +libpe_rules_test_la_LDFLAGS = $(LDFLAGS_HARDENED_LIB) +libpe_rules_test_la_CFLAGS = $(libpe_rules_la_CFLAGS) +libpe_rules_test_la_LIBADD = $(top_builddir)/lib/common/libcrmcommon_test.la -lcmocka + +libpe_status_test_la_SOURCES = $(libpe_status_la_SOURCES) +libpe_status_test_la_LDFLAGS = $(LDFLAGS_HARDENED_LIB) +libpe_status_test_la_CFLAGS = $(libpe_status_la_CFLAGS) +libpe_status_test_la_LIBADD = $(top_builddir)/lib/common/libcrmcommon_test.la -lcmocka + clean-generic: rm -f *.log *.debug *~ diff --git a/lib/pengine/tests/native/Makefile.am b/lib/pengine/tests/native/Makefile.am index d3c23fc920..3fb8b40f58 100644 --- a/lib/pengine/tests/native/Makefile.am +++ b/lib/pengine/tests/native/Makefile.am @@ -1,23 +1,23 @@ # # Copyright 2022 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include \ -I$(top_builddir) -I$(top_srcdir) -LDADD = $(top_builddir)/lib/common/libcrmcommon.la \ - $(top_builddir)/lib/pengine/libpe_status.la \ +LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ + $(top_builddir)/lib/pengine/libpe_status_test.la \ -lcmocka include $(top_srcdir)/mk/tap.mk AM_TESTS_ENVIRONMENT += PCMK_CTS_CLI_DIR=$(top_srcdir)/cts/cli # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = native_find_rsc_test \ pe_base_name_eq_test TESTS = $(check_PROGRAMS) diff --git a/lib/pengine/tests/rules/Makefile.am b/lib/pengine/tests/rules/Makefile.am index fdf2b3ae09..26ce1e4b2a 100644 --- a/lib/pengine/tests/rules/Makefile.am +++ b/lib/pengine/tests/rules/Makefile.am @@ -1,19 +1,19 @@ # # Copyright 2020-2021 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -LDADD = $(top_builddir)/lib/common/libcrmcommon.la \ - $(top_builddir)/lib/pengine/libpe_rules.la \ +LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ + $(top_builddir)/lib/pengine/libpe_rules_test.la \ -lcmocka include $(top_srcdir)/mk/tap.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pe_cron_range_satisfied_test TESTS = $(check_PROGRAMS) diff --git a/lib/pengine/tests/unpack/Makefile.am b/lib/pengine/tests/unpack/Makefile.am index 877aa34eec..af3be904c1 100644 --- a/lib/pengine/tests/unpack/Makefile.am +++ b/lib/pengine/tests/unpack/Makefile.am @@ -1,19 +1,19 @@ # # Copyright 2022 the Pacemaker project contributors # # The version control history for this file may have further details. # # This source code is licensed under the GNU General Public License version 2 # or later (GPLv2+) WITHOUT ANY WARRANTY. # AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -LDADD = $(top_builddir)/lib/common/libcrmcommon.la \ - $(top_builddir)/lib/pengine/libpe_status.la \ +LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ + $(top_builddir)/lib/pengine/libpe_status_test.la \ -lcmocka include $(top_srcdir)/mk/tap.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pe_base_name_end_test TESTS = $(check_PROGRAMS)