summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-19 13:33:47 -0400
committerJohn Wiegley <johnw@newartisans.com>2011-02-04 03:43:33 -0500
commit2a2c3c1ceca27bc1e0ce6408459ddbf8dd980fae (patch)
tree8cf5fd66d4995b72e4636a7df40febee5e80817c /tools
parentc9730d781c33e5cbece892f78008e379cfabe2e2 (diff)
downloadfork-ledger-2a2c3c1ceca27bc1e0ce6408459ddbf8dd980fae.tar.gz
fork-ledger-2a2c3c1ceca27bc1e0ce6408459ddbf8dd980fae.tar.bz2
fork-ledger-2a2c3c1ceca27bc1e0ce6408459ddbf8dd980fae.zip
Use Boost.Test instead of CppUnit
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile.am55
-rw-r--r--tools/configure.ac33
-rw-r--r--tools/excludes1
3 files changed, 31 insertions, 58 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 712b0f30..f95f832e 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -252,13 +252,13 @@ endif
TESTS = RegressTests BaselineTests ManualTests ConfirmTests \
GenerateTests
-if HAVE_CPPUNIT
-TESTS += \
+if HAVE_BOOST_TEST
+TESTS += \
UtilTests \
MathTests \
- ExprTests \
- DataTests \
- ReportTests
+ ExprTests
+# DataTests \
+# ReportTests
endif
if DEBUG
@@ -271,54 +271,35 @@ endif
check_PROGRAMS = $(TESTS)
+TESTLIBS = -lboost_unit_test_framework$(BOOST_SUFFIX) \
+ -lboost_test_exec_monitor$(BOOST_SUFFIX)
+
UtilTests_SOURCES = \
- test/UnitTests.cc \
- test/UnitTests.h \
- test/UtilTests.cc \
- test/unit/t_utils.cc \
- test/unit/t_utils.h \
- test/unit/t_times.cc \
- test/unit/t_times.h
+ test/unit/t_times.cc
UtilTests_CPPFLAGS = -I$(srcdir)/test $(lib_cppflags)
-UtilTests_LDADD = libledger_util.la -lcppunit
+UtilTests_LDADD = libledger_util.la $(TESTLIBS)
MathTests_SOURCES = \
- test/UnitTests.cc \
- test/UnitTests.h \
- test/MathTests.cc \
test/unit/t_commodity.cc \
- test/unit/t_commodity.h \
test/unit/t_amount.cc \
- test/unit/t_amount.h \
- test/unit/t_balance.cc \
- test/unit/t_balance.h
+ test/unit/t_balance.cc
MathTests_CPPFLAGS = -I$(srcdir)/test $(lib_cppflags)
MathTests_LDADD = libledger_math.la $(UtilTests_LDADD)
ExprTests_SOURCES = \
- test/UnitTests.cc \
- test/UnitTests.h \
- test/ExprTests.cc \
- test/unit/t_expr.cc \
- test/unit/t_expr.h
+ test/unit/t_expr.cc
ExprTests_CPPFLAGS = -I$(srcdir)/test $(lib_cppflags)
ExprTests_LDADD = libledger_expr.la $(MathTests_LDADD)
-DataTests_SOURCES = \
- test/UnitTests.cc \
- test/UnitTests.h \
- test/DataTests.cc
+DataTests_SOURCES =
DataTests_CPPFLAGS = -I$(srcdir)/test $(lib_cppflags)
DataTests_LDADD = libledger_data.la $(ExprTests_LDADD)
-ReportTests_SOURCES = \
- test/UnitTests.cc \
- test/UnitTests.h \
- test/ReportTests.cc
+ReportTests_SOURCES =
ReportTests_CPPFLAGS = -I$(srcdir)/test $(lib_cppflags)
ReportTests_LDADD = libledger_report.la $(DataTests_LDADD)
@@ -424,8 +405,8 @@ CheckTests:
FULLCHECK=$(srcdir)/test/fullcheck.sh
-if HAVE_CPPUNIT
-cppunittests: check
+if HAVE_BOOST_TEST
+unittests: check
@sh $(FULLCHECK) $(top_builddir)/UtilTests$(EXEEXT) --verify \
2>&1 | grep -v '^GuardMalloc:'
@sh $(FULLCHECK) $(top_builddir)/MathTests$(EXEEXT) --verify \
@@ -437,11 +418,11 @@ cppunittests: check
@sh $(FULLCHECK) $(top_builddir)/ReportTests$(EXEEXT) --verify \
2>&1 | grep -v '^GuardMalloc:'
else
-cppunittests: check
+unittests: check
@test 1 -eq 1
endif
-fullcheck: cppunittests
+fullcheck: unittests
@$(top_builddir)/RegressTests --verify
@$(top_builddir)/BaselineTests --verify
@$(top_builddir)/ManualTests --verify
diff --git a/tools/configure.ac b/tools/configure.ac
index 92a30431..028727a8 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -401,31 +401,24 @@ else
AM_CONDITIONAL(HAVE_BOOST_PYTHON, false)
fi
-# check for CppUnit
+# check for Boost.Test
AC_CACHE_CHECK(
- [if cppunit is available],
- [cppunit_avail_cv_],
- [cppunit_save_libs=$LIBS
- LIBS="-lcppunit $LIBS"
+ [if boost_test is available],
+ [boost_test_avail_cv_],
+ [boost_test_save_libs=$LIBS
+ LIBS="-lboost_unit_test_framework$BOOST_SUFFIX -lboost_test_exec_monitor$BOOST_SUFFIX $LIBS"
AC_LANG_PUSH(C++)
AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <cppunit/CompilerOutputter.h>
- #include <cppunit/TestResult.h>
- #include <cppunit/TestResultCollector.h>
- #include <cppunit/TestRunner.h>
- #include <cppunit/TextTestProgressListener.h>
- #include <cppunit/BriefTestProgressListener.h>
- #include <cppunit/XmlOutputter.h>
- #include <cppunit/extensions/TestFactoryRegistry.h>]],
- [[CPPUNIT_NS::TestResult controller;
- CPPUNIT_NS::TestResultCollector result;]])],
- [cppunit_avail_cv_=true],
- [cppunit_avail_cv_=false])
+ [AC_LANG_SOURCE(
+ [[#define BOOST_TEST_MODULE sample
+ #include <boost/test/unit_test.hpp>
+ BOOST_AUTO_TEST_CASE(test_test) {}]])],
+ [boost_test_avail_cv_=true],
+ [boost_test_avail_cv_=false])
AC_LANG_POP
- LIBS=$cppunit_save_libs])
+ LIBS=$boost_test_save_libs])
-AM_CONDITIONAL(HAVE_CPPUNIT, test x$cppunit_avail_cv_ = xtrue)
+AM_CONDITIONAL(HAVE_BOOST_TEST, test x$boost_test_avail_cv_ = xtrue)
# Checks for header files.
AC_HEADER_STDC
diff --git a/tools/excludes b/tools/excludes
index d914099f..762a27c9 100644
--- a/tools/excludes
+++ b/tools/excludes
@@ -30,7 +30,6 @@ install-sh
intl/
ledger
ledger.so
-lib/cppunit/
lib/utfcpp/
libtool
ltmain.sh