
QL_TEST_SRCS = \
	americanoption.cpp \
	amortizingbond.cpp \
	andreasenhugevolatilityinterpl.cpp \
	array.cpp \
	asianoptions.cpp \
	assetswap.cpp \
	autocovariances.cpp \
	barrieroption.cpp \
	binaryoption.cpp \
	basismodels.cpp \
	basisswapratehelpers.cpp \
	basketoption.cpp \
	batesmodel.cpp \
	bermudanswaption.cpp \
	blackdeltacalculator.cpp \
	blackformula.cpp \
	bondforward.cpp \
	bonds.cpp \
	brownianbridge.cpp \
	businessdayconventions.cpp \
	calendars.cpp \
	callablebonds.cpp \
	capfloor.cpp \
	capflooredcoupon.cpp \
	cashflows.cpp \
	catbonds.cpp \
	cdo.cpp \
	cdsoption.cpp \
	chooseroption.cpp \
	cliquetoption.cpp \
	cms.cpp \
	cms_normal.cpp \
	cmsspread.cpp \
	commodityunitofmeasure.cpp \
	compiledboostversion.cpp \
	compoundoption.cpp \
	convertiblebonds.cpp \
	covariance.cpp \
	creditdefaultswap.cpp \
	creditriskplus.cpp \
	crosscurrencyratehelpers.cpp \
	currency.cpp \
	curvestates.cpp \
	dates.cpp \
	daycounters.cpp \
	defaultprobabilitycurves.cpp \
	digitalcoupon.cpp \
	digitaloption.cpp \
	distributions.cpp \
	dividendoption.cpp \
	doublebarrieroption.cpp \
	doublebinaryoption.cpp \
	equityindex.cpp \
	equitycashflow.cpp \
	equitytotalreturnswap.cpp \
	europeanoption.cpp \
	everestoption.cpp \
	exchangerate.cpp \
	extendedtrees.cpp \
	extensibleoptions.cpp \
	fastfouriertransform.cpp \
	fdheston.cpp \
	fdcir.cpp \
	fdmlinearop.cpp \
	fdcev.cpp \
	fdsabr.cpp \
	fittedbonddiscountcurve.cpp \
	forwardoption.cpp \
	forwardrateagreement.cpp \
	functions.cpp \
	garch.cpp \
	gaussianquadratures.cpp \
	gjrgarchmodel.cpp \
	gsr.cpp \
	hestonmodel.cpp \
	hestonslvmodel.cpp \
	himalayaoption.cpp \
	hybridhestonhullwhiteprocess.cpp \
	indexes.cpp \
	inflation.cpp \
	inflationcapfloor.cpp \
	inflationcapflooredcoupon.cpp \
	inflationcpibond.cpp \
	inflationcpicapfloor.cpp \
	inflationcpiswap.cpp \
	inflationvolatility.cpp \
	instruments.cpp \
	integrals.cpp \
	interestrates.cpp \
	interpolations.cpp \
	jumpdiffusion.cpp \
	lazyobject.cpp \
	libormarketmodel.cpp \
	libormarketmodelprocess.cpp \
	linearleastsquaresregression.cpp \
	lookbackoptions.cpp \
	lowdiscrepancysequences.cpp \
	margrabeoption.cpp \
	marketmodel.cpp \
	marketmodel_cms.cpp \
	marketmodel_smm.cpp \
	marketmodel_smmcapletalphacalibration.cpp \
	marketmodel_smmcapletcalibration.cpp \
	marketmodel_smmcaplethomocalibration.cpp \
	markovfunctional.cpp \
	matrices.cpp \
	mclongstaffschwartzengine.cpp \
	mersennetwister.cpp \
	money.cpp \
	multipleresetscoupons.cpp \
	noarbsabr.cpp \
	normalclvmodel.cpp \
	nthorderderivativeop.cpp \
	nthtodefault.cpp \
	numericaldifferentiation.cpp \
	observable.cpp \
	ode.cpp \
	operators.cpp \
	optimizers.cpp \
	optionletstripper.cpp \
	overnightindexedcoupon.cpp \
	overnightindexedswap.cpp \
	pagodaoption.cpp \
	partialtimebarrieroption.cpp \
	pathgenerator.cpp \
	period.cpp \
	piecewiseyieldcurve.cpp \
	piecewisezerospreadedtermstructure.cpp \
	preconditions.cpp \
	prices.cpp \
	quantlibglobalfixture.cpp \
	quantooption.cpp \
	quotes.cpp \
	rangeaccrual.cpp \
	riskneutraldensitycalculator.cpp \
	riskstats.cpp \
	rngtraits.cpp \
	rounding.cpp \
	schedule.cpp \
	settings.cpp \
	shortratemodels.cpp \
	sofrfutures.cpp \
	solvers.cpp \
	spreadoption.cpp \
	squarerootclvmodel.cpp \
	stats.cpp \
	svivolatility.cpp \
	swap.cpp \
	swapforwardmappings.cpp \
	swaption.cpp \
	swaptionvolatilitycube.cpp \
	swaptionvolatilitymatrix.cpp \
	swingoption.cpp \
	termstructures.cpp \
	timegrid.cpp \
	timeseries.cpp \
	transformedgrid.cpp \
	tqreigendecomposition.cpp \
	tracing.cpp \
	twoassetbarrieroption.cpp \
	twoassetcorrelationoption.cpp \
	ultimateforwardtermstructure.cpp \
	utilities.cpp \
	variancegamma.cpp \
	varianceoption.cpp \
	varianceswaps.cpp \
	volatilitymodels.cpp \
	vpp.cpp \
	xoshiro256starstar.cpp \
	zabr.cpp \
	zerocouponswap.cpp \
	zigguratgaussian.cpp


