aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-09-01 17:32:56 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-09-01 17:33:06 +0100
commit243ba0181d0c63af58317d56ff6e351076e76c1d (patch)
tree92d3ed4e034a201f2740fe9381221a597097635b
parent541b4b83b6c02e0c7c86e3ce6e7541f94d37ed5a (diff)
downloadpaludis-243ba0181d0c63af58317d56ff6e351076e76c1d.tar.gz
paludis-243ba0181d0c63af58317d56ff6e351076e76c1d.tar.xz
src_prepare tests.
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc40
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh19
2 files changed, 59 insertions, 0 deletions
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index e30290e..f4fd2be 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1191,6 +1191,16 @@ namespace test_cases
}
{
+ TestMessageSuffix suffix("no src_prepare 0", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-0",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "0");
+ id->perform_action(action);
+ }
+
+ {
TestMessageSuffix suffix("no src_configure 0", true);
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-0",
@@ -1320,6 +1330,16 @@ namespace test_cases
}
{
+ TestMessageSuffix suffix("no src_prepare 1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-1",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
+ id->perform_action(action);
+ }
+
+ {
TestMessageSuffix suffix("no src_configure 1", true);
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-1",
@@ -1395,6 +1415,16 @@ namespace test_cases
}
{
+ TestMessageSuffix suffix("src_prepare 2", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-2",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
+ TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ }
+
+ {
TestMessageSuffix suffix("src_configure 2", true);
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-2",
@@ -1589,6 +1619,16 @@ namespace test_cases
}
{
+ TestMessageSuffix suffix("no src_prepare kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-kdebuild-1",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ id->perform_action(action);
+ }
+
+ {
TestMessageSuffix suffix("no src_configure kdebuild-1", true);
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-kdebuild-1",
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index af1dd77..b3a9a71 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -913,6 +913,23 @@ pkg_preinst() {
[[ -d "${T}" ]] || die "T not a dir"
}
END
+mkdir -p "cat/src_prepare"
+cat <<END > cat/src_prepare/src_prepare-0.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_prepare() {
+ die src_prepare
+}
+END
+cp cat/src_prepare/src_prepare-{0,1}.ebuild || exit 1
+cp cat/src_prepare/src_prepare-{0,2}.ebuild || exit 1
mkdir -p "cat/src_configure"
cat <<END > cat/src_configure/src_configure-0.ebuild || exit 1
EAPI="\${PV}"
@@ -1267,6 +1284,8 @@ src_install() {
END
mkdir -p "cat/doman-kdebuild"
sed -e /EAPI=/d cat/doman/doman-0.ebuild >cat/doman-kdebuild/doman-kdebuild-1.kdebuild-1 || exit 1
+mkdir -p "cat/src_prepare-kdebuild"
+sed -e /EAPI=/d cat/src_prepare/src_prepare-0.ebuild >cat/src_prepare-kdebuild/src_prepare-kdebuild-1.kdebuild-1 || exit 1
mkdir -p "cat/src_configure-kdebuild"
sed -e /EAPI=/d cat/src_configure/src_configure-0.ebuild >cat/src_configure-kdebuild/src_configure-kdebuild-1.kdebuild-1 || exit 1
mkdir -p "cat/expand-vars"