Commit 10553ed4 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1150] Fix generated/nongenerated tests

The folder contains both generated and directly written files, so we
need to handle them separately, because of when we have different
builddir than srcdir.
parent 43da3c6c
PYCOVERAGE_RUN = @PYCOVERAGE_RUN@ PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS_GEN = log_test.py PYTESTS_GEN = log_console.py
noinst_SCRIPTS = $(PYTESTS) log_console.py PYTESTS_NOGEN = log_test.py
EXTRA_DIST = console.out check_output.sh noinst_SCRIPTS = $(PYTESTS_GEN)
EXTRA_DIST = console.out check_output.sh $(PYTESTS_NOGEN)
# If necessary (rare cases), explicitly specify paths to dynamic libraries # If necessary (rare cases), explicitly specify paths to dynamic libraries
# required by loadable python modules. # required by loadable python modules.
...@@ -11,6 +12,7 @@ LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/cc/. ...@@ -11,6 +12,7 @@ LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/cc/.
endif endif
# test using command-line arguments, so use check-local target instead of TESTS # test using command-line arguments, so use check-local target instead of TESTS
# We need to run the cycle twice, because once the files are in builddir, once in srcdir
check-local: check-local:
$(LIBRARY_PATH_PLACEHOLDER) \ $(LIBRARY_PATH_PLACEHOLDER) \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/python/isc/log \ env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/python/isc/log \
...@@ -20,10 +22,17 @@ if ENABLE_PYTHON_COVERAGE ...@@ -20,10 +22,17 @@ if ENABLE_PYTHON_COVERAGE
rm -f .coverage rm -f .coverage
${LN_S} $(abs_top_srcdir)/.coverage .coverage ${LN_S} $(abs_top_srcdir)/.coverage .coverage
endif endif
for pytest in $(PYTESTS) ; do \ for pytest in $(PYTESTS_NOGEN) ; do \
echo Running test: $$pytest ; \ echo Running test: $$pytest ; \
$(LIBRARY_PATH_PLACEHOLDER) \ $(LIBRARY_PATH_PLACEHOLDER) \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/python/isc/log:$(abs_top_builddir)/src/lib/log/python/.libs \ env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/python/isc/log:$(abs_top_builddir)/src/lib/log/python/.libs \
B10_TEST_PLUGIN_DIR=$(abs_top_srcdir)/src/bin/cfgmgr/plugins \ B10_TEST_PLUGIN_DIR=$(abs_top_srcdir)/src/bin/cfgmgr/plugins \
$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done ; \
for pytest in $(PYTESTS_GEN) ; do \
echo Running test: $$pytest ; \
$(LIBRARY_PATH_PLACEHOLDER) \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/python/isc/log:$(abs_top_builddir)/src/lib/log/python/.libs \
B10_TEST_PLUGIN_DIR=$(abs_top_srcdir)/src/bin/cfgmgr/plugins \
$(PYCOVERAGE_RUN) $(abs_builddir)/$$pytest || exit ; \
done done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment