# PLEASE adhere to the alphabetical ordering in this Makefile!
# Also indentation by a single tab

check_PROGRAMS =
noinst_PROGRAMS =
TESTS =

include ../../src/Actions/unittests/Makefile.am
include ../../src/Analysis/unittests/Makefile.am
include ../../src/Descriptors/unittests/Makefile.am
include ../../src/Element/unittests/Makefile.am
include ../../src/Fragmentation/unittests/Makefile.am
include ../../src/Graph/unittests/Makefile.am
include ../../src/Parser/unittests/Makefile.am
include ../../src/RandomNumbers/unittests/Makefile.am
include ../../src/Shapes/unittests/Makefile.am
include ../../src/Tesselation/unittests/Makefile.am
include ../../src/UIElements/CommandLineUI/unittests/Makefile.am
include ../../src/UIElements/Menu/unittests/Makefile.am

INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/LinearAlgebra/src

AM_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
AM_CPPFLAGS = ${BOOST_CPPFLAGS} $(CPPUNIT_CFLAGS) ${CodePatterns_CFLAGS}

GENERALTESTS = \
  BoxUnitTest \
  FormulaUnittest \
  LinkedCellUnitTest \
  ListOfBondsUnitTest \
  WorldTimeUnitTest

# these ones are checked
TESTS += $(GENERALTESTS)
# these ones are built for checking only
check_PROGRAMS += $(GENERALTESTS) 
# ... and not installed
noinst_PROGRAMS += $(GENERALTESTS) TestRunner

BOOST_LIB = \
	$(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIBS) \
	$(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_FILESYSTEM_LIBS) \
	$(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS)

GENERALLIBS = \
	../libMolecuilder.la \
	../libMolecuilderHelpers.la \
	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
	${CodePatterns_LIBS} \
	$(BOOST_LIB)

ALLLIBS = \
	../libMolecuilderUI.la \
	../libMolecuilder.la \
	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
	${CodePatterns_LIBS} \
	$(BOOST_LIB)

TESTSOURCES = \
	${ACTIONTESTSSOURCES} \
	${ANALYSISTESTSSOURCES} \
	${DESCRIPTORTESTSSOURCES} \
	${ELEMENTTESTSSOURCES} \
	${FRAGMENTATIONTESTSSOURCES} \
	${GRAPHTESTSSOURCES} \
	${LINEARALGEBRATESTSSOURCES} \
	${PARSERTESTSSOURCES} \
	${RANDOMNUMBERTESTSSOURCES} \
	${SHAPETESTSSOURCES} \
	${TESSELATIONTESTSSOURCES} \
	$(UIELEMENTSCOMMANDLINEPARSERTESTSSOURCES) \
	${UIELEMENTSMENUTESTSSOURCES} \
  BoxUnitTest.cpp \
  FormulaUnitTest.cpp \
  LinkedCellUnitTest.cpp \
  ListOfBondsUnitTest.cpp \
  WorldTimeUnitTest.cpp

TESTHEADERS = \
	${ACTIONTESTSHEADERS} \
	${ANALYSISTESTSHEADERS} \
	${DESCRIPTORTESTSHEADERS} \
	${ELEMENTTESTSHEADERS} \
	${FRAGMENTATIONTESTSHEADERS} \
	${GRAPHTESTSHEADERS} \
	${LINEARALGEBRATESTSHEADERS} \
	${PARSERTESTSHEADERS} \
	${RANDOMNUMBERTESTSHEADERS} \
	${SHAPETESTSHEADERS} \
	${TESSELATIONTESTSHEADERS} \
	$(UIELEMENTSCOMMANDLINEPARSERTESTSHEADERS) \
	${UIELEMENTSMENUTESTSHEADERS} \
  BoxUnitTest.hpp \
  FormulaUnitTest.hpp \
  LinkedCellUnitTest.hpp \
  ListOfBondsUnitTest.hpp \
  WorldTimeUnitTest.hpp
  

BoxUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
	BoxUnitTest.cpp \
	BoxUnitTest.hpp
BoxUnitTest_LDADD = \
	../libMolecuilder.la \
	../libMolecuilderShapes.la \
	../libMolecuilderHelpers.la \
	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la

FormulaUnittest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
	FormulaUnitTest.cpp \
	FormulaUnitTest.hpp
FormulaUnittest_LDADD = $(ALLLIBS)

LinkedCellUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
	LinkedCellUnitTest.cpp \
	LinkedCellUnitTest.hpp
LinkedCellUnitTest_LDADD = $(ALLLIBS)

ListOfBondsUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
	ListOfBondsUnitTest.cpp \
	ListOfBondsUnitTest.hpp 
ListOfBondsUnitTest_LDADD = $(ALLLIBS)

WorldTimeUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
	WorldTimeUnitTest.cpp \
	WorldTimeUnitTest.hpp \
	../WorldTime.cpp \
	../WorldTime.hpp
WorldTimeUnitTest_LDADD = ${BOOST_LIB}


TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS)
TestRunner_LDADD = ${UILIBS} ${ALLLIBS}

#AUTOMAKE_OPTIONS = parallel-tests
