summaryrefslogtreecommitdiffstats
path: root/tests/t-depends/Makefile
blob: 73c10eae85fb389d242368a0230a087fa4c0c795 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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