From c4d4eb96d21de7bee831fd339a75a77280f48034 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 26 Jan 2024 18:38:55 +0000 Subject: [PATCH] tests: Test the locally built binaries Signed-off-by: Michael Tremer --- Makefile.am | 8 ++++++++ src/pakfire/__init__.py | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index d064a6d20..9e4f33a46 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1135,6 +1135,14 @@ TESTS_ENVIRONMENT = \ PAKFIRE_LOG=debug \ topdir="$(shell pwd)" +# Test the library we just built +TESTS_ENVIRONMENT += \ + LD_LIBRARY_PATH=$(top_srcdir)/.libs:$(LD_LIBRARY_PATH) + +# Test the Python modules we just built +TESTS_ENVIRONMENT += \ + PYTHONPATH=$(top_srcdir)/src:$(top_srcdir)/.libs:$(PYTHONPATH) + dist_check_SCRIPTS = \ tests/python/archive.py \ tests/python/ctx.py \ diff --git a/src/pakfire/__init__.py b/src/pakfire/__init__.py index d30bcd679..92264a729 100644 --- a/src/pakfire/__init__.py +++ b/src/pakfire/__init__.py @@ -23,4 +23,7 @@ from .__version__ import PAKFIRE_VERSION as __version__ # Import everything from the C module -from ._pakfire import * +try: + from ._pakfire import * +except ImportError: + from _pakfire import * -- 2.47.2