diff options
Diffstat (limited to '')
-rw-r--r-- | t/cppcheck.t | 1 | ||||
-rw-r--r-- | t/pod-spell.t | 3 | ||||
-rw-r--r-- | t/shellcheck.t | 2 | ||||
-rw-r--r-- | tests/README | 5 | ||||
-rw-r--r-- | tests/Test.mk | 3 | ||||
-rw-r--r-- | tests/t-db/Makefile | 10 | ||||
-rw-r--r-- | tests/t-db/db-bogus-versioned-provides-update/status | 10 | ||||
-rw-r--r-- | tests/t-db/db-bogus-versioned-provides-update/updates/.keep | 0 | ||||
-rw-r--r-- | tests/t-db/db-bogus-versioned-provides-update/updates/0001 | 10 | ||||
-rw-r--r-- | tests/t-db/db-bogus-versioned-provides/status | 21 | ||||
-rw-r--r-- | tests/t-db/db-bogus-versioned-provides/updates/.keep | 0 | ||||
-rw-r--r-- | tests/t-provides/Makefile | 15 | ||||
-rw-r--r-- | tests/t-provides/pkg-provides-bogus/DEBIAN/control | 8 |
13 files changed, 85 insertions, 3 deletions
diff --git a/t/cppcheck.t b/t/cppcheck.t index 28d420f..f70cf3e 100644 --- a/t/cppcheck.t +++ b/t/cppcheck.t @@ -32,6 +32,7 @@ my @cppcheck_opts = (qw( --force --error-exitcode=2 --inline-suppr + --check-level=exhaustive --suppressions-list=t/cppcheck/cppcheck.supp --std=c99 --std=c++03 -Ilib diff --git a/t/pod-spell.t b/t/pod-spell.t index 5edaa64..1a1842d 100644 --- a/t/pod-spell.t +++ b/t/pod-spell.t @@ -51,8 +51,10 @@ ORed OpenPGP RCS XDG +ar archqual backport +build-indep buildinfo bzip2 bzr @@ -60,6 +62,7 @@ canonicalized checksum checksums cmdline +ctrl debian decompressor dep diff --git a/t/shellcheck.t b/t/shellcheck.t index 6afc1fb..046bbb3 100644 --- a/t/shellcheck.t +++ b/t/shellcheck.t @@ -34,6 +34,7 @@ my @todofiles = qw( my @files = qw( autogen build-aux/gen-release + build-aux/get-vcs-id build-aux/get-version build-aux/run-script debian/dpkg.cron.daily @@ -41,7 +42,6 @@ my @files = qw( src/dpkg-db-backup.sh src/dpkg-db-keeper.sh src/dpkg-maintscript-helper.sh - src/dpkg-realpath.sh ); my @shellcheck_opts = ( '--external-sources', # Allow checking external source files. diff --git a/tests/README b/tests/README index 3da99ab..a6592a4 100644 --- a/tests/README +++ b/tests/README @@ -10,7 +10,10 @@ You probably want to use something like eatmydata to run the tests, it affects the performance significantly. To test the tools from the dpkg build-tree, use the «test» target. If you -want instead to test the installed programs use the «installtest» target +want instead to test the installed programs use the «installtest» target. + +To test with the compiler sanitizer «configure ---enable-compiler-sanitizer», +and run the tests normally. The DPKG_TESTSUITE_OPTIONS environment/make variable can be used to change the behavior of the test runs, the following options are currently diff --git a/tests/Test.mk b/tests/Test.mk index 3c020af..a830d5d 100644 --- a/tests/Test.mk +++ b/tests/Test.mk @@ -27,6 +27,9 @@ DPKG_ENV = \ # eatmydata confuses ASAN link order check. export ASAN_OPTIONS = verify_asan_link_order=0 +# Do not fail due to leaks, as the code is still using lots of +# static variables and error variables. +export LSAN_OPTIONS = exitcode=0 ifdef DPKG_BUILDTREE export DPKG_DATADIR := $(DPKG_BUILDTREE)/src diff --git a/tests/t-db/Makefile b/tests/t-db/Makefile index 2e5b621..a64e28c 100644 --- a/tests/t-db/Makefile +++ b/tests/t-db/Makefile @@ -16,6 +16,8 @@ TEST_CASES += test-bogus-dupe-same-single TEST_CASES += test-bogus-dupe-diff-single TEST_CASES += test-bogus-multi TEST_CASES += test-bogus-multi-update +TEST_CASES += test-bogus-versioned-provides +TEST_CASES += test-bogus-versioned-provides-update test-case: $(TEST_CASES) @@ -58,3 +60,11 @@ test-bogus-multi: test-bogus-multi-update: override DPKG_ADMINDIR = db-bogus-multi-update test-bogus-multi-update: $(call stderr_has,$(PKG_TUPLE),error) + +test-bogus-versioned-provides: override DPKG_ADMINDIR = db-bogus-versioned-provides +test-bogus-versioned-provides: + $(call stderr_has,$(PKG_TUPLE),warning) + +test-bogus-versioned-provides-update: override DPKG_ADMINDIR = db-bogus-versioned-provides-update +test-bogus-versioned-provides-update: + $(call stderr_has,$(PKG_TUPLE),warning) diff --git a/tests/t-db/db-bogus-versioned-provides-update/status b/tests/t-db/db-bogus-versioned-provides-update/status new file mode 100644 index 0000000..ce0b2eb --- /dev/null +++ b/tests/t-db/db-bogus-versioned-provides-update/status @@ -0,0 +1,10 @@ +Package: pkg-correct-versioned-provides +Status: install ok installed +Priority: extra +Section: test +Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org> +Architecture: amd64 +Version: 1.0 +Provides: pkg-correct (= 1.0) +Description: test package + Correct versioned Provides with equal operator. diff --git a/tests/t-db/db-bogus-versioned-provides-update/updates/.keep b/tests/t-db/db-bogus-versioned-provides-update/updates/.keep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/t-db/db-bogus-versioned-provides-update/updates/.keep diff --git a/tests/t-db/db-bogus-versioned-provides-update/updates/0001 b/tests/t-db/db-bogus-versioned-provides-update/updates/0001 new file mode 100644 index 0000000..4851dfb --- /dev/null +++ b/tests/t-db/db-bogus-versioned-provides-update/updates/0001 @@ -0,0 +1,10 @@ +Package: pkg-bogus-versioned-provides +Status: install ok installed +Priority: extra +Section: test +Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org> +Architecture: amd64 +Version: 1.0 +Provides: pkg-bogus (>= 1.0) +Description: test package + Bogus versioned provides with non-equal operator. diff --git a/tests/t-db/db-bogus-versioned-provides/status b/tests/t-db/db-bogus-versioned-provides/status new file mode 100644 index 0000000..bd3858c --- /dev/null +++ b/tests/t-db/db-bogus-versioned-provides/status @@ -0,0 +1,21 @@ +Package: pkg-bogus-versioned-provides +Status: install ok installed +Priority: extra +Section: test +Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org> +Architecture: amd64 +Version: 1.0 +Provides: pkg-bogus (>= 1.0) +Description: test package + Bogus versioned provides with non-equal operator. + +Package: pkg-correct-versioned-provides +Status: install ok installed +Priority: extra +Section: test +Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org> +Architecture: amd64 +Version: 1.0 +Provides: pkg-correct (= 1.0) +Description: test package + Correct versioned Provides with equal operator. diff --git a/tests/t-db/db-bogus-versioned-provides/updates/.keep b/tests/t-db/db-bogus-versioned-provides/updates/.keep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/t-db/db-bogus-versioned-provides/updates/.keep diff --git a/tests/t-provides/Makefile b/tests/t-provides/Makefile index 6794c20..76e3073 100644 --- a/tests/t-provides/Makefile +++ b/tests/t-provides/Makefile @@ -8,6 +8,17 @@ TESTS_DEB := \ include ../Test.mk +test-bogus: + # test building with bogus provides + ! $(DPKG_BUILD_DEB) pkg-provides-bogus + + # build bogus packages + $(DPKG_BUILD_DEB) --nocheck pkg-provides-bogus + + # test installing packages with bogus provides + ! $(DPKG_INSTALL) pkg-provides-bogus.deb + $(call pkg_is_not_installed,pkg-provides-bogus) + define PURGE_DEPENDS $(DPKG_PURGE) pkg-depends $(DPKG_PURGE) pkg-depends-le @@ -282,7 +293,7 @@ test-conflicts: # The provided predependency is removed, pass $(DPKG_PURGE) pkg-provides -test-case: test-depends test-predepends test-breaks test-conflicts +test-case: test-bogus test-depends test-predepends test-breaks test-conflicts test-clean: -$(DPKG_PURGE) pkg-depends @@ -305,3 +316,5 @@ test-clean: -$(DPKG_PURGE) pkg-a-depends-ge-lt -$(DPKG_PURGE) pkg-b-provides -$(DPKG_PURGE) pkg-c-provides + + rm -f pkg-provides-bogus.deb diff --git a/tests/t-provides/pkg-provides-bogus/DEBIAN/control b/tests/t-provides/pkg-provides-bogus/DEBIAN/control new file mode 100644 index 0000000..a64ab77 --- /dev/null +++ b/tests/t-provides/pkg-provides-bogus/DEBIAN/control @@ -0,0 +1,8 @@ +Package: pkg-provides-bogus +Version: 0 +Section: test +Priority: extra +Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org> +Architecture: all +Provides: pkg-virtual-bogus (>= 1.0) +Description: test package - package providing a bogus virtual package |