TESTS_ENVIRONMENT = \
	G_SLICE=always-malloc \
	LD_LIBRARY_PATH=$(top_builddir)/.libs:$(LD_LIBRARY_PATH) \
	GI_TYPELIB_PATH=$(top_builddir) \
	PYTHONPATH=$(top_srcdir)/test/python \
	MALLOC_CHECK_=2 \
	MALLOC_PERTURB_=$$((RANDOM % 255)) \
	TEST_DATA_DIR=$(srcdir)/test/data

tests: check

TESTS = test/gexiv2-regression

check_PROGRAMS = test/gexiv2-regression

test_gexiv2_regression_SOURCES = test/gexiv2-regression.c

if PYTHON2_PATH
TESTS += test/python2-test
endif

if PYTHON3_PATH
TESTS += test/python3-test
endif

if HAVE_VALAC
check_PROGRAMS += test/gexiv2-dump
test_gexiv2_dump_SOURCES = test/gexiv2-dump.vala
endif

AM_VALAFLAGS = --pkg gexiv2 --pkg glib-2.0 \
	--vapidir=$(abs_top_srcdir) --vapidir=$(abs_top_builddir)

LDADD = \
	$(top_builddir)/libgexiv2.la \
	$(GLIB_LIBS) $(EXIV2_LIBS)
AM_CFLAGS = \
	$(GLIB_CFLAGS) $(EXIV2_CFLAGS) \
	-I $(top_srcdir) -DSAMPLE_PATH="\"$(abs_top_srcdir)/test/data\""

EXTRA_DIST += \
	test/data/sample-author-badencoding.jpg \
	test/data/CaorVN.jpeg \
	test/data/original.jpg

