From cf9383412494964d6188fcf08a362c0c0f313afc Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 26 Nov 2019 14:11:14 +0300 Subject: Import perl (5.30.0-9) --- debian/tests/README | 15 ++++++++++++++ debian/tests/compression | 30 +++++++++++++++++++++++++++ debian/tests/control | 31 ++++++++++++++++++++++++++++ debian/tests/data/README | 13 ++++++++++++ debian/tests/data/amd64/buster-ndbm.dir | Bin 0 -> 16 bytes debian/tests/data/amd64/buster-ndbm.pag | Bin 0 -> 16384 bytes debian/tests/data/amd64/buster.gdbm | Bin 0 -> 16384 bytes debian/tests/data/amd64/jessie-ndbm.pag | Bin 0 -> 12300 bytes debian/tests/data/amd64/jessie.gdbm | Bin 0 -> 12300 bytes debian/tests/data/amd64/stretch-ndbm.pag | Bin 0 -> 12301 bytes debian/tests/data/amd64/stretch.gdbm | Bin 0 -> 12301 bytes debian/tests/data/arm64/buster-ndbm.dir | Bin 0 -> 16 bytes debian/tests/data/arm64/buster-ndbm.pag | Bin 0 -> 16384 bytes debian/tests/data/arm64/buster.gdbm | Bin 0 -> 16384 bytes debian/tests/data/arm64/stretch-ndbm.pag | Bin 0 -> 12306 bytes debian/tests/data/arm64/stretch.gdbm | Bin 0 -> 12301 bytes debian/tests/data/armhf/buster-ndbm.dir | Bin 0 -> 16 bytes debian/tests/data/armhf/buster-ndbm.pag | Bin 0 -> 16384 bytes debian/tests/data/armhf/buster.gdbm | Bin 0 -> 16384 bytes debian/tests/data/buster.bz2 | Bin 0 -> 52 bytes debian/tests/data/buster.db | Bin 0 -> 12288 bytes debian/tests/data/buster.gz | Bin 0 -> 30 bytes debian/tests/data/buster.storable | Bin 0 -> 29 bytes debian/tests/data/i386/buster-ndbm.dir | Bin 0 -> 16 bytes debian/tests/data/i386/buster-ndbm.pag | Bin 0 -> 16384 bytes debian/tests/data/i386/buster.gdbm | Bin 0 -> 16384 bytes debian/tests/data/jessie.bz2 | Bin 0 -> 51 bytes debian/tests/data/jessie.db | Bin 0 -> 12288 bytes debian/tests/data/jessie.gz | Bin 0 -> 30 bytes debian/tests/data/jessie.storable | Bin 0 -> 29 bytes debian/tests/data/ppc64el/buster-ndbm.dir | Bin 0 -> 16 bytes debian/tests/data/ppc64el/buster-ndbm.pag | Bin 0 -> 16384 bytes debian/tests/data/ppc64el/buster.gdbm | Bin 0 -> 16384 bytes debian/tests/data/ppc64el/stretch-ndbm.pag | Bin 0 -> 12306 bytes debian/tests/data/ppc64el/stretch.gdbm | Bin 0 -> 12301 bytes debian/tests/data/s390x/buster-ndbm.dir | Bin 0 -> 16 bytes debian/tests/data/s390x/buster-ndbm.pag | Bin 0 -> 16384 bytes debian/tests/data/s390x/buster.gdbm | Bin 0 -> 16384 bytes debian/tests/data/s390x/stretch-ndbm.pag | Bin 0 -> 12306 bytes debian/tests/data/s390x/stretch.gdbm | Bin 0 -> 12301 bytes debian/tests/data/stretch.bz2 | Bin 0 -> 53 bytes debian/tests/data/stretch.db | Bin 0 -> 12288 bytes debian/tests/data/stretch.gz | Bin 0 -> 31 bytes debian/tests/data/stretch.storable | Bin 0 -> 30 bytes debian/tests/db | 29 ++++++++++++++++++++++++++ debian/tests/embed | 31 ++++++++++++++++++++++++++++ debian/tests/gdbm | 32 +++++++++++++++++++++++++++++ debian/tests/hello | 6 ++++++ debian/tests/ndbm | 25 ++++++++++++++++++++++ debian/tests/perl-base-self-contained | 5 +++++ debian/tests/pkg-perl/syntax-skip | 8 ++++++++ debian/tests/storable | 9 ++++++++ debian/tests/verify-configure | 5 +++++ 53 files changed, 239 insertions(+) create mode 100644 debian/tests/README create mode 100755 debian/tests/compression create mode 100644 debian/tests/control create mode 100644 debian/tests/data/README create mode 100644 debian/tests/data/amd64/buster-ndbm.dir create mode 100644 debian/tests/data/amd64/buster-ndbm.pag create mode 100644 debian/tests/data/amd64/buster.gdbm create mode 100644 debian/tests/data/amd64/jessie-ndbm.pag create mode 100644 debian/tests/data/amd64/jessie.gdbm create mode 100644 debian/tests/data/amd64/stretch-ndbm.pag create mode 100644 debian/tests/data/amd64/stretch.gdbm create mode 100644 debian/tests/data/arm64/buster-ndbm.dir create mode 100644 debian/tests/data/arm64/buster-ndbm.pag create mode 100644 debian/tests/data/arm64/buster.gdbm create mode 100644 debian/tests/data/arm64/stretch-ndbm.pag create mode 100644 debian/tests/data/arm64/stretch.gdbm create mode 100644 debian/tests/data/armhf/buster-ndbm.dir create mode 100644 debian/tests/data/armhf/buster-ndbm.pag create mode 100644 debian/tests/data/armhf/buster.gdbm create mode 100644 debian/tests/data/buster.bz2 create mode 100644 debian/tests/data/buster.db create mode 100644 debian/tests/data/buster.gz create mode 100644 debian/tests/data/buster.storable create mode 100644 debian/tests/data/i386/buster-ndbm.dir create mode 100644 debian/tests/data/i386/buster-ndbm.pag create mode 100644 debian/tests/data/i386/buster.gdbm create mode 100644 debian/tests/data/jessie.bz2 create mode 100644 debian/tests/data/jessie.db create mode 100644 debian/tests/data/jessie.gz create mode 100644 debian/tests/data/jessie.storable create mode 100644 debian/tests/data/ppc64el/buster-ndbm.dir create mode 100644 debian/tests/data/ppc64el/buster-ndbm.pag create mode 100644 debian/tests/data/ppc64el/buster.gdbm create mode 100644 debian/tests/data/ppc64el/stretch-ndbm.pag create mode 100644 debian/tests/data/ppc64el/stretch.gdbm create mode 100644 debian/tests/data/s390x/buster-ndbm.dir create mode 100644 debian/tests/data/s390x/buster-ndbm.pag create mode 100644 debian/tests/data/s390x/buster.gdbm create mode 100644 debian/tests/data/s390x/stretch-ndbm.pag create mode 100644 debian/tests/data/s390x/stretch.gdbm create mode 100644 debian/tests/data/stretch.bz2 create mode 100644 debian/tests/data/stretch.db create mode 100644 debian/tests/data/stretch.gz create mode 100644 debian/tests/data/stretch.storable create mode 100755 debian/tests/db create mode 100755 debian/tests/embed create mode 100755 debian/tests/gdbm create mode 100755 debian/tests/hello create mode 100755 debian/tests/ndbm create mode 100755 debian/tests/perl-base-self-contained create mode 100644 debian/tests/pkg-perl/syntax-skip create mode 100755 debian/tests/storable create mode 100755 debian/tests/verify-configure (limited to 'debian/tests') diff --git a/debian/tests/README b/debian/tests/README new file mode 100644 index 0000000..8f363cd --- /dev/null +++ b/debian/tests/README @@ -0,0 +1,15 @@ +This directory holds rudimentary autopkgtest regression checks for +src:perl. We mostly test backwards compatibility with things like reading +in old binary files (zlib, Berkeley DB etc.) and making sure we can still +retrieve their contents. + +We also run an existing maintainer test for checking the status of +separately packaged dual life modules in the archive. This is expected +to regress when somebody e.g. packages a new dual life module, and +the fix is to add corresponding Breaks/Provides/Replaces or special +case it in the test. + +This is work in progress, and suggestions for further tests are very +welcome. + + -- Niko Tyni Fri, 18 May 2018 16:45:10 +0300 diff --git a/debian/tests/compression b/debian/tests/compression new file mode 100755 index 0000000..8835ee9 --- /dev/null +++ b/debian/tests/compression @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +DATA=debian/tests/data + +echo "testing gz uncompression..." +msg="gz uncompressed OK" +echo "$msg" | gzip -c | perl -MIO::Uncompress::Gunzip=gunzip -e 'gunzip \*STDIN => \*STDOUT' | grep "$msg" + +for f in $DATA/*.gz; do + < $f perl -MIO::Uncompress::Gunzip=gunzip -e 'gunzip \*STDIN => \*STDOUT' | grep OK +done + +echo "testing gz compression..." +msg="gz compressed OK" +echo "$msg" | perl -MIO::Compress::Gzip=gzip -e 'gzip \*STDIN => \*STDOUT' | gzip -dc | grep "$msg" + +echo "testing bz2 uncompression" +msg="bz2 uncompressed OK" +echo "$msg" | bzip2 -c | perl -MIO::Uncompress::Bunzip2=bunzip2 -e 'bunzip2 \*STDIN => \*STDOUT' | grep "$msg" + +for f in $DATA/*.bz2; do + < $f perl -MIO::Uncompress::Bunzip2=bunzip2 -e 'bunzip2 \*STDIN => \*STDOUT' | grep OK +done + +echo "testing bz2 compression..." +msg="bz2 compressed OK" +echo "$msg" | perl -MIO::Compress::Bzip2=bzip2 -e 'bzip2 \*STDIN => \*STDOUT' | bzip2 -dc | grep "$msg" + diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..156871b --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,31 @@ +Tests: hello +Depends: perl-base + +Tests: perl-base-self-contained +Depends: perl-base + +Tests: compression db gdbm ndbm storable +Depends: perl, db-util, gdbmtool +Restrictions: skippable + +Tests: embed +Depends: libperl-dev, build-essential +Restrictions: allow-stderr + +Test-Command: prove debian/t/control.t +Depends: perl, libapt-pkg-perl +Features: test-name=control +Restrictions: skip-not-installable + +Test-Command: prove debian/t/released-versions.t +Depends: perl, dpkg-dev +Features: test-name=released_versions + +Test-Command: /usr/share/pkg-perl-autopkgtest/runtime-deps-and-recommends.d/syntax.t +Depends: @, pkg-perl-autopkgtest +Restrictions: allow-stderr +Features: test-name=syntax + +Tests: verify-configure +Depends: dist (>= 3.5-236), build-essential, cpio +Restrictions: superficial, allow-stderr diff --git a/debian/tests/data/README b/debian/tests/data/README new file mode 100644 index 0000000..919bc8b --- /dev/null +++ b/debian/tests/data/README @@ -0,0 +1,13 @@ +Commands to regenerate these files, to be run in corresponding chroots + +# echo stretch OK | gzip -c > stretch.gz + +# echo stretch OK | bzip2 -c > stretch.bz2 + +# perl -MDB_File -e '$d = shift; tie %h, q(DB_File), "$d.db", O_WRONLY|O_CREAT , 0640 or die "opening DB file failed: $!"; $h{foo} = "$d OK"; untie %h' stretch + +# perl -MGDBM_File -e '$d = shift; tie %h, q(GDBM_File), "$d.gdbm", &GDBM_WRCREAT, 0640 or die "opening GDBM file failed: $!"; $h{foo} = "$d OK"; untie %h' stretch + +# perl -MFcntl -MNDBM_File -e '$d = shift; tie %h, q(NDBM_File), "$d", O_RDWR|O_CREAT, 0640 or die "opening NDBM file failed: $!"; $h{foo} = "$d OK"; untie %h' stretch + +# perl -MStorable=nstore -e '$d=shift; $h{foo}="$d OK"; nstore \%h, "$d.storable"' stretch diff --git a/debian/tests/data/amd64/buster-ndbm.dir b/debian/tests/data/amd64/buster-ndbm.dir new file mode 100644 index 0000000..24248ad Binary files /dev/null and b/debian/tests/data/amd64/buster-ndbm.dir differ diff --git a/debian/tests/data/amd64/buster-ndbm.pag b/debian/tests/data/amd64/buster-ndbm.pag new file mode 100644 index 0000000..b07fcc3 Binary files /dev/null and b/debian/tests/data/amd64/buster-ndbm.pag differ diff --git a/debian/tests/data/amd64/buster.gdbm b/debian/tests/data/amd64/buster.gdbm new file mode 100644 index 0000000..b07fcc3 Binary files /dev/null and b/debian/tests/data/amd64/buster.gdbm differ diff --git a/debian/tests/data/amd64/jessie-ndbm.pag b/debian/tests/data/amd64/jessie-ndbm.pag new file mode 100644 index 0000000..0f7d7de Binary files /dev/null and b/debian/tests/data/amd64/jessie-ndbm.pag differ diff --git a/debian/tests/data/amd64/jessie.gdbm b/debian/tests/data/amd64/jessie.gdbm new file mode 100644 index 0000000..0f7d7de Binary files /dev/null and b/debian/tests/data/amd64/jessie.gdbm differ diff --git a/debian/tests/data/amd64/stretch-ndbm.pag b/debian/tests/data/amd64/stretch-ndbm.pag new file mode 100644 index 0000000..3e61e28 Binary files /dev/null and b/debian/tests/data/amd64/stretch-ndbm.pag differ diff --git a/debian/tests/data/amd64/stretch.gdbm b/debian/tests/data/amd64/stretch.gdbm new file mode 100644 index 0000000..3e61e28 Binary files /dev/null and b/debian/tests/data/amd64/stretch.gdbm differ diff --git a/debian/tests/data/arm64/buster-ndbm.dir b/debian/tests/data/arm64/buster-ndbm.dir new file mode 100644 index 0000000..24248ad Binary files /dev/null and b/debian/tests/data/arm64/buster-ndbm.dir differ diff --git a/debian/tests/data/arm64/buster-ndbm.pag b/debian/tests/data/arm64/buster-ndbm.pag new file mode 100644 index 0000000..adf279f Binary files /dev/null and b/debian/tests/data/arm64/buster-ndbm.pag differ diff --git a/debian/tests/data/arm64/buster.gdbm b/debian/tests/data/arm64/buster.gdbm new file mode 100644 index 0000000..b07fcc3 Binary files /dev/null and b/debian/tests/data/arm64/buster.gdbm differ diff --git a/debian/tests/data/arm64/stretch-ndbm.pag b/debian/tests/data/arm64/stretch-ndbm.pag new file mode 100644 index 0000000..4664e2d Binary files /dev/null and b/debian/tests/data/arm64/stretch-ndbm.pag differ diff --git a/debian/tests/data/arm64/stretch.gdbm b/debian/tests/data/arm64/stretch.gdbm new file mode 100644 index 0000000..3e61e28 Binary files /dev/null and b/debian/tests/data/arm64/stretch.gdbm differ diff --git a/debian/tests/data/armhf/buster-ndbm.dir b/debian/tests/data/armhf/buster-ndbm.dir new file mode 100644 index 0000000..24248ad Binary files /dev/null and b/debian/tests/data/armhf/buster-ndbm.dir differ diff --git a/debian/tests/data/armhf/buster-ndbm.pag b/debian/tests/data/armhf/buster-ndbm.pag new file mode 100644 index 0000000..13f5f78 Binary files /dev/null and b/debian/tests/data/armhf/buster-ndbm.pag differ diff --git a/debian/tests/data/armhf/buster.gdbm b/debian/tests/data/armhf/buster.gdbm new file mode 100644 index 0000000..30c961b Binary files /dev/null and b/debian/tests/data/armhf/buster.gdbm differ diff --git a/debian/tests/data/buster.bz2 b/debian/tests/data/buster.bz2 new file mode 100644 index 0000000..16d0718 Binary files /dev/null and b/debian/tests/data/buster.bz2 differ diff --git a/debian/tests/data/buster.db b/debian/tests/data/buster.db new file mode 100644 index 0000000..c90e829 Binary files /dev/null and b/debian/tests/data/buster.db differ diff --git a/debian/tests/data/buster.gz b/debian/tests/data/buster.gz new file mode 100644 index 0000000..a7d41ea Binary files /dev/null and b/debian/tests/data/buster.gz differ diff --git a/debian/tests/data/buster.storable b/debian/tests/data/buster.storable new file mode 100644 index 0000000..f998743 Binary files /dev/null and b/debian/tests/data/buster.storable differ diff --git a/debian/tests/data/i386/buster-ndbm.dir b/debian/tests/data/i386/buster-ndbm.dir new file mode 100644 index 0000000..24248ad Binary files /dev/null and b/debian/tests/data/i386/buster-ndbm.dir differ diff --git a/debian/tests/data/i386/buster-ndbm.pag b/debian/tests/data/i386/buster-ndbm.pag new file mode 100644 index 0000000..1402b6b Binary files /dev/null and b/debian/tests/data/i386/buster-ndbm.pag differ diff --git a/debian/tests/data/i386/buster.gdbm b/debian/tests/data/i386/buster.gdbm new file mode 100644 index 0000000..1402b6b Binary files /dev/null and b/debian/tests/data/i386/buster.gdbm differ diff --git a/debian/tests/data/jessie.bz2 b/debian/tests/data/jessie.bz2 new file mode 100644 index 0000000..1859cf2 Binary files /dev/null and b/debian/tests/data/jessie.bz2 differ diff --git a/debian/tests/data/jessie.db b/debian/tests/data/jessie.db new file mode 100644 index 0000000..cb0a259 Binary files /dev/null and b/debian/tests/data/jessie.db differ diff --git a/debian/tests/data/jessie.gz b/debian/tests/data/jessie.gz new file mode 100644 index 0000000..6bdde05 Binary files /dev/null and b/debian/tests/data/jessie.gz differ diff --git a/debian/tests/data/jessie.storable b/debian/tests/data/jessie.storable new file mode 100644 index 0000000..2f6c693 Binary files /dev/null and b/debian/tests/data/jessie.storable differ diff --git a/debian/tests/data/ppc64el/buster-ndbm.dir b/debian/tests/data/ppc64el/buster-ndbm.dir new file mode 100644 index 0000000..24248ad Binary files /dev/null and b/debian/tests/data/ppc64el/buster-ndbm.dir differ diff --git a/debian/tests/data/ppc64el/buster-ndbm.pag b/debian/tests/data/ppc64el/buster-ndbm.pag new file mode 100644 index 0000000..adf279f Binary files /dev/null and b/debian/tests/data/ppc64el/buster-ndbm.pag differ diff --git a/debian/tests/data/ppc64el/buster.gdbm b/debian/tests/data/ppc64el/buster.gdbm new file mode 100644 index 0000000..b07fcc3 Binary files /dev/null and b/debian/tests/data/ppc64el/buster.gdbm differ diff --git a/debian/tests/data/ppc64el/stretch-ndbm.pag b/debian/tests/data/ppc64el/stretch-ndbm.pag new file mode 100644 index 0000000..4664e2d Binary files /dev/null and b/debian/tests/data/ppc64el/stretch-ndbm.pag differ diff --git a/debian/tests/data/ppc64el/stretch.gdbm b/debian/tests/data/ppc64el/stretch.gdbm new file mode 100644 index 0000000..3e61e28 Binary files /dev/null and b/debian/tests/data/ppc64el/stretch.gdbm differ diff --git a/debian/tests/data/s390x/buster-ndbm.dir b/debian/tests/data/s390x/buster-ndbm.dir new file mode 100644 index 0000000..24248ad Binary files /dev/null and b/debian/tests/data/s390x/buster-ndbm.dir differ diff --git a/debian/tests/data/s390x/buster-ndbm.pag b/debian/tests/data/s390x/buster-ndbm.pag new file mode 100644 index 0000000..63c9f44 Binary files /dev/null and b/debian/tests/data/s390x/buster-ndbm.pag differ diff --git a/debian/tests/data/s390x/buster.gdbm b/debian/tests/data/s390x/buster.gdbm new file mode 100644 index 0000000..de13482 Binary files /dev/null and b/debian/tests/data/s390x/buster.gdbm differ diff --git a/debian/tests/data/s390x/stretch-ndbm.pag b/debian/tests/data/s390x/stretch-ndbm.pag new file mode 100644 index 0000000..fcb868f Binary files /dev/null and b/debian/tests/data/s390x/stretch-ndbm.pag differ diff --git a/debian/tests/data/s390x/stretch.gdbm b/debian/tests/data/s390x/stretch.gdbm new file mode 100644 index 0000000..f924f69 Binary files /dev/null and b/debian/tests/data/s390x/stretch.gdbm differ diff --git a/debian/tests/data/stretch.bz2 b/debian/tests/data/stretch.bz2 new file mode 100644 index 0000000..5fb6ede Binary files /dev/null and b/debian/tests/data/stretch.bz2 differ diff --git a/debian/tests/data/stretch.db b/debian/tests/data/stretch.db new file mode 100644 index 0000000..914f283 Binary files /dev/null and b/debian/tests/data/stretch.db differ diff --git a/debian/tests/data/stretch.gz b/debian/tests/data/stretch.gz new file mode 100644 index 0000000..c2de8d2 Binary files /dev/null and b/debian/tests/data/stretch.gz differ diff --git a/debian/tests/data/stretch.storable b/debian/tests/data/stretch.storable new file mode 100644 index 0000000..0c097c7 Binary files /dev/null and b/debian/tests/data/stretch.storable differ diff --git a/debian/tests/db b/debian/tests/db new file mode 100755 index 0000000..61e3d53 --- /dev/null +++ b/debian/tests/db @@ -0,0 +1,29 @@ +#!/bin/sh +set -e + +DB=$(mktemp).db +DATA=debian/tests/data + +echo "testing DB_File reading..." + +msg="current DB file read OK" + +printf "%s\n%s\n" foo "$msg" | db_load -T -t hash $DB + +# also test with DB files created on jessie and stretch +for db in $DB $DATA/*.db; do + perl -MDB_File -le 'tie %h, q(DB_File), shift, O_RDONLY, 0640, $DB_HASH or die "opening DB file failed: $!"; die "contents of DB file not found?" if !exists $h{foo}; print $h{foo}' $db | grep OK +done + +rm $DB + +echo "testing DB_File writing..." + +msg="DB file written OK" + +DB=$(mktemp).db +perl -MDB_File -e 'tie %h, q(DB_File), shift, O_WRONLY | O_CREAT, 0640, $DB_BTREE or die "opening DB file failed: $!"; $h{foo} = shift; untie %h' $DB "$msg" + +db_dump -p $DB | grep OK + +rm $DB diff --git a/debian/tests/embed b/debian/tests/embed new file mode 100755 index 0000000..c58621e --- /dev/null +++ b/debian/tests/embed @@ -0,0 +1,31 @@ +#!/bin/sh +set -e +set -x + +# from perlembed(1) +cat > perlembed.c < /* from the Perl distribution */ +#include /* from the Perl distribution */ + +static PerlInterpreter *my_perl; /*** The Perl interpreter ***/ + +int main(int argc, char **argv, char **env) +{ + PERL_SYS_INIT3(&argc,&argv,&env); + my_perl = perl_alloc(); + perl_construct(my_perl); + PL_exit_flags |= PERL_EXIT_DESTRUCT_END; + perl_parse(my_perl, NULL, argc, argv, (char **)NULL); + perl_run(my_perl); + perl_destruct(my_perl); + perl_free(my_perl); + PERL_SYS_TERM(); +} +EOF +CC=$(perl -MConfig -E 'say $Config{cc}') +CCOPTS=$(perl -MExtUtils::Embed -e ccopts) +LDOPTS=$(perl -MExtUtils::Embed -e ldopts) + +$CC $CCOPTS perlembed.c -o perlembed.bin $LDOPTS -lperl +./perlembed.bin -E 'say "OK"' | grep -q -x OK + diff --git a/debian/tests/gdbm b/debian/tests/gdbm new file mode 100755 index 0000000..bb516ed --- /dev/null +++ b/debian/tests/gdbm @@ -0,0 +1,32 @@ +#!/bin/sh +set -e + +ARCH=$(dpkg --print-architecture) +DB=$(mktemp).gdbm +DATA=debian/tests/data + +[ -d $DATA/$ARCH ] || exit 77 + +echo "testing GDBM reading..." + +msg="GDBM file read OK" + +printf 'open %s\nstore %s "%s"\n' $DB foo "$msg" | gdbmtool -f - + +for db in $DB $DATA/$ARCH/*.gdbm; do + perl -MGDBM_File -le 'tie %h, q(GDBM_File), shift, &GDBM_READER, 0640 or die "opening GDBM file failed: $!"; die "contents of GDBM file not found?" if !exists $h{foo}; print $h{foo}' $db | grep OK +done + +rm $DB + +echo "testing GDBM writing..." + +msg="GDBM file written OK" + +DB=$(mktemp).db + +perl -MGDBM_File -e 'tie %h, q(GDBM_File), shift, &GDBM_WRCREAT, 0640 or die "opening GDBM file failed: $!"; $h{foo} = shift; untie %h' $DB "$msg" + +printf 'open %s\nfetch %s\n' $DB foo | gdbmtool -f - | grep "$msg" + +rm $DB diff --git a/debian/tests/hello b/debian/tests/hello new file mode 100755 index 0000000..f07776e --- /dev/null +++ b/debian/tests/hello @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +# silly test to see that perl is still working +perl -e 'print "OK: hello, world!\n"' | grep OK + diff --git a/debian/tests/ndbm b/debian/tests/ndbm new file mode 100755 index 0000000..101ff1f --- /dev/null +++ b/debian/tests/ndbm @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +ARCH=$(dpkg --print-architecture) +DATA=debian/tests/data + +[ -d $DATA/$ARCH ] || exit 77 + +TDIR=$(mktemp -d) +echo "testing NDBM reading..." + +for pag in $DATA/$ARCH/*-ndbm.pag; do + base=$(basename $pag .pag) + cp $pag $TDIR + dir=$(echo $pag | sed 's/\.pag$/.dir/') + if [ -e $dir ]; then + cp $dir $TDIR + else + # NDBM compat in stretch and earlier made .dir a hardlink to .pag + ln $TDIR/$base.pag $TDIR/$base.dir || exit 77 + fi + perl -MFcntl -MNDBM_File -le 'tie %h, q(NDBM_File), shift, O_RDWR, 0640 or die "opening NDBM file failed: $!"; die "contents of NDBM file not found?" if !$h{foo}; print $h{foo}' $TDIR/$base | grep OK +done + +rm -r "$TDIR" diff --git a/debian/tests/perl-base-self-contained b/debian/tests/perl-base-self-contained new file mode 100755 index 0000000..d561c31 --- /dev/null +++ b/debian/tests/perl-base-self-contained @@ -0,0 +1,5 @@ +#!/bin/sh +echo "Verifying that perl-base is still self contained" + +(cd /; find usr/lib/*/perl-base -name '*.pm') | \ + perl debian/check-require / diff --git a/debian/tests/pkg-perl/syntax-skip b/debian/tests/pkg-perl/syntax-skip new file mode 100644 index 0000000..369827e --- /dev/null +++ b/debian/tests/pkg-perl/syntax-skip @@ -0,0 +1,8 @@ +# needs Tk, not worth even a suggestion +Pod/Perldoc/ToTk +# please load Net::FTP first +Net/FTP/ +# needs Math::BigInt loaded +Math/BigInt/CalcEmu +# obviously not for us +File/Spec/VMS diff --git a/debian/tests/storable b/debian/tests/storable new file mode 100755 index 0000000..a559382 --- /dev/null +++ b/debian/tests/storable @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +DATA=debian/tests/data + +echo "Testing reading of Storable files..." +for f in $DATA/*.storable; do + perl -MStorable=retrieve -le '$h=retrieve(shift); print $h->{foo}' $f | grep OK +done diff --git a/debian/tests/verify-configure b/debian/tests/verify-configure new file mode 100755 index 0000000..fe0fd91 --- /dev/null +++ b/debian/tests/verify-configure @@ -0,0 +1,5 @@ +#!/bin/sh +mkdir $AUTOPKGTEST_TMP/source +find . -print0 | cpio -p0d $AUTOPKGTEST_TMP/source +cd $AUTOPKGTEST_TMP/source +make -f debian/rules verify-configure-stamp -- cgit v1.2.3