d218f27188
We now have bidirectional calling between Rust and C++, but we are generating two static libraries that we then link together with a tiny C++ `main.cxx`. Let's make another huge leap towards oxdiation by having Rust be the entrypoint. This way cargo natively takes care of linking the internal Rust library, and our C++ internals become the library. In other words, we've now fully inverted from "C app with internal Rust library" to "Rust binary with internal C++ library". In order to make this work though we have to finally kill the C unit tests. But mostly everything covered there is either being converted to Rust, or covered elsewhere anyways. Now as the doc comments in `main.rs` say...this is a bit awkward because all the CLI code is still in C++. Porting stuff to use e.g. `structopt` natively would be a bit of a slog. For now, we basically rely on the fact that the Rust-native CLIs are all hidden commands. Update submodule: libdnf
70 lines
2.1 KiB
Plaintext
70 lines
2.1 KiB
Plaintext
BASE_TESTS_ENVIRONMENT = \
|
|
builddir=$(abs_builddir) \
|
|
topsrcdir=$(abs_top_srcdir) \
|
|
commondir=$(abs_top_srcdir)/tests/common
|
|
|
|
|
|
AM_TESTS_ENVIRONMENT = \
|
|
UNINSTALLEDTESTS=1 \
|
|
$(BASE_TESTS_ENVIRONMENT)
|
|
|
|
# we consume libdnf as a submodule, but we may not have installed it yet (and we
|
|
# don't want it to fall back to the system libhif if it's also installed)
|
|
AM_TESTS_ENVIRONMENT += \
|
|
LD_LIBRARY_PATH=$(abs_builddir)/libdnf-build/libdnf:$$(cd $(top_builddir)/.libs && pwd)$${LD_LIBRARY_PATH:+:$${LD_LIBRARY_PATH}} \
|
|
GI_TYPELIB_PATH=$$(cd $(top_builddir) && pwd)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH} \
|
|
$(NULL)
|
|
if BUILDOPT_ASAN
|
|
AM_TESTS_ENVIRONMENT += BUILDOPT_ASAN=yes ASAN_OPTIONS=detect_leaks=false
|
|
endif
|
|
|
|
GITIGNOREFILES += ssh-config ansible-inventory.yml vmcheck-logs/ test-compose-logs/ tests/vmcheck/image.qcow2
|
|
|
|
uninstalled_test_scripts = \
|
|
tests/check/test-lib-introspection.sh \
|
|
$(NULL)
|
|
|
|
uninstalled_test_extra_programs = \
|
|
dbus-run-session \
|
|
$(NULL)
|
|
|
|
dbus_run_session_SOURCES = tests/utils/dbus-run-session.c
|
|
|
|
check-local:
|
|
@echo " *** NOTE ***"
|
|
@echo " *** NOTE ***"
|
|
@echo " \"make check\" only runs a subset of rpm-ostree's tests."
|
|
@echo " Use \"make vmcheck\" to run remaining tests in a VM."
|
|
@echo " *** NOTE ***"
|
|
@echo " *** NOTE ***"
|
|
|
|
.PHONY: vmsync vmoverlay vmcheck testenv
|
|
|
|
vmsync:
|
|
@set -e; if [ -z "$(SKIP_INSTALL)" ]; then \
|
|
env $(BASE_TESTS_ENVIRONMENT) ./tests/vmcheck/install.sh; \
|
|
fi; \
|
|
env $(BASE_TESTS_ENVIRONMENT) ./tests/vmcheck/sync.sh
|
|
|
|
vmoverlay:
|
|
@set -e; \
|
|
if [ -z "$(SKIP_INSTALL)" ] && [ -z "$(SKIP_VMOVERLAY)" ]; then \
|
|
env $(BASE_TESTS_ENVIRONMENT) ./tests/vmcheck/install.sh; \
|
|
fi; \
|
|
env $(BASE_TESTS_ENVIRONMENT) ./tests/vmcheck/overlay.sh;
|
|
|
|
# One can run the vmcheck.sh script directly. The make target is useful for local
|
|
# development so that e.g. we automatically overlay.
|
|
vmcheck: vmoverlay
|
|
@tests/vmcheck.sh
|
|
|
|
testenv:
|
|
@echo "===== ENTERING TESTENV ====="
|
|
test_tmpdir=$$(mktemp -d test.XXXXXX) && \
|
|
cd $$test_tmpdir && \
|
|
env $(BASE_TESTS_ENVIRONMENT) PATH=$(abs_builddir):$$PATH TESTENV=1 \
|
|
sh ../tests/utils/setup-session.sh bash && \
|
|
cd .. && \
|
|
rm -rf $$test_tmpdir
|
|
@echo "===== LEAVING TESTENV ====="
|