aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 21:02:23 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 21:02:23 +0000
commit1e2a6ebd0f86da19f8e5ce16ad152f06e6efe169 (patch)
tree3fafe880c958407c4ea9553ee2c98c9150e79c7b
parentc10e587ad284a598803ca161001f1f332f43197a (diff)
downloadpaludis-1e2a6ebd0f86da19f8e5ce16ad152f06e6efe169.tar.gz
paludis-1e2a6ebd0f86da19f8e5ce16ad152f06e6efe169.tar.xz
gtest more
-rw-r--r--paludis/dep_spec_TEST.cc72
-rw-r--r--paludis/files.m42
2 files changed, 31 insertions, 43 deletions
diff --git a/paludis/dep_spec_TEST.cc b/paludis/dep_spec_TEST.cc
index 52d8c12..816e054 100644
--- a/paludis/dep_spec_TEST.cc
+++ b/paludis/dep_spec_TEST.cc
@@ -19,62 +19,50 @@
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
+#include <paludis/version_requirements.hh>
+#include <paludis/environments/test/test_environment.hh>
+
#include <paludis/util/clone-impl.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
-#include <paludis/version_requirements.hh>
-#include <paludis/environments/test/test_environment.hh>
-#include <test/test_framework.hh>
-#include <test/test_runner.hh>
+#include <paludis/util/stringify.hh>
+
+#include <gtest/gtest.h>
using namespace paludis;
-using namespace test;
-namespace test_cases
+TEST(FetchableURIDepSpec, Works)
{
- struct FetchableURIDepSpecTest : TestCase
- {
- FetchableURIDepSpecTest() : TestCase("fetchable uri dep spec") { }
-
- void run()
- {
- FetchableURIDepSpec a("foo");
- TEST_CHECK_EQUAL(a.original_url(), "foo");
- TEST_CHECK_EQUAL(a.renamed_url_suffix(), "");
- TEST_CHECK_EQUAL(a.filename(), "foo");
-
- FetchableURIDepSpec b("fnord -> bar");
- TEST_CHECK_EQUAL(b.original_url(), "fnord");
- TEST_CHECK_EQUAL(b.renamed_url_suffix(), "bar");
- TEST_CHECK_EQUAL(b.filename(), "bar");
+ FetchableURIDepSpec a("foo");
+ EXPECT_EQ("foo", a.original_url());
+ EXPECT_EQ("", a.renamed_url_suffix());
+ EXPECT_EQ("foo", a.filename());
- FetchableURIDepSpec c("http://example.com/download/baz");
- TEST_CHECK_EQUAL(c.filename(), "baz");
- }
- } test_fetchable_uri_dep_spec;
+ FetchableURIDepSpec b("fnord -> bar");
+ EXPECT_EQ("fnord", b.original_url());
+ EXPECT_EQ("bar", b.renamed_url_suffix());
+ EXPECT_EQ("bar", b.filename());
- struct DepSpecCloneTest : TestCase
- {
- DepSpecCloneTest() : TestCase("dep spec clone") { }
+ FetchableURIDepSpec c("http://example.com/download/baz");
+ EXPECT_EQ("baz", c.filename());
+}
- void run()
- {
- TestEnvironment env;
- PackageDepSpec a(parse_user_package_dep_spec("cat/pkg:1::repo[=1|>3.2][foo]",
- &env, { }));
+TEST(DepSpec, Clone)
+{
+ TestEnvironment env;
+ PackageDepSpec a(parse_user_package_dep_spec("cat/pkg:1::repo[=1|>3.2][foo]",
+ &env, { }));
- std::shared_ptr<PackageDepSpec> b(std::static_pointer_cast<PackageDepSpec>(a.clone()));
- TEST_CHECK_STRINGIFY_EQUAL(a, *b);
+ std::shared_ptr<PackageDepSpec> b(std::static_pointer_cast<PackageDepSpec>(a.clone()));
+ EXPECT_EQ(stringify(a), stringify(*b));
- std::shared_ptr<PackageDepSpec> c(std::static_pointer_cast<PackageDepSpec>(a.clone()));
- TEST_CHECK_STRINGIFY_EQUAL(a, *c);
+ std::shared_ptr<PackageDepSpec> c(std::static_pointer_cast<PackageDepSpec>(a.clone()));
+ EXPECT_EQ(stringify(a), stringify(*c));
- BlockDepSpec d("!" + stringify(*c), *c);
- std::shared_ptr<BlockDepSpec> e(std::static_pointer_cast<BlockDepSpec>(d.clone()));
- TEST_CHECK_STRINGIFY_EQUAL(d.blocking(), e->blocking());
- }
- } test_dep_spec_clone;
+ BlockDepSpec d("!" + stringify(*c), *c);
+ std::shared_ptr<BlockDepSpec> e(std::static_pointer_cast<BlockDepSpec>(d.clone()));
+ EXPECT_EQ(stringify(d.blocking()), stringify(e->blocking()));
}
diff --git a/paludis/files.m4 b/paludis/files.m4
index 2d998ef..10290fb 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -27,7 +27,7 @@ add(`common_sets', `hh', `cc', `fwd')
add(`contents', `hh', `cc', `fwd')
add(`create_output_manager_info', `hh', `cc', `fwd', `se')
add(`dep_label', `hh', `cc', `fwd')
-add(`dep_spec', `hh', `cc', `test', `fwd')
+add(`dep_spec', `hh', `cc', `gtest', `fwd')
add(`dep_spec_annotations', `hh', `cc', `fwd', `se')
add(`dep_spec_data', `hh', `cc', `fwd')
add(`dep_spec_flattener', `hh', `cc')