QL_TEST_HDRS = \
    preconditions.hpp \
	quantlibglobalfixture.hpp \
	swaptionvolstructuresutilities.hpp \
    toplevelfixture.hpp \
	utilities.hpp

QL_TESTS = ${QL_TEST_SRCS} ${QL_TEST_HDRS}


dist-hook:
	mkdir -p $(distdir)/build
	mkdir -p $(distdir)/bin
	cp -p $(srcdir)/bin/runtest.bat $(distdir)/bin

if BUILD_TEST_SUITE

AM_CPPFLAGS = -I${top_builddir} -I${top_srcdir}

if AUTO_BENCHMARK
bin_PROGRAMS = quantlib-test-suite quantlib-benchmark
else
bin_PROGRAMS = quantlib-test-suite
noinst_PROGRAMS = quantlib-benchmark
endif

if UNITY_BUILD

unity.cpp: Makefile.am
	echo "/* This file is automatically generated; do not edit.     */" > $@
	echo "/* Add the files to be included into Makefile.am instead. */" >> $@
	echo >> $@
	for i in $(QL_TEST_SRCS); do \
		echo "#include \"test-suite/$$i\"" >> $@; \
	done

nodist_quantlib_test_suite_SOURCES = unity.cpp
quantlib_test_suite_SOURCES = quantlibtestsuite.cpp 

nodist_quantlib_benchmark_SOURCES = unity.cpp
quantlib_benchmark_SOURCES = quantlibbenchmark.cpp 

EXTRA_DIST = $(QL_TESTS)

else

quantlib_test_suite_SOURCES = $(QL_TESTS) quantlibtestsuite.cpp 
quantlib_benchmark_SOURCES = $(QL_TESTS) quantlibbenchmark.cpp 
EXTRA_DIST =

endif 

quantlib_test_suite_LDADD = ${top_builddir}/ql/libQuantLib.la \
                            ${PTHREAD_LIB} ${BOOST_INTERPROCESS_LIB}

quantlib_benchmark_LDADD = ${top_builddir}/ql/libQuantLib.la \
                           ${PTHREAD_LIB} ${BOOST_INTERPROCESS_LIB}

TESTS = quantlib-test-suite$(EXEEXT)
TESTS_ENVIRONMENT = BOOST_TEST_LOG_LEVEL=message BOOST_TEST_COLOR_OUTPUT=false

.PHONY: benchmark
benchmark: quantlib-benchmark$(EXEEXT)
	BOOST_TEST_LOG_LEVEL=message ./quantlib-benchmark$(EXEEXT)

EXTRA_DIST += \
	CMakeLists.txt \
	paralleltestrunner.hpp \
	README.txt \
	testsuite.vcxproj \
	testsuite.vcxproj.filters

else

EXTRA_DIST = \
	${QL_TESTS} \
	CMakeLists.txt \
	paralleltestrunner.hpp \
	quantlibbenchmark.cpp \
	README.txt \
	testsuite.vcxproj \
	testsuite.vcxproj.filters

endif
