summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@debian.org>2013-09-08 17:32:50 +0100
committerRoger Leigh <rleigh@debian.org>2013-09-08 20:08:11 +0100
commit45883d7743a9aa4b749879597e63a72a70bd2c9d (patch)
tree67e106b6f4db781e091a97c0ce053d18887a6495
parent893efce5a1b0c9230904ff72335fafb46d4d65e7 (diff)
downloadschroot-45883d7743a9aa4b749879597e63a72a70bd2c9d.tar.gz
build: Drop CppUnit support
-rw-r--r--configure.ac4
-rw-r--r--lib/test/Makefile.am8
-rw-r--r--lib/test/gtestmain.cc37
-rw-r--r--lib/test/testmain.cc20
-rw-r--r--test/Makefile.am44
5 files changed, 30 insertions, 83 deletions
diff --git a/configure.ac b/configure.ac
index ec14c494..0d40a2d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -300,8 +300,6 @@ AC_DEFINE_UNQUOTED(SBUILD_HOST_CPU, ["$host_cpu"])
# Checks for libraries.
-AM_PATH_CPPUNIT([1.10.0], [HAVE_CPPUNIT=yes])
-
AC_MSG_CHECKING([for gtest])
if test -d "$GTEST_ROOT"; then
LDFLAGS="$LDFLAGS -L$GTEST_ROOT"
@@ -323,7 +321,7 @@ CXXFLAGS="${saved_CXXFLAGS}"
LIBS="${saved_LIBS}"
AC_SUBST([GTEST_LIBS])
-AM_CONDITIONAL([USE_UNIT_TESTS], [test -n "$HAVE_GTEST" && test -n "$HAVE_CPPUNIT"])
+AM_CONDITIONAL([USE_UNIT_TESTS], [test -n "$HAVE_GTEST"])
SCHROOT_CFLAGS=""
AC_SUBST([SCHROOT_CFLAGS])
diff --git a/lib/test/Makefile.am b/lib/test/Makefile.am
index ba96ff3e..4d87f1b4 100644
--- a/lib/test/Makefile.am
+++ b/lib/test/Makefile.am
@@ -17,14 +17,10 @@
#####################################################################
if USE_UNIT_TESTS
-noinst_LTLIBRARIES += lib/test/libtest.la lib/test/libtest2.la
+noinst_LTLIBRARIES += lib/test/libtest.la
endif
lib_test_libtest_la_SOURCES = \
lib/test/testmain.cc
-lib_test_libtest_la_LIBADD = $(top_builddir)/lib/sbuild/libsbuild.la $(CPPUNIT_LIBS)
-
-lib_test_libtest2_la_SOURCES = \
- lib/test/gtestmain.cc
-lib_test_libtest2_la_LIBADD = $(top_builddir)/lib/sbuild/libsbuild.la $(GTEST_LIBS)
+lib_test_libtest_la_LIBADD = $(top_builddir)/lib/sbuild/libsbuild.la $(GTEST_LIBS)
diff --git a/lib/test/gtestmain.cc b/lib/test/gtestmain.cc
deleted file mode 100644
index efeb69f3..00000000
--- a/lib/test/gtestmain.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright © 2006-2013 Roger Leigh <rleigh@debian.org>
- *
- * schroot is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * schroot is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- *********************************************************************/
-
-#include <config.h>
-
-#include <sbuild/log.h>
-
-#include <gtest/gtest.h>
-
-int
-main(int argc,
- char *argv[])
-{
-#ifdef SBUILD_DEBUG
- sbuild::debug_log_level = sbuild::DEBUG_NOTICE;
-#else
- sbuild::debug_log_level = sbuild::DEBUG_NONE;
-#endif
-
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/lib/test/testmain.cc b/lib/test/testmain.cc
index 97dd7b1f..efeb69f3 100644
--- a/lib/test/testmain.cc
+++ b/lib/test/testmain.cc
@@ -20,15 +20,11 @@
#include <sbuild/log.h>
-#include <cstdlib>
-
-#include <cppunit/ui/text/TestRunner.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-
-using namespace CppUnit;
+#include <gtest/gtest.h>
int
-main()
+main(int argc,
+ char *argv[])
{
#ifdef SBUILD_DEBUG
sbuild::debug_log_level = sbuild::DEBUG_NOTICE;
@@ -36,12 +32,6 @@ main()
sbuild::debug_log_level = sbuild::DEBUG_NONE;
#endif
- TextUi::TestRunner runner;
-
- TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
- runner.addTest(registry.makeTest());
-
- bool ok = runner.run();
-
- return (ok) ? EXIT_SUCCESS : EXIT_FAILURE;
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
}
diff --git a/test/Makefile.am b/test/Makefile.am
index 9aef2c3a..0dfd069a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -97,88 +97,88 @@ endif
test_sbuild_chroot_chroot_SOURCES = \
test/sbuild/chroot/chroot.cc \
test/sbuild/chroot/chroot.h
-test_sbuild_chroot_chroot_LDADD = lib/test/libtest2.la
+test_sbuild_chroot_chroot_LDADD = lib/test/libtest.la
test_sbuild_chroot_plain_SOURCES = \
test/sbuild/chroot/plain.cc \
test/sbuild/chroot/chroot.h
-test_sbuild_chroot_plain_LDADD = lib/test/libtest2.la
+test_sbuild_chroot_plain_LDADD = lib/test/libtest.la
test_sbuild_chroot_custom_SOURCES = \
test/sbuild/chroot/custom.cc \
test/sbuild/chroot/chroot.h
-test_sbuild_chroot_custom_LDADD = lib/test/libtest2.la
+test_sbuild_chroot_custom_LDADD = lib/test/libtest.la
test_sbuild_chroot_file_SOURCES = \
test/sbuild/chroot/file.cc \
test/sbuild/chroot/chroot.h
-test_sbuild_chroot_file_LDADD = lib/test/libtest2.la
+test_sbuild_chroot_file_LDADD = lib/test/libtest.la
test_sbuild_chroot_directory_SOURCES = \
test/sbuild/chroot/directory.cc \
test/sbuild/chroot/chroot.h
-test_sbuild_chroot_directory_LDADD = lib/test/libtest2.la
+test_sbuild_chroot_directory_LDADD = lib/test/libtest.la
test_sbuild_chroot_block_device_SOURCES = \
$(test_sbuild_chroot_blockdev_sources) \
test/sbuild/chroot/chroot.h
-test_sbuild_chroot_block_device_LDADD = lib/test/libtest2.la
+test_sbuild_chroot_block_device_LDADD = lib/test/libtest.la
test_sbuild_chroot_lvm_snapshot_SOURCES = \
$(test_sbuild_chroot_lvmsnap_sources) \
test/sbuild/chroot/chroot.h
-test_sbuild_chroot_lvm_snapshot_LDADD = lib/test/libtest2.la
+test_sbuild_chroot_lvm_snapshot_LDADD = lib/test/libtest.la
test_sbuild_chroot_btrfs_snapshot_SOURCES = \
$(test_sbuild_chroot_btrfssnap_sources) \
test/sbuild/chroot/chroot.h
-test_sbuild_chroot_btrfs_snapshot_LDADD = lib/test/libtest2.la
+test_sbuild_chroot_btrfs_snapshot_LDADD = lib/test/libtest.la
test_sbuild_chroot_loopback_SOURCES = \
$(test_sbuild_chroot_loopback_sources) \
test/sbuild/chroot/chroot.h
-test_sbuild_chroot_loopback_LDADD = lib/test/libtest2.la
+test_sbuild_chroot_loopback_LDADD = lib/test/libtest.la
test_sbuild_chroot_facet_userdata_SOURCES = \
test/sbuild/chroot/facet/userdata.cc \
test/sbuild/chroot/chroot.h
-test_sbuild_chroot_facet_userdata_LDADD = lib/test/libtest2.la
+test_sbuild_chroot_facet_userdata_LDADD = lib/test/libtest.la
test_sbuild_chroot_config_SOURCES = test/sbuild/chroot/config.cc
-test_sbuild_chroot_config_LDADD = lib/test/libtest2.la
+test_sbuild_chroot_config_LDADD = lib/test/libtest.la
test_sbuild_environment_SOURCES = test/sbuild/environment.cc
-test_sbuild_environment_LDADD = lib/test/libtest2.la
+test_sbuild_environment_LDADD = lib/test/libtest.la
test_sbuild_keyfile_SOURCES = test/sbuild/keyfile.cc
-test_sbuild_keyfile_LDADD = lib/test/libtest2.la
+test_sbuild_keyfile_LDADD = lib/test/libtest.la
test_sbuild_lock_SOURCES = test/sbuild/lock.cc
-test_sbuild_lock_LDADD = lib/test/libtest2.la
+test_sbuild_lock_LDADD = lib/test/libtest.la
test_sbuild_log_SOURCES = test/sbuild/log.cc
-test_sbuild_log_LDADD = lib/test/libtest2.la
+test_sbuild_log_LDADD = lib/test/libtest.la
test_sbuild_nostream_SOURCES = test/sbuild/nostream.cc
-test_sbuild_nostream_LDADD = lib/test/libtest2.la
+test_sbuild_nostream_LDADD = lib/test/libtest.la
test_sbuild_parse_value_SOURCES = test/sbuild/parse-value.cc
-test_sbuild_parse_value_LDADD = lib/test/libtest2.la
+test_sbuild_parse_value_LDADD = lib/test/libtest.la
test_sbuild_personality_SOURCES = test/sbuild/personality.cc
-test_sbuild_personality_LDADD = lib/test/libtest2.la
+test_sbuild_personality_LDADD = lib/test/libtest.la
test_sbuild_regex_SOURCES = test/sbuild/regex.cc
-test_sbuild_regex_LDADD = lib/test/libtest2.la
+test_sbuild_regex_LDADD = lib/test/libtest.la
test_sbuild_run_parts_SOURCES = test/sbuild/run-parts.cc
-test_sbuild_run_parts_LDADD = lib/test/libtest2.la
+test_sbuild_run_parts_LDADD = lib/test/libtest.la
test_sbuild_util_SOURCES = test/sbuild/util.cc
-test_sbuild_util_LDADD = lib/test/libtest2.la
+test_sbuild_util_LDADD = lib/test/libtest.la
test_bin_common_option_action_SOURCES = test/bin-common/option-action.cc
-test_bin_common_option_action_LDADD = $(top_builddir)/lib/bin-common/libbin-common.la lib/test/libtest2.la
+test_bin_common_option_action_LDADD = $(top_builddir)/lib/bin-common/libbin-common.la lib/test/libtest.la
EXTRA_DIST += \
test/keyfile.ex1 \