Makefile.am 2.39 KB
Newer Older
1
PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
2 3
PYTESTS =  datasrc_test.py sqlite3_ds_test.py
PYTESTS += clientlist_test.py zone_loader_test.py
4 5
EXTRA_DIST = $(PYTESTS)

JINMEI Tatuya's avatar
JINMEI Tatuya committed
6 7
EXTRA_DIST += testdata/brokendb.sqlite3
EXTRA_DIST += testdata/example.com.sqlite3
8
EXTRA_DIST += testdata/example.com.source.sqlite3
JINMEI Tatuya's avatar
JINMEI Tatuya committed
9 10 11
EXTRA_DIST += testdata/newschema.sqlite3
EXTRA_DIST += testdata/oldschema.sqlite3
EXTRA_DIST += testdata/new_minor_schema.sqlite3
12 13
EXTRA_DIST += testdata/example.com
EXTRA_DIST += testdata/example.com.ch
14
EXTRA_DIST += testdata/static.zone
15
CLEANFILES = $(abs_builddir)/rwtest.sqlite3.copied
16
CLEANFILES += $(abs_builddir)/zoneloadertest.sqlite3
JINMEI Tatuya's avatar
JINMEI Tatuya committed
17

18 19
# If necessary (rare cases), explicitly specify paths to dynamic libraries
# required by loadable python modules.
20 21 22
# We always add one, the location of the data source modules
# We may want to add an API method for this to the ds factory, but that is out
# of scope for this ticket
23
LIBRARY_PATH_PLACEHOLDER = $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/datasrc/.libs:
24
if SET_ENV_LIBRARY_PATH
25
LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/cryptolink/.libs:$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/lib/cc/.libs:$(abs_top_builddir)/src/lib/config/.libs:$(abs_top_builddir)/src/lib/log/.libs:$(abs_top_builddir)/src/lib/util/.libs:$(abs_top_builddir)/src/lib/util/threads/.libs:$(abs_top_builddir)/src/lib/exceptions/.libs:$(abs_top_builddir)/src/lib/datasrc/.libs:$$$(ENV_LIBRARY_PATH)
26 27
else
LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/datasrc/.libs:$$$(ENV_LIBRARY_PATH)
28 29
endif

30
# test using command-line arguments, so use check-local target instead of TESTS
31
# We need to define B10_FROM_BUILD for datasrc loadable modules
32
check-local:
33
if ENABLE_PYTHON_COVERAGE
JINMEI Tatuya's avatar
JINMEI Tatuya committed
34
	touch $(abs_top_srcdir)/.coverage
35 36 37
	rm -f .coverage
	${LN_S} $(abs_top_srcdir)/.coverage .coverage
endif
38 39
	for pytest in $(PYTESTS) ; do \
	echo Running test: $$pytest ; \
40
	$(LIBRARY_PATH_PLACEHOLDER) \
41
	PYTHONPATH=:$(COMMON_PYTHON_PATH):$(abs_top_builddir)/src/lib/python/isc/log:$(abs_top_builddir)/src/lib/python/isc/datasrc/.libs:$(abs_top_builddir)/src/lib/dns/python/.libs \
JINMEI Tatuya's avatar
JINMEI Tatuya committed
42
	TESTDATA_PATH=$(abs_srcdir)/testdata \
43
	TESTDATA_WRITE_PATH=$(abs_builddir) \
44
	GLOBAL_TESTDATA_PATH=$(abs_top_srcdir)/src/lib/testutils/testdata \
45
	B10_FROM_BUILD=$(abs_top_builddir) \
46
	$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
47
	done