diff options
-rw-r--r-- | paludis/environments/no_config/Makefile.am | 4 | ||||
-rw-r--r-- | paludis/environments/no_config/no_config_environment_TEST.cc | 48 |
2 files changed, 23 insertions, 29 deletions
diff --git a/paludis/environments/no_config/Makefile.am b/paludis/environments/no_config/Makefile.am index 3c39c5586..e3fb029a6 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 b0a09db07..0da71bafa 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())); } |