From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7EE4F15800F for ; Sun, 19 Feb 2023 19:19:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C4EA5E0874; Sun, 19 Feb 2023 19:19:50 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A844DE0874 for ; Sun, 19 Feb 2023 19:19:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C1EC1340F28 for ; Sun, 19 Feb 2023 19:19:49 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2822A8AA for ; Sun, 19 Feb 2023 19:19:48 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1676834384.996babb5aa005edef4abb86de1dc585d630ac21d.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/tests/resolver/test_eapi.py X-VCS-Directories: lib/portage/tests/resolver/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 996babb5aa005edef4abb86de1dc585d630ac21d X-VCS-Branch: master Date: Sun, 19 Feb 2023 19:19:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: db958f69-3ed2-4c42-b6e1-701840a5311a X-Archives-Hash: 55ca42b7d90019d9774f0c328b737894 commit: 996babb5aa005edef4abb86de1dc585d630ac21d Author: Sam James gentoo org> AuthorDate: Sat Feb 18 13:26:47 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sun Feb 19 19:19:44 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=996babb5 tests: resolver: add basic BDEPEND + IDEPEND tests These aren't very interesting but they at least check that BDEPEND/IDEPEND affect dependency resolution. I started to look at testing --with-bdeps but got into the weeds. Signed-off-by: Sam James gentoo.org> lib/portage/tests/resolver/test_eapi.py | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/lib/portage/tests/resolver/test_eapi.py b/lib/portage/tests/resolver/test_eapi.py index 1d6c58633..5d425ccdb 100644 --- a/lib/portage/tests/resolver/test_eapi.py +++ b/lib/portage/tests/resolver/test_eapi.py @@ -185,3 +185,46 @@ class EAPITestCase(TestCase): self.assertEqual(test_case.test_success, True, test_case.fail_msg) finally: playground.cleanup() + + def testBdepend(self): + ebuilds = { + "dev-libs/A-1.0": {"EAPI": 7}, + "dev-libs/B-1.0": {"EAPI": 7, "BDEPEND": "dev-libs/A"}, + } + + # Verify that BDEPEND is considered at all. + test_case = ResolverPlaygroundTestCase( + ["=dev-libs/B-1.0"], + success=True, + mergelist=["dev-libs/A-1.0", "dev-libs/B-1.0"], + ) + + playground = ResolverPlayground(ebuilds=ebuilds, debug=True) + try: + playground.run_TestCase(test_case) + self.assertEqual(test_case.test_success, True, test_case.fail_msg) + finally: + playground.cleanup() + + def testIdepend(self): + ebuilds = { + "dev-libs/A-1.0": {"EAPI": 8}, + "dev-libs/B-1.0": {"EAPI": 8, "IDEPEND": "dev-libs/A"}, + } + + test_cases = ( + # Verify that IDEPEND is considered at all. + ResolverPlaygroundTestCase( + ["=dev-libs/B-1.0"], + success=True, + mergelist=["dev-libs/A-1.0", "dev-libs/B-1.0"], + ), + ) + + playground = ResolverPlayground(ebuilds=ebuilds) + try: + for test_case in test_cases: + playground.run_TestCase(test_case) + self.assertEqual(test_case.test_success, True, test_case.fail_msg) + finally: + playground.cleanup()