aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-26 23:32:19 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-26 23:32:19 +0000
commit70635db7d6bdf25fb9e2b18562c69cd066e00995 (patch)
tree9082ad65cb9202b17699348ac51bbcd373c59755
parentaf81c486651c7feb0dbadf7091a1a435ba1d8018 (diff)
downloadpaludis-70635db7d6bdf25fb9e2b18562c69cd066e00995.tar.gz
paludis-70635db7d6bdf25fb9e2b18562c69cd066e00995.tar.xz
gtest more
-rw-r--r--paludis/repositories/e/Makefile.am4
-rw-r--r--paludis/repositories/e/vdb_repository_TEST_eapis.cc487
-rwxr-xr-xpaludis/repositories/e/vdb_repository_TEST_eapis_setup.sh25
3 files changed, 266 insertions, 250 deletions
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index cc3c1dc..eb591ab 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -340,13 +340,15 @@ vdb_repository_TEST_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@
vdb_repository_TEST_eapis_SOURCES = vdb_repository_TEST_eapis.cc
vdb_repository_TEST_eapis_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)
vdb_repository_TEST_eapis_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+vdb_repository_TEST_eapis_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@
+
vdb_repository_TEST_cache_SOURCES = vdb_repository_TEST_cache.cc
vdb_repository_TEST_cache_LDADD = \
diff --git a/paludis/repositories/e/vdb_repository_TEST_eapis.cc b/paludis/repositories/e/vdb_repository_TEST_eapis.cc
index 9a42781..ee0281c 100644
--- a/paludis/repositories/e/vdb_repository_TEST_eapis.cc
+++ b/paludis/repositories/e/vdb_repository_TEST_eapis.cc
@@ -20,8 +20,9 @@
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
+
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/metadata_key.hh>
+
#include <paludis/util/sequence.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
@@ -29,6 +30,9 @@
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/fs_iterator.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/stringify.hh>
+
+#include <paludis/metadata_key.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
@@ -43,14 +47,13 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_null_shared_ptr.hh>
-#include <test/test_framework.hh>
-#include <test/test_runner.hh>
#include <functional>
#include <algorithm>
#include <iterator>
#include <vector>
-using namespace test;
+#include <gtest/gtest.h>
+
using namespace paludis;
namespace
@@ -85,266 +88,252 @@ namespace
{
return false;
}
-}
-namespace test_cases
-{
- struct PhasesTest : TestCase
+ struct PhasesTest :
+ testing::TestWithParam<std::string>
{
- const std::string eapi;
+ std::string eapi;
- PhasesTest(const std::string & e) :
- TestCase("phases eapi " + e),
- eapi(e)
+ void SetUp()
{
+ eapi = GetParam();
}
+ };
+}
- unsigned max_run_time() const
- {
- return 3000;
- }
+TEST_P(PhasesTest, Works)
+{
+ TestEnvironment env;
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
+ keys->insert("format", "e");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "srcrepo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "srcrepo/profiles/profile"));
+ keys->insert("layout", "traditional");
+ keys->insert("eapi_when_unknown", eapi);
+ keys->insert("eapi_when_unspecified", eapi);
+ keys->insert("profile_eapi", "0");
+ keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
+ std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
+ std::bind(from_keys, keys, std::placeholders::_1)));
+ env.add_repository(1, repo);
+
+ keys = std::make_shared<Map<std::string, std::string>>();
+ keys->insert("format", "vdb");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("provides_cache", "/var/empty");
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "dstrepo"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
+ std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
+ std::bind(from_keys, keys, std::placeholders::_1)));
+ env.add_repository(0, vdb_repo);
+
+ InstallAction install_action(make_named_values<InstallActionOptions>(
+ n::destination() = vdb_repo,
+ n::make_output_manager() = &make_standard_output_manager,
+ n::perform_uninstall() = &do_uninstall,
+ n::replacing() = std::make_shared<PackageIDSequence>(),
+ n::want_phase() = &want_all_phases
+ ));
+
+ UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
+ n::config_protect() = "",
+ n::if_for_install_id() = make_null_shared_ptr(),
+ n::ignore_for_unmerge() = &ignore_nothing,
+ n::is_overwrite() = false,
+ n::make_output_manager() = &make_standard_output_manager
+ ));
+
+ InfoActionOptions info_action_options(make_named_values<InfoActionOptions>(
+ n::make_output_manager() = &make_standard_output_manager
+ ));
+
+ ConfigActionOptions config_action_options(make_named_values<ConfigActionOptions>(
+ n::make_output_manager() = &make_standard_output_manager
+ ));
+
+ InfoAction info_action(info_action_options);
+ ConfigAction config_action(config_action_options);
- bool repeatable() const
- {
- return false;
- }
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(install_action);
+ }
- void run()
- {
- TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
- keys->insert("format", "e");
- keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "srcrepo"));
- keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "srcrepo/profiles/profile"));
- keys->insert("layout", "traditional");
- keys->insert("eapi_when_unknown", eapi);
- keys->insert("eapi_when_unspecified", eapi);
- keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "distdir"));
- keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "build"));
- keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
- std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
- std::bind(from_keys, keys, std::placeholders::_1)));
- env.add_repository(1, repo);
-
- keys = std::make_shared<Map<std::string, std::string>>();
- keys->insert("format", "vdb");
- keys->insert("names_cache", "/var/empty");
- keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "dstrepo"));
- keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "build"));
- keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
- std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
- std::bind(from_keys, keys, std::placeholders::_1)));
- env.add_repository(0, vdb_repo);
-
- InstallAction install_action(make_named_values<InstallActionOptions>(
- n::destination() = vdb_repo,
- n::make_output_manager() = &make_standard_output_manager,
- n::perform_uninstall() = &do_uninstall,
- n::replacing() = std::make_shared<PackageIDSequence>(),
- n::want_phase() = &want_all_phases
- ));
-
- UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
- n::config_protect() = "",
- n::if_for_install_id() = make_null_shared_ptr(),
- n::ignore_for_unmerge() = &ignore_nothing,
- n::is_overwrite() = false,
- n::make_output_manager() = &make_standard_output_manager
- ));
-
- InfoActionOptions info_action_options(make_named_values<InfoActionOptions>(
- n::make_output_manager() = &make_standard_output_manager
- ));
-
- ConfigActionOptions config_action_options(make_named_values<ConfigActionOptions>(
- n::make_output_manager() = &make_standard_output_manager
- ));
-
- InfoAction info_action(info_action_options);
- ConfigAction config_action(config_action_options);
-
- {
- TestMessageSuffix suffix("install", true);
- const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
- &env, { })), make_null_shared_ptr(), { }))]->begin());
- TEST_CHECK(bool(id));
- id->perform_action(install_action);
- }
-
- vdb_repo->invalidate();
-
- {
- TestMessageSuffix suffix("reinstall", true);
- const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
- &env, { })), make_null_shared_ptr(), { }))]->begin());
- TEST_CHECK(bool(id));
- id->perform_action(install_action);
- }
-
- vdb_repo->invalidate();
-
- {
- TestMessageSuffix suffix("info", true);
- const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), make_null_shared_ptr(), { }))]->begin());
- TEST_CHECK(bool(id));
- id->perform_action(info_action);
- }
-
- {
- TestMessageSuffix suffix("config", true);
- const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), make_null_shared_ptr(), { }))]->begin());
- TEST_CHECK(bool(id));
- id->perform_action(config_action);
- }
-
- {
- TestMessageSuffix suffix("uninstall", true);
- const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), make_null_shared_ptr(), { }))]->begin());
- TEST_CHECK(bool(id));
- id->perform_action(uninstall_action);
- }
- }
- } test_phases_eapi_0("0"), test_phases_eapi_1("1"), test_phases_eapi_2("2"), test_phases_eapi_3("3"),
- test_phases_eapi_exheres_0("exheres-0");
+ vdb_repo->invalidate();
- struct VarsTest : TestCase
{
- const std::string eapi;
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(install_action);
+ }
- VarsTest(const std::string & e) :
- TestCase("vars eapi " + e),
- eapi(e)
- {
- }
+ vdb_repo->invalidate();
- unsigned max_run_time() const
- {
- return 3000;
- }
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(info_action);
+ }
- bool repeatable() const
- {
- return false;
- }
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(config_action);
+ }
- void run()
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(uninstall_action);
+ }
+}
+
+INSTANTIATE_TEST_CASE_P(Works, PhasesTest, testing::Values(
+ std::string("0"),
+ std::string("1"),
+ std::string("2"),
+ std::string("3"),
+ std::string("4"),
+ std::string("exheres-0")
+ ));
+
+namespace
+{
+ struct VarsTest :
+ testing::TestWithParam<std::string>
+ {
+ std::string eapi;
+
+ void SetUp()
{
- TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
- keys->insert("format", "e");
- keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "srcrepo"));
- keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "srcrepo/profiles/profile"));
- keys->insert("layout", "traditional");
- keys->insert("eapi_when_unknown", eapi);
- keys->insert("eapi_when_unspecified", eapi);
- keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "distdir"));
- keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "build"));
- keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
- std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
- std::bind(from_keys, keys, std::placeholders::_1)));
- env.add_repository(1, repo);
-
- keys = std::make_shared<Map<std::string, std::string>>();
- keys->insert("format", "vdb");
- keys->insert("names_cache", "/var/empty");
- keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "dstrepo"));
- keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "build"));
- keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
- std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
- std::bind(from_keys, keys, std::placeholders::_1)));
- env.add_repository(0, vdb_repo);
-
- InstallAction install_action(make_named_values<InstallActionOptions>(
- n::destination() = vdb_repo,
- n::make_output_manager() = &make_standard_output_manager,
- n::perform_uninstall() = &do_uninstall,
- n::replacing() = std::make_shared<PackageIDSequence>(),
- n::want_phase() = &want_all_phases
- ));
-
- UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
- n::config_protect() = "",
- n::if_for_install_id() = make_null_shared_ptr(),
- n::ignore_for_unmerge() = &ignore_nothing,
- n::is_overwrite() = false,
- n::make_output_manager() = &make_standard_output_manager
- ));
-
- InfoActionOptions info_action_options(make_named_values<InfoActionOptions>(
- n::make_output_manager() = &make_standard_output_manager
- ));
-
- ConfigActionOptions config_action_options(make_named_values<ConfigActionOptions>(
- n::make_output_manager() = &make_standard_output_manager
- ));
-
- InfoAction info_action(info_action_options);
- ConfigAction config_action(config_action_options);
-
- {
- TestMessageSuffix suffix("vars", true);
- const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
- &env, { })), make_null_shared_ptr(), { }))]->begin());
- TEST_CHECK(bool(id));
- id->perform_action(install_action);
- }
-
- vdb_repo->invalidate();
-
- {
- TestMessageSuffix suffix("reinstall", true);
- const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
- &env, { })), make_null_shared_ptr(), { }))]->begin());
- TEST_CHECK(bool(id));
- id->perform_action(install_action);
- }
-
- vdb_repo->invalidate();
-
- {
- TestMessageSuffix suffix("info", true);
- const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), make_null_shared_ptr(), { }))]->begin());
- TEST_CHECK(bool(id));
- id->perform_action(info_action);
- }
-
- {
- TestMessageSuffix suffix("config", true);
- const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), make_null_shared_ptr(), { }))]->begin());
- TEST_CHECK(bool(id));
- id->perform_action(config_action);
- }
-
- {
- TestMessageSuffix suffix("uninstall", true);
- const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), make_null_shared_ptr(), { }))]->begin());
- TEST_CHECK(bool(id));
- id->perform_action(uninstall_action);
- }
+ eapi = GetParam();
}
- } test_vdb_vars_eapi_0("0"), test_vdb_vars_eapi_1("1"), test_vdb_vars_eapi_2("2"),
- test_vdb_vars_eapi_exheres_0("exheres-0");
+ };
}
+TEST_P(VarsTest, Works)
+{
+ TestEnvironment env;
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
+ keys->insert("format", "e");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "srcrepo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "srcrepo/profiles/profile"));
+ keys->insert("layout", "traditional");
+ keys->insert("eapi_when_unknown", eapi);
+ keys->insert("eapi_when_unspecified", eapi);
+ keys->insert("profile_eapi", "0");
+ keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
+ std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
+ std::bind(from_keys, keys, std::placeholders::_1)));
+ env.add_repository(1, repo);
+
+ keys = std::make_shared<Map<std::string, std::string>>();
+ keys->insert("format", "vdb");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("provides_cache", "/var/empty");
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "dstrepo"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_eapis_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
+ std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
+ std::bind(from_keys, keys, std::placeholders::_1)));
+ env.add_repository(0, vdb_repo);
+
+ InstallAction install_action(make_named_values<InstallActionOptions>(
+ n::destination() = vdb_repo,
+ n::make_output_manager() = &make_standard_output_manager,
+ n::perform_uninstall() = &do_uninstall,
+ n::replacing() = std::make_shared<PackageIDSequence>(),
+ n::want_phase() = &want_all_phases
+ ));
+
+ UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
+ n::config_protect() = "",
+ n::if_for_install_id() = make_null_shared_ptr(),
+ n::ignore_for_unmerge() = &ignore_nothing,
+ n::is_overwrite() = false,
+ n::make_output_manager() = &make_standard_output_manager
+ ));
+
+ InfoActionOptions info_action_options(make_named_values<InfoActionOptions>(
+ n::make_output_manager() = &make_standard_output_manager
+ ));
+
+ ConfigActionOptions config_action_options(make_named_values<ConfigActionOptions>(
+ n::make_output_manager() = &make_standard_output_manager
+ ));
+
+ InfoAction info_action(info_action_options);
+ ConfigAction config_action(config_action_options);
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(install_action);
+ }
+
+ vdb_repo->invalidate();
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(install_action);
+ }
+
+ vdb_repo->invalidate();
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(info_action);
+ }
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(config_action);
+ }
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(uninstall_action);
+ }
+}
+
+INSTANTIATE_TEST_CASE_P(Works, VarsTest, testing::Values(
+ std::string("0"),
+ std::string("1"),
+ std::string("2"),
+ std::string("3"),
+ std::string("4"),
+ std::string("exheres-0")
+ ));
+
diff --git a/paludis/repositories/e/vdb_repository_TEST_eapis_setup.sh b/paludis/repositories/e/vdb_repository_TEST_eapis_setup.sh
index 9ccbd2a..e02c800 100755
--- a/paludis/repositories/e/vdb_repository_TEST_eapis_setup.sh
+++ b/paludis/repositories/e/vdb_repository_TEST_eapis_setup.sh
@@ -116,6 +116,31 @@ pkg_config() {
}
END
+cat <<'END' > srcrepo/cat/target/target-4.ebuild
+EAPI="4"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+DEPEND="foo/bar"
+S="${WORKDIR}"
+
+src_install() {
+ echo MONKEY > ${D}/monkey
+}
+
+pkg_info() {
+ echo "This is pkg_info"
+}
+
+pkg_config() {
+ echo "This is pkg_config"
+}
+END
+
cat <<'END' > srcrepo/cat/target-exheres/target-exheres-0.ebuild
EAPI="exheres-0"
DESCRIPTION="The Description"