Split the wine helper into it's own package.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class ArchPkgbuildOptionalWineTests(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
repository = Path(__file__).resolve().parents[1]
|
||||
cls.pkgbuilds = [
|
||||
repository / "distro-packages" / "Arch-Linux" / name / "PKGBUILD"
|
||||
for name in ("cthulhu", "cthulhu-git")
|
||||
]
|
||||
cls.helperPkgbuilds = [
|
||||
repository / "distro-packages" / "Arch-Linux" / name / "PKGBUILD"
|
||||
for name in ("cthulhu-wine-access", "cthulhu-wine-access-git")
|
||||
]
|
||||
|
||||
def test_main_packages_disable_wine_helper_build(self):
|
||||
for pkgbuild in self.pkgbuilds:
|
||||
with self.subTest(pkgbuild=pkgbuild):
|
||||
contents = pkgbuild.read_text(encoding="utf-8")
|
||||
self.assertIn("-Dwine-access=disabled", contents)
|
||||
|
||||
def test_main_packages_do_not_depend_on_wine(self):
|
||||
for pkgbuild in self.pkgbuilds:
|
||||
with self.subTest(pkgbuild=pkgbuild):
|
||||
contents = pkgbuild.read_text(encoding="utf-8")
|
||||
dependencySection = contents.split("source=(", 1)[0]
|
||||
dependencyLines = {
|
||||
line.strip().strip("'")
|
||||
for line in dependencySection.splitlines()
|
||||
if line.strip() and not line.lstrip().startswith("#")
|
||||
}
|
||||
self.assertNotIn("wine", dependencyLines)
|
||||
|
||||
def test_optional_helper_packages_own_the_wine_dependency(self):
|
||||
for pkgbuild in self.helperPkgbuilds:
|
||||
with self.subTest(pkgbuild=pkgbuild):
|
||||
contents = pkgbuild.read_text(encoding="utf-8")
|
||||
self.assertIn("-Dwine-access=enabled", contents)
|
||||
self.assertRegex(contents, r"(?m)^ wine$")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user