aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-21 15:10:16 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-21 15:10:16 +0000
commitadda98379ffcb62edf1a7424fe10735869ecaa11 (patch)
tree0827d50b2e79d7be5259c7ab8868e905d54061ec
parentf49f41ef8589ec7f36af55faaefa44dad85f1474 (diff)
downloadpaludis-adda98379ffcb62edf1a7424fe10735869ecaa11.tar.gz
paludis-adda98379ffcb62edf1a7424fe10735869ecaa11.tar.xz
gtest more
-rw-r--r--paludis/environments/no_config/Makefile.am4
-rw-r--r--paludis/environments/no_config/no_config_environment_TEST.cc48
2 files changed, 23 insertions, 29 deletions
diff --git a/paludis/environments/no_config/Makefile.am b/paludis/environments/no_config/Makefile.am
index 3c39c55..e3fb029 100644
--- a/paludis/environments/no_config/Makefile.am
+++ b/paludis/environments/no_config/Makefile.am
@@ -35,11 +35,13 @@ check_SCRIPTS = no_config_environment_TEST_setup.sh no_config_environment_TEST_c
no_config_environment_TEST_SOURCES = no_config_environment_TEST.cc
no_config_environment_TEST_LDADD = \
- $(top_builddir)/test/libtest.a \
+ $(top_builddir)/paludis/util/gtest_runner.o \
$(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
$(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
$(DYNAMIC_LD_LIBS)
+no_config_environment_TEST_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@
+
no_config_environment_TEST_CXXFLAGS = $(AM_CXXFLAGS) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
BUILT_SOURCES = \
diff --git a/paludis/environments/no_config/no_config_environment_TEST.cc b/paludis/environments/no_config/no_config_environment_TEST.cc
index b0a09db..0da71ba 100644
--- a/paludis/environments/no_config/no_config_environment_TEST.cc
+++ b/paludis/environments/no_config/no_config_environment_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -17,38 +17,30 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "no_config_environment.hh"
-#include <test/test_runner.hh>
-#include <test/test_framework.hh>
+#include <paludis/environments/no_config/no_config_environment.hh>
+
#include <paludis/util/sequence.hh>
#include <paludis/util/make_named_values.hh>
-using namespace test;
+#include <gtest/gtest.h>
+
using namespace paludis;
-namespace test_cases
+TEST(NoConfigEnvironment, Construction)
{
- struct NoConfigEnvironmentTest : TestCase
- {
- NoConfigEnvironmentTest() : TestCase("no config environment") { }
-
- void run()
- {
- NoConfigEnvironment e(make_named_values<no_config_environment::Params>(
- n::accept_unstable() = false,
- n::disable_metadata_cache() = false,
- n::extra_accept_keywords() = "",
- n::extra_params() = std::shared_ptr<Map<std::string, std::string> >(),
- n::extra_repository_dirs() = std::make_shared<FSPathSequence>(),
- n::master_repository_name() = "",
- n::profiles_if_not_auto() = "",
- n::repository_dir() = FSPath("no_config_environment_TEST_dir/repo"),
- n::repository_type() = no_config_environment::ncer_auto,
- n::write_cache() = FSPath("/var/empty")
- ));
-
- TEST_CHECK(bool(e.package_database()));
- }
- } test_no_config_environment;
+ NoConfigEnvironment e(make_named_values<no_config_environment::Params>(
+ n::accept_unstable() = false,
+ n::disable_metadata_cache() = false,
+ n::extra_accept_keywords() = "",
+ n::extra_params() = std::shared_ptr<Map<std::string, std::string> >(),
+ n::extra_repository_dirs() = std::make_shared<FSPathSequence>(),
+ n::master_repository_name() = "",
+ n::profiles_if_not_auto() = "",
+ n::repository_dir() = FSPath("no_config_environment_TEST_dir/repo"),
+ n::repository_type() = no_config_environment::ncer_auto,
+ n::write_cache() = FSPath("/var/empty")
+ ));
+
+ EXPECT_TRUE(bool(e.package_database()));
}