| 1 | # SPDX-License-Identifier: MIT |
| 2 | |
| 3 | include $(top_srcdir)/src/Makefile.common.inc |
| 4 | |
| 5 | AM_CPPFLAGS += -I$(top_srcdir)/tests/utils |
| 6 | |
| 7 | noinst_LTLIBRARIES = |
| 8 | |
| 9 | COMMON_TEST_LDADD = \ |
| 10 | $(top_builddir)/tests/utils/tap/libtap.la \ |
| 11 | $(top_builddir)/tests/utils/libtestcommon.la \ |
| 12 | utils/liblib-utils.la \ |
| 13 | $(top_builddir)/src/common/libcommon.la \ |
| 14 | $(top_builddir)/src/logging/liblogging.la |
| 15 | |
| 16 | test_bt_values_SOURCES = test-bt-values.c |
| 17 | test_bt_values_LDADD = $(COMMON_TEST_LDADD) \ |
| 18 | $(top_builddir)/src/lib/libbabeltrace2.la |
| 19 | |
| 20 | test_fields_bin_SOURCES = test-fields-bin.cpp |
| 21 | test_fields_bin_LDADD = $(COMMON_TEST_LDADD) \ |
| 22 | $(top_builddir)/src/lib/libbabeltrace2.la \ |
| 23 | $(top_builddir)/src/cpp-common/vendor/fmt/libfmt.la |
| 24 | |
| 25 | if ENABLE_BUILT_IN_PLUGINS |
| 26 | |
| 27 | test_fields_bin_LDFLAGS = $(call pluginarchive,utils) |
| 28 | test_fields_bin_LDADD += \ |
| 29 | $(top_builddir)/src/plugins/common/param-validation/libparam-validation.la |
| 30 | |
| 31 | endif # ENABLE_BUILT_IN_PLUGINS |
| 32 | |
| 33 | test_bt_uuid_SOURCES = test-bt-uuid.c |
| 34 | test_bt_uuid_LDADD = $(COMMON_TEST_LDADD) |
| 35 | |
| 36 | test_trace_ir_ref_SOURCES = test-trace-ir-ref.c |
| 37 | test_trace_ir_ref_LDADD = $(COMMON_TEST_LDADD) \ |
| 38 | $(top_builddir)/src/lib/libbabeltrace2.la \ |
| 39 | $(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la |
| 40 | nodist_EXTRA_test_trace_ir_ref_SOURCES = dummy.cpp |
| 41 | |
| 42 | test_graph_topo_SOURCES = test-graph-topo.c |
| 43 | test_graph_topo_LDADD = $(COMMON_TEST_LDADD) \ |
| 44 | $(top_builddir)/src/lib/libbabeltrace2.la |
| 45 | nodist_EXTRA_test_graph_topo_SOURCES = dummy.cpp |
| 46 | |
| 47 | test_simple_sink_SOURCES = test-simple-sink.c |
| 48 | test_simple_sink_LDADD = $(COMMON_TEST_LDADD) \ |
| 49 | $(top_builddir)/src/lib/libbabeltrace2.la |
| 50 | nodist_EXTRA_test_simple_sink_SOURCES = dummy.cpp |
| 51 | |
| 52 | test_remove_destruction_listener_in_destruction_listener_SOURCES = \ |
| 53 | test-remove-destruction-listener-in-destruction-listener.c |
| 54 | test_remove_destruction_listener_in_destruction_listener_LDADD = \ |
| 55 | $(COMMON_TEST_LDADD) \ |
| 56 | $(top_builddir)/src/lib/libbabeltrace2.la |
| 57 | nodist_EXTRA_test_remove_destruction_listener_in_destruction_listener_SOURCES = dummy.cpp |
| 58 | |
| 59 | noinst_PROGRAMS = \ |
| 60 | test-bt-uuid \ |
| 61 | test-bt-values \ |
| 62 | test-graph-topo \ |
| 63 | test-fields-bin \ |
| 64 | test-remove-destruction-listener-in-destruction-listener \ |
| 65 | test-simple-sink \ |
| 66 | test-trace-ir-ref |
| 67 | |
| 68 | if !ENABLE_BUILT_IN_PLUGINS |
| 69 | |
| 70 | # test-plugins |
| 71 | |
| 72 | noinst_PROGRAMS += test-plugins |
| 73 | test_plugins_SOURCES = test-plugins.c |
| 74 | test_plugins_LDADD = \ |
| 75 | $(COMMON_TEST_LDADD) \ |
| 76 | $(top_builddir)/src/lib/libbabeltrace2.la |
| 77 | |
| 78 | noinst_LTLIBRARIES += test-plugins-plugins/plugin-minimal.la |
| 79 | test_plugins_plugins_plugin_minimal_la_SOURCES = \ |
| 80 | test-plugins-plugins/minimal.c |
| 81 | test_plugins_plugins_plugin_minimal_la_LDFLAGS = \ |
| 82 | $(AM_LDFLAGS) \ |
| 83 | $(LT_NO_UNDEFINED) \ |
| 84 | -rpath / -avoid-version -module $(LD_NOTEXT) |
| 85 | test_plugins_plugins_plugin_minimal_la_LIBADD = \ |
| 86 | $(top_builddir)/src/lib/libbabeltrace2.la \ |
| 87 | $(top_builddir)/src/common/libcommon.la \ |
| 88 | $(top_builddir)/src/logging/liblogging.la |
| 89 | |
| 90 | noinst_LTLIBRARIES += test-plugins-plugins/plugin-sfs.la |
| 91 | test_plugins_plugins_plugin_sfs_la_SOURCES = test-plugins-plugins/sfs.c |
| 92 | test_plugins_plugins_plugin_sfs_la_LDFLAGS = \ |
| 93 | $(AM_LDFLAGS) \ |
| 94 | $(LT_NO_UNDEFINED) \ |
| 95 | -rpath / -avoid-version -module $(LD_NOTEXT) |
| 96 | test_plugins_plugins_plugin_sfs_la_LIBADD = \ |
| 97 | $(top_builddir)/src/lib/libbabeltrace2.la \ |
| 98 | $(top_builddir)/src/common/libcommon.la \ |
| 99 | $(top_builddir)/src/logging/liblogging.la |
| 100 | |
| 101 | # test-plugin-init-fail |
| 102 | |
| 103 | noinst_PROGRAMS += test-plugin-init-fail |
| 104 | test_plugin_init_fail_SOURCES = test-plugin-init-fail.cpp |
| 105 | test_plugin_init_fail_LDADD = \ |
| 106 | $(COMMON_TEST_LDADD) \ |
| 107 | $(top_builddir)/src/cpp-common/vendor/fmt/libfmt.la \ |
| 108 | $(top_builddir)/src/lib/libbabeltrace2.la |
| 109 | |
| 110 | noinst_LTLIBRARIES += test-plugin-init-fail-plugin/plugin-init-fail.la |
| 111 | |
| 112 | test_plugin_init_fail_plugin_plugin_init_fail_la_SOURCES = \ |
| 113 | test-plugin-init-fail-plugin/plugin-init-fail.cpp |
| 114 | test_plugin_init_fail_plugin_plugin_init_fail_la_LDFLAGS = \ |
| 115 | $(AM_LDFLAGS) \ |
| 116 | $(LT_NO_UNDEFINED) \ |
| 117 | -rpath / -avoid-version -module $(LD_NOTEXT) |
| 118 | test_plugin_init_fail_plugin_plugin_init_fail_la_LIBADD = \ |
| 119 | $(top_builddir)/src/lib/libbabeltrace2.la |
| 120 | |
| 121 | endif |
| 122 | |
| 123 | dist_check_SCRIPTS = test-plugins.sh test-fields.sh |
| 124 | |
| 125 | # utils |
| 126 | |
| 127 | noinst_LTLIBRARIES += utils/liblib-utils.la |
| 128 | utils_liblib_utils_la_SOURCES = \ |
| 129 | utils/run-in.cpp \ |
| 130 | utils/run-in.hpp |
| 131 | |
| 132 | if HAVE_PYTHON |
| 133 | if DEV_MODE |
| 134 | |
| 135 | # conds |
| 136 | |
| 137 | noinst_PROGRAMS += conds/conds-triggers |
| 138 | |
| 139 | conds_conds_triggers_SOURCES = \ |
| 140 | conds/conds-triggers.cpp \ |
| 141 | conds/utils.cpp \ |
| 142 | conds/utils.hpp \ |
| 143 | conds/clk-cls-compat-postconds-triggers.cpp \ |
| 144 | conds/clk-cls-compat-postconds-triggers.hpp |
| 145 | |
| 146 | conds_conds_triggers_LDADD = \ |
| 147 | $(COMMON_TEST_LDADD) \ |
| 148 | $(top_builddir)/src/lib/libbabeltrace2.la \ |
| 149 | $(top_builddir)/src/cpp-common/vendor/fmt/libfmt.la |
| 150 | |
| 151 | if ENABLE_BUILT_IN_PLUGINS |
| 152 | |
| 153 | conds_conds_triggers_LDFLAGS = $(call pluginarchive,utils) |
| 154 | conds_conds_triggers_LDADD += \ |
| 155 | $(top_builddir)/src/plugins/common/param-validation/libparam-validation.la |
| 156 | |
| 157 | endif # ENABLE_BUILT_IN_PLUGINS |
| 158 | |
| 159 | dist_check_SCRIPTS += conds/test-conds.sh conds/test.py |
| 160 | |
| 161 | endif |
| 162 | endif |