From 7e9e728f583a229392a8a6390831416994e219ca Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Thu, 2 Mar 2006 21:54:21 +0000 Subject: [PATCH] Add unit tests to Unix build --- Makefile.am | 2 +- configure.ac | 2 +- xmltoolingtest/Makefile.am | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 xmltoolingtest/Makefile.am diff --git a/Makefile.am b/Makefile.am index ba80dca..d56ad40 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,7 @@ EXTRA_DIST = dist-hook: rm -rf `find $(distdir)/schemas -name Makefile` -SUBDIRS = schemas xmltooling +SUBDIRS = schemas xmltooling xmltoolingtest #all-local: opensaml.spec pkginfo # diff --git a/configure.ac b/configure.ac index 8c6ee99..a08e631 100644 --- a/configure.ac +++ b/configure.ac @@ -199,4 +199,4 @@ AC_SUBST(CXXTESTFLAGS) AM_CONDITIONAL(BUILD_UNITTEST,test -f ${CXXTEST}) # output makefiles -AC_OUTPUT(Makefile xmltooling/Makefile schemas/Makefile) +AC_OUTPUT(Makefile xmltooling/Makefile xmltoolingtest/Makefile schemas/Makefile) diff --git a/xmltoolingtest/Makefile.am b/xmltoolingtest/Makefile.am new file mode 100644 index 0000000..041b563 --- /dev/null +++ b/xmltoolingtest/Makefile.am @@ -0,0 +1,34 @@ +AUTOMAKE_OPTIONS = foreign + +if BUILD_UNITTEST +bin_PROGRAMS = xmltoolingtest +xmltoolingtest_CXXFLAGS = $(CXXFLAGS) $(CXXTESTFLAGS) +bin_PROGRAMS = +endif + +xmltoolingtest_h = \ + xmltoolingtest.h \ + MarshallingTest.h \ + UnknownText.h \ + UnmarshallingTest.h + +noinst_HEADERS = \ + XMLObjectBaseTestCase.h + +nodist_xmltoolingtest_SOURCES = $(xmltoolingtest_h:.h=.cpp) + +CLEANFILES = $(nodist_xmltoolingtest_SOURCES) + +do-cxxtestgen: + if test $(HFILE) = "xmltoolingtest.h"; then \ + $(CXXTEST) --error-printer --have-eh --have-std --abort-on-fail -o $(CPPFILE) $(HFILE); \ + else \ + $(CXXTEST) --part --have-eh --have-std --abort-on-fail -o $(CPPFILE) $(HFILE); \ + fi; + +$(nodist_xmltoolingtest_SOURCES): %.cpp: %.h + $(MAKE) do-cxxtestgen HFILE=$< CPPFILE=$@ + +xmltoolingtest_LDADD = $(top_builddir)/xmltooling/libxmltooling.la + +EXTRA_DIST = xmltoolingtest.vcproj $(xmltoolingtest_h) data -- 2.1.4