diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-10-03 19:38:40 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-10-03 19:38:40 +0100 |
commit | 15eab57c6fc807420ed6a9cfc5b672de4b3d3e20 (patch) | |
tree | 5d5e7f23ea5fa1ccd7460c00014459b42005eadc | |
parent | Fix changes to libtidy interface (diff) | |
download | gentoobrowse-api-15eab57c6fc807420ed6a9cfc5b672de4b3d3e20.tar.bz2 gentoobrowse-api-15eab57c6fc807420ed6a9cfc5b672de4b3d3e20.tar.xz gentoobrowse-api-15eab57c6fc807420ed6a9cfc5b672de4b3d3e20.zip |
Only run testRefreshGitRepository if non-shallow portage repo is available
-rw-r--r-- | gentoobrowse-api/unittests/testMaintenance.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gentoobrowse-api/unittests/testMaintenance.cpp b/gentoobrowse-api/unittests/testMaintenance.cpp index 19ed59a..c287b1e 100644 --- a/gentoobrowse-api/unittests/testMaintenance.cpp +++ b/gentoobrowse-api/unittests/testMaintenance.cpp @@ -275,7 +275,14 @@ BOOST_AUTO_TEST_CASE(testUpdateGitRepository) BOOST_REQUIRE(std::filesystem::is_regular_file(testRepo / "net-misc" / "gentoobrowse-api" / "Manifest")); } -BOOST_AUTO_TEST_CASE(testRefreshGitRepository) +struct localPortageRepoIsComplete { + boost::test_tools::assertion_result operator()(boost::unit_test::test_unit_id) const + { + return !std::filesystem::exists("/usr/portage/.git/shallow"); + } +}; + +BOOST_AUTO_TEST_CASE(testRefreshGitRepository, *boost::unit_test::precondition(localPortageRepoIsComplete {})) { auto db = DB::ConnectionPtr(DB::MockDatabase::openConnectionTo("GentooBrowseAPI")); auto insRepo = db->modify( |