diff --git a/lib/common/tests/acl/Makefile.am b/lib/common/tests/acl/Makefile.am index 96460e8d8e..50408f9671 100644 --- a/lib/common/tests/acl/Makefile.am +++ b/lib/common/tests/acl/Makefile.am @@ -1,28 +1,21 @@ # # Copyright 2021-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = \ pcmk__is_user_in_group_test \ pcmk_acl_required_test \ xml_acl_denied_test \ xml_acl_enabled_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/agents/Makefile.am b/lib/common/tests/agents/Makefile.am index 7e7368fecf..7a54b7deff 100644 --- a/lib/common/tests/agents/Makefile.am +++ b/lib/common/tests/agents/Makefile.am @@ -1,27 +1,20 @@ # # Copyright 2020-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = crm_generate_ra_key_test \ crm_parse_agent_spec_test \ pcmk__effective_rc_test \ pcmk_get_ra_caps_test \ pcmk_stonith_param_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/cmdline/Makefile.am b/lib/common/tests/cmdline/Makefile.am index 907ae7474b..d781ed5e96 100644 --- a/lib/common/tests/cmdline/Makefile.am +++ b/lib/common/tests/cmdline/Makefile.am @@ -1,24 +1,17 @@ # # Copyright 2020-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pcmk__cmdline_preproc_test \ pcmk__quote_cmdline_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/flags/Makefile.am b/lib/common/tests/flags/Makefile.am index d50b9f7b12..16d8ffb336 100644 --- a/lib/common/tests/flags/Makefile.am +++ b/lib/common/tests/flags/Makefile.am @@ -1,27 +1,20 @@ # # Copyright 2020-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = \ pcmk__clear_flags_as_test \ pcmk__set_flags_as_test \ pcmk_all_flags_set_test \ pcmk_any_flags_set_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/health/Makefile.am b/lib/common/tests/health/Makefile.am index ebb51cb09c..ad2a2dad1f 100644 --- a/lib/common/tests/health/Makefile.am +++ b/lib/common/tests/health/Makefile.am @@ -1,24 +1,17 @@ # # 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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pcmk__parse_health_strategy_test \ pcmk__validate_health_strategy_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/io/Makefile.am b/lib/common/tests/io/Makefile.am index cb56c8683a..c26482c488 100644 --- a/lib/common/tests/io/Makefile.am +++ b/lib/common/tests/io/Makefile.am @@ -1,25 +1,18 @@ # # Copyright 2020-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = \ pcmk__full_path_test \ pcmk__get_tmpdir_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/iso8601/Makefile.am b/lib/common/tests/iso8601/Makefile.am index ceb3085ade..5187aecb64 100644 --- a/lib/common/tests/iso8601/Makefile.am +++ b/lib/common/tests/iso8601/Makefile.am @@ -1,23 +1,16 @@ # # Copyright 2020-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pcmk__readable_interval_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/lists/Makefile.am b/lib/common/tests/lists/Makefile.am index 7281944344..ae0c0b69f5 100644 --- a/lib/common/tests/lists/Makefile.am +++ b/lib/common/tests/lists/Makefile.am @@ -1,27 +1,20 @@ # # 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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = \ pcmk__list_of_1_test \ pcmk__list_of_multiple_test \ pcmk__subtract_lists_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/nvpair/Makefile.am b/lib/common/tests/nvpair/Makefile.am index 8b8866994d..7acaba3f27 100644 --- a/lib/common/tests/nvpair/Makefile.am +++ b/lib/common/tests/nvpair/Makefile.am @@ -1,25 +1,18 @@ # # Copyright 2021-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pcmk__xe_attr_is_true_test \ pcmk__xe_get_bool_attr_test \ pcmk__xe_set_bool_attr_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/operations/Makefile.am b/lib/common/tests/operations/Makefile.am index aad5346a93..4687e1ba93 100644 --- a/lib/common/tests/operations/Makefile.am +++ b/lib/common/tests/operations/Makefile.am @@ -1,29 +1,22 @@ # # Copyright 2020-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = copy_in_properties_test \ expand_plus_plus_test \ fix_plus_plus_recursive_test \ parse_op_key_test \ pcmk_is_probe_test \ pcmk_xe_is_probe_test \ pcmk_xe_mask_probe_failure_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/options/Makefile.am b/lib/common/tests/options/Makefile.am index a915661c33..9a5fa985de 100644 --- a/lib/common/tests/options/Makefile.am +++ b/lib/common/tests/options/Makefile.am @@ -1,26 +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 \ - -I$(top_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = \ pcmk__env_option_test \ pcmk__set_env_option_test \ pcmk__env_option_enabled_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/output/Makefile.am b/lib/common/tests/output/Makefile.am index 888ba19d2d..6ac7b5fd06 100644 --- a/lib/common/tests/output/Makefile.am +++ b/lib/common/tests/output/Makefile.am @@ -1,31 +1,24 @@ # # Copyright 2021-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pcmk__call_message_test \ pcmk__output_and_clear_error_test \ pcmk__output_free_test \ pcmk__output_new_test \ pcmk__register_format_test \ pcmk__register_formats_test \ pcmk__register_message_test \ pcmk__register_messages_test \ pcmk__unregister_formats_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/procfs/Makefile.am b/lib/common/tests/procfs/Makefile.am index 5affdd353c..75511f5c13 100644 --- a/lib/common/tests/procfs/Makefile.am +++ b/lib/common/tests/procfs/Makefile.am @@ -1,25 +1,18 @@ # # 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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pcmk__procfs_has_pids_false_test \ pcmk__procfs_has_pids_true_test \ pcmk__procfs_pid2path_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/results/Makefile.am b/lib/common/tests/results/Makefile.am index 9476e80a9d..8d51d12915 100644 --- a/lib/common/tests/results/Makefile.am +++ b/lib/common/tests/results/Makefile.am @@ -1,23 +1,16 @@ # # Copyright 2021-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pcmk__results_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/scores/Makefile.am b/lib/common/tests/scores/Makefile.am index edcbc1e863..66ca0731a3 100644 --- a/lib/common/tests/scores/Makefile.am +++ b/lib/common/tests/scores/Makefile.am @@ -1,26 +1,19 @@ # # Copyright 2020-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = \ char2score_test \ pcmk__add_scores_test \ pcmk_readable_score_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/strings/Makefile.am b/lib/common/tests/strings/Makefile.am index 3f1e4d40e0..06c9e392c1 100644 --- a/lib/common/tests/strings/Makefile.am +++ b/lib/common/tests/strings/Makefile.am @@ -1,47 +1,40 @@ # # Copyright 2020-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = \ crm_get_msec_test \ crm_is_true_test \ crm_str_to_boolean_test \ pcmk__add_word_test \ pcmk__btoa_test \ pcmk__char_in_any_str_test \ pcmk__compress_test \ pcmk__ends_with_test \ pcmk__guint_from_hash_test \ pcmk__numeric_strcasecmp_test \ pcmk__parse_ll_range_test \ pcmk__s_test \ pcmk__scan_double_test \ pcmk__scan_min_int_test \ pcmk__scan_port_test \ pcmk__starts_with_test \ pcmk__str_any_of_test \ pcmk__str_in_list_test \ pcmk__str_table_dup_test \ pcmk__str_update_test \ pcmk__strcmp_test \ pcmk__strkey_table_test \ pcmk__strikey_table_test \ pcmk__trim_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/utils/Makefile.am b/lib/common/tests/utils/Makefile.am index 610254ef65..edccf0941a 100644 --- a/lib/common/tests/utils/Makefile.am +++ b/lib/common/tests/utils/Makefile.am @@ -1,35 +1,28 @@ # # Copyright 2020-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = \ compare_version_test \ crm_meta_name_test \ crm_meta_value_test \ crm_user_lookup_test \ pcmk_daemon_user_test \ pcmk_str_is_infinity_test \ pcmk_str_is_minus_infinity_test \ pcmk__getpid_s_test if WRAPPABLE_UNAME check_PROGRAMS += pcmk_hostname_test endif TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/xpath/Makefile.am b/lib/common/tests/xpath/Makefile.am index cddd5237b7..94abeee2dc 100644 --- a/lib/common/tests/xpath/Makefile.am +++ b/lib/common/tests/xpath/Makefile.am @@ -1,23 +1,16 @@ # # Copyright 2021-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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) - include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pcmk__xpath_node_id_test TESTS = $(check_PROGRAMS) diff --git a/lib/pengine/tests/native/Makefile.am b/lib/pengine/tests/native/Makefile.am index 29a31ddd9b..5046ff1a94 100644 --- a/lib/pengine/tests/native/Makefile.am +++ b/lib/pengine/tests/native/Makefile.am @@ -1,24 +1,22 @@ # # 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_test.la \ - $(top_builddir)/lib/pengine/libpe_status_test.la \ - -lcmocka -AM_LDFLAGS = $(LDFLAGS_WRAP) include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk + +AM_CPPFLAGS += -I$(top_srcdir) +LDADD += $(top_builddir)/lib/pengine/libpe_status_test.la 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 e4c33d921f..261ec16e67 100644 --- a/lib/pengine/tests/rules/Makefile.am +++ b/lib/pengine/tests/rules/Makefile.am @@ -1,20 +1,18 @@ # # 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_test.la \ - $(top_builddir)/lib/pengine/libpe_rules_test.la \ - -lcmocka -AM_LDFLAGS = $(LDFLAGS_WRAP) include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk + +LDADD += $(top_builddir)/lib/pengine/libpe_rules_test.la # 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/status/Makefile.am b/lib/pengine/tests/status/Makefile.am index 345c280c3c..3f95496181 100644 --- a/lib/pengine/tests/status/Makefile.am +++ b/lib/pengine/tests/status/Makefile.am @@ -1,25 +1,22 @@ # # 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_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - $(top_builddir)/lib/pengine/libpe_status_test.la -AM_LDFLAGS = $(LDFLAGS_WRAP) include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk + +LDADD += $(top_builddir)/lib/pengine/libpe_status_test.la # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pe_find_node_any_test \ pe_find_node_id_test \ pe_find_node_test \ pe_new_working_set_test \ set_working_set_defaults_test TESTS = $(check_PROGRAMS) diff --git a/lib/pengine/tests/unpack/Makefile.am b/lib/pengine/tests/unpack/Makefile.am index 8699d7565e..baa8633984 100644 --- a/lib/pengine/tests/unpack/Makefile.am +++ b/lib/pengine/tests/unpack/Makefile.am @@ -1,20 +1,18 @@ # # 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_test.la \ - $(top_builddir)/lib/pengine/libpe_status_test.la \ - -lcmocka -AM_LDFLAGS = $(LDFLAGS_WRAP) include $(top_srcdir)/mk/tap.mk +include $(top_srcdir)/mk/unittest.mk + +LDADD += $(top_builddir)/lib/pengine/libpe_status_test.la # Add "_test" to the end of all test program names to simplify .gitignore. check_PROGRAMS = pe_base_name_end_test TESTS = $(check_PROGRAMS) diff --git a/lib/common/tests/health/Makefile.am b/mk/unittest.mk similarity index 58% copy from lib/common/tests/health/Makefile.am copy to mk/unittest.mk index ebb51cb09c..ea397f21b5 100644 --- a/lib/common/tests/health/Makefile.am +++ b/mk/unittest.mk @@ -1,24 +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 \ +AM_CPPFLAGS = -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ -I$(top_srcdir)/lib/common -LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ - -lcmocka -AM_CFLAGS = -DPCMK__UNIT_TESTING -AM_LDFLAGS = $(LDFLAGS_WRAP) -include $(top_srcdir)/mk/tap.mk +AM_CFLAGS = -DPCMK__UNIT_TESTING -# Add "_test" to the end of all test program names to simplify .gitignore. -check_PROGRAMS = pcmk__parse_health_strategy_test \ - pcmk__validate_health_strategy_test +AM_LDFLAGS = $(LDFLAGS_WRAP) -TESTS = $(check_PROGRAMS) +LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ + -lcmocka