diff options
author | 2011-03-25 10:57:55 +0000 | |
---|---|---|
committer | 2011-03-25 16:55:34 +0000 | |
commit | c225b90e67f8bc211cb738558f6d57427089e3f6 (patch) | |
tree | e7003bd2da2348dc808b81721e99baeae2ab2d3a | |
parent | 5284f6e650a4f5361b6738af44e82be8b77a603f (diff) | |
download | paludis-c225b90e67f8bc211cb738558f6d57427089e3f6.tar.gz paludis-c225b90e67f8bc211cb738558f6d57427089e3f6.tar.xz |
gtest more
-rw-r--r-- | paludis/repositories/accounts/Makefile.am | 4 | ||||
-rw-r--r-- | paludis/repositories/accounts/accounts_repository_TEST.cc | 38 |
2 files changed, 19 insertions, 23 deletions
diff --git a/paludis/repositories/accounts/Makefile.am b/paludis/repositories/accounts/Makefile.am index 06311730b..ef8e4b80b 100644 --- a/paludis/repositories/accounts/Makefile.am +++ b/paludis/repositories/accounts/Makefile.am @@ -40,13 +40,15 @@ libpaludisaccountsrepository_la_SOURCES = \ accounts_repository_TEST_SOURCES = accounts_repository_TEST.cc accounts_repository_TEST_LDADD = \ + $(top_builddir)/paludis/util/gtest_runner.o \ $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \ $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \ - $(top_builddir)/test/libtest.a \ $(DYNAMIC_LD_LIBS) accounts_repository_TEST_CXXFLAGS = $(AM_CXXFLAGS) @PALUDIS_CXXFLAGS_NO_DEBUGGING@ +accounts_repository_TEST_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@ + EXTRA_DIST = \ accounts_repository_TEST.cc diff --git a/paludis/repositories/accounts/accounts_repository_TEST.cc b/paludis/repositories/accounts/accounts_repository_TEST.cc index 9c45e5934..b96035bee 100644 --- a/paludis/repositories/accounts/accounts_repository_TEST.cc +++ b/paludis/repositories/accounts/accounts_repository_TEST.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009, 2010 Ciaran McCreesh + * Copyright (c) 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 @@ -18,43 +18,37 @@ */ #include <paludis/repositories/accounts/accounts_repository.hh> + #include <paludis/environments/test/test_environment.hh> + #include <paludis/util/sequence.hh> #include <paludis/util/join.hh> #include <paludis/util/wrapped_forward_iterator.hh> #include <paludis/util/indirect_iterator-impl.hh> #include <paludis/util/make_named_values.hh> + #include <paludis/generator.hh> #include <paludis/selection.hh> #include <paludis/filtered_generator.hh> #include <paludis/filter.hh> #include <paludis/package_id.hh> #include <paludis/package_database.hh> -#include <test/test_framework.hh> -#include <test/test_runner.hh> + #include <memory> +#include <gtest/gtest.h> + using namespace paludis; using namespace paludis::accounts_repository; -using namespace test; -namespace test_cases +TEST(AccountsRepository, Creation) { - struct AccountsRepositoryCreationTest : TestCase - { - AccountsRepositoryCreationTest() : TestCase("creation") { } - - void run() - { - TestEnvironment env; - std::shared_ptr<AccountsRepository> repo(std::make_shared<AccountsRepository>( - make_named_values<AccountsRepositoryParams>( - n::environment() = &env, - n::name() = RepositoryName("accounts") - ))); - env.package_database()->add_repository(1, repo); - TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "accounts"); - } - } test_creation; + TestEnvironment env; + std::shared_ptr<AccountsRepository> repo(std::make_shared<AccountsRepository>( + make_named_values<AccountsRepositoryParams>( + n::environment() = &env, + n::name() = RepositoryName("accounts") + ))); + env.package_database()->add_repository(1, repo); + EXPECT_EQ("accounts", stringify(repo->name())); } - |