summaryrefslogtreecommitdiffstats
path: root/tests/t-depends/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:35:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:35:28 +0000
commitea314d2f45c40a006c0104157013ab4b857f665f (patch)
tree3ef2971cb3675c318b8d9effd987854ad3f6d3e8 /tests/t-depends/Makefile
parentInitial commit. (diff)
downloaddpkg-ea314d2f45c40a006c0104157013ab4b857f665f.tar.xz
dpkg-ea314d2f45c40a006c0104157013ab4b857f665f.zip
Adding upstream version 1.22.4.upstream/1.22.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/t-depends/Makefile83
1 files changed, 83 insertions, 0 deletions
diff --git a/tests/t-depends/Makefile b/tests/t-depends/Makefile
new file mode 100644
index 0000000..73c10ea
--- /dev/null
+++ b/tests/t-depends/Makefile
@@ -0,0 +1,83 @@
+TESTS_DEB := \
+ pkg-real pkg-depends \
+ pkg-version-1 pkg-version-2 pkg-version-3 pkg-depends-eq \
+ pkg-depends-lt pkg-depends-le pkg-depends-ge pkg-depends-gt
+
+include ../Test.mk
+
+test-depends:
+ # The dependency is not present, fail
+ ! $(DPKG_INSTALL) pkg-depends.deb
+ # Install the real package
+ $(DPKG_INSTALL) pkg-real.deb
+ # The dependency is present, pass
+ $(DPKG_INSTALL) pkg-depends.deb
+ # The dependency is removed, fail
+ ! $(DPKG_PURGE) pkg-real
+ # The depending package is removed, pass
+ $(DPKG_PURGE) pkg-depends
+ # The dependency is removed, pass
+ $(DPKG_PURGE) pkg-real
+ # Now try with --force-depends
+ $(DPKG_INSTALL) --force-depends pkg-depends.deb
+ $(DPKG_PURGE) pkg-depends
+
+define PURGE_DEPENDS
+$(DPKG_PURGE) pkg-depends-lt
+$(DPKG_PURGE) pkg-depends-le
+$(DPKG_PURGE) pkg-depends-eq
+$(DPKG_PURGE) pkg-depends-ge
+$(DPKG_PURGE) pkg-depends-gt
+endef
+
+test-depends-versioned:
+ $(PURGE_DEPENDS)
+
+ # The dependency is not present, fail
+ ! $(DPKG_INSTALL) pkg-depends-lt.deb
+ ! $(DPKG_INSTALL) pkg-depends-le.deb
+ ! $(DPKG_INSTALL) pkg-depends-eq.deb
+ ! $(DPKG_INSTALL) pkg-depends-ge.deb
+ ! $(DPKG_INSTALL) pkg-depends-gt.deb
+
+ # Install the package v1
+ $(DPKG_INSTALL) pkg-version-1.deb
+ $(DPKG_INSTALL) pkg-depends-lt.deb
+ $(DPKG_INSTALL) pkg-depends-le.deb
+ ! $(DPKG_INSTALL) pkg-depends-eq.deb
+ ! $(DPKG_INSTALL) pkg-depends-ge.deb
+ ! $(DPKG_INSTALL) pkg-depends-gt.deb
+
+ $(PURGE_DEPENDS)
+
+ # Install the package v2
+ $(DPKG_INSTALL) pkg-version-2.deb
+ ! $(DPKG_INSTALL) pkg-depends-lt.deb
+ $(DPKG_INSTALL) pkg-depends-le.deb
+ $(DPKG_INSTALL) pkg-depends-eq.deb
+ $(DPKG_INSTALL) pkg-depends-ge.deb
+ ! $(DPKG_INSTALL) pkg-depends-gt.deb
+
+ $(PURGE_DEPENDS)
+
+ # Install the package v3
+ $(DPKG_INSTALL) pkg-version-3.deb
+ ! $(DPKG_INSTALL) pkg-depends-lt.deb
+ ! $(DPKG_INSTALL) pkg-depends-le.deb
+ ! $(DPKG_INSTALL) pkg-depends-eq.deb
+ $(DPKG_INSTALL) pkg-depends-ge.deb
+ $(DPKG_INSTALL) pkg-depends-gt.deb
+
+ $(PURGE_DEPENDS)
+
+test-case: test-depends test-depends-versioned
+
+test-clean:
+ -$(DPKG_PURGE) pkg-depends
+ -$(DPKG_PURGE) pkg-real
+ -$(DPKG_PURGE) pkg-depends-lt
+ -$(DPKG_PURGE) pkg-depends-le
+ -$(DPKG_PURGE) pkg-depends-eq
+ -$(DPKG_PURGE) pkg-depends-ge
+ -$(DPKG_PURGE) pkg-depends-gt
+ -$(DPKG_PURGE) pkg-version