|
32 | 32 | noinst_LTLIBRARIES = libcrun.la
|
33 | 33 | endif
|
34 | 34 |
|
| 35 | +if BUILD_TESTS |
35 | 36 | check_LTLIBRARIES = libcrun_testing.la
|
| 37 | +endif |
36 | 38 |
|
37 | 39 | libcrun_SOURCES = src/libcrun/utils.c \
|
38 | 40 | src/libcrun/string_map.c \
|
@@ -87,9 +89,11 @@ libcrun_la_LIBADD = libocispec/libocispec.la $(FOUND_LIBS) $(maybe_libyajl.la)
|
87 | 89 | libcrun_la_LDFLAGS = -Wl,--version-script=$(abs_top_srcdir)/libcrun.lds
|
88 | 90 |
|
89 | 91 | # build a version with all the symbols visible for testing
|
| 92 | +if BUILD_TESTS |
90 | 93 | libcrun_testing_la_SOURCES = $(libcrun_SOURCES)
|
91 | 94 | libcrun_testing_la_CFLAGS = -I $(abs_top_builddir)/libocispec/src -I $(abs_top_srcdir)/libocispec/src -fvisibility=default
|
92 | 95 | libcrun_testing_la_LIBADD = libocispec/libocispec.la $(maybe_libyajl.la)
|
| 96 | +endif |
93 | 97 |
|
94 | 98 | if PYTHON_BINDINGS
|
95 | 99 | pyexec_LTLIBRARIES = python_crun.la
|
@@ -163,7 +167,9 @@ EXTRA_DIST = COPYING COPYING.libcrun README.md NEWS SECURITY.md rpm/crun.spec au
|
163 | 167 | krun.1.md krun.1 \
|
164 | 168 | lua/luacrun.rockspec
|
165 | 169 |
|
| 170 | +if BUILD_TESTS |
166 | 171 | UNIT_TESTS = tests/tests_libcrun_utils tests/tests_libcrun_ring_buffer tests/tests_libcrun_errors tests/tests_libcrun_intelrdt
|
| 172 | +endif |
167 | 173 |
|
168 | 174 | if ENABLE_CRUN
|
169 | 175 | bin_PROGRAMS = crun
|
|
172 | 178 | noinst_PROGRAMS = crun
|
173 | 179 | endif
|
174 | 180 |
|
| 181 | +if BUILD_TESTS |
175 | 182 | check_PROGRAMS = tests/init $(UNIT_TESTS) tests/tests_libcrun_fuzzer
|
176 | 183 |
|
177 | 184 | TESTS_LDADD = libcrun_testing.la $(FOUND_LIBS) $(maybe_libyajl.la)
|
@@ -205,6 +212,7 @@ tests_tests_libcrun_errors_SOURCES = tests/tests_libcrun_errors.c
|
205 | 212 | tests_tests_libcrun_errors_LDADD = $(TESTS_LDADD)
|
206 | 213 | tests_tests_libcrun_errors_LDFLAGS = $(crun_LDFLAGS)
|
207 | 214 |
|
| 215 | +endif |
208 | 216 | TEST_EXTENSIONS = .py
|
209 | 217 | PY_LOG_COMPILER = $(PYTHON)
|
210 | 218 | PY_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/build-aux/tap-driver.sh
|
@@ -236,7 +244,9 @@ PYTHON_TESTS = tests/test_capabilities.py \
|
236 | 244 | tests/test_time.py \
|
237 | 245 | tests/test_bpf_devices.py
|
238 | 246 |
|
| 247 | +if BUILD_TESTS |
239 | 248 | TESTS = $(PYTHON_TESTS) $(UNIT_TESTS)
|
| 249 | +endif |
240 | 250 |
|
241 | 251 | .version:
|
242 | 252 | $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
|
|
0 commit comments