From 7ba07446abd7e82e39ae4b5461ee35de564e1a0f Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Fri, 9 Apr 2021 22:56:01 +1200 Subject: [PATCH] Add support for autopkgtest --- debian/changelog | 6 + debian/control | 1 + debian/patches/series | 1 + debian/patches/test-files-search-path.patch | 162 ++++++++++++++++++++ debian/tests/pkg-perl/SKIP | 2 + 5 files changed, 172 insertions(+) create mode 100644 debian/patches/test-files-search-path.patch create mode 100644 debian/tests/pkg-perl/SKIP diff --git a/debian/changelog b/debian/changelog index 0a699a8..31236a5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mythtv-status (1.0.1-3) unstable; urgency=medium + + * Add support for autopkgtest + + -- Andrew Ruthven Fri, 09 Apr 2021 22:54:59 +1200 + mythtv-status (1.0.1-2) unstable; urgency=medium * Update systemd service file to use -f with rm (Closes: #954734). diff --git a/debian/control b/debian/control index 4de6da6..39e9bb8 100644 --- a/debian/control +++ b/debian/control @@ -8,6 +8,7 @@ Homepage: http://www.etc.gen.nz/projects/mythtv/mythtv-status.html Vcs-Git: http://git.etc.gen.nz/mythtv-status.git Vcs-Browser: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?p=mythtv-status.git;a=summary Rules-Requires-Root: no +Testsuite: autopkgtest-pkg-perl Package: mythtv-status Architecture: all diff --git a/debian/patches/series b/debian/patches/series index 47d497d..fc588f2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ +test-files-search-path.patch 50-mythtv-status-exit-code.patch diff --git a/debian/patches/test-files-search-path.patch b/debian/patches/test-files-search-path.patch new file mode 100644 index 0000000..f3b868d --- /dev/null +++ b/debian/patches/test-files-search-path.patch @@ -0,0 +1,162 @@ +#Index: mythtv-status/Makefile +#=================================================================== +#--- a/Makefile 2021-04-09 22:19:14.444124156 +1200 +#+++ b/Makefile 2021-04-09 22:47:19.496826728 +1200 +#@@ -75,7 +75,7 @@ +# install -m 644 man/mythtv_recording_soon.1 $(MANDIR)/man1 +# +# test: +#- PERL_DL_NONLAZY=1 perl "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE))" $(TEST_FILES) +#+ PATH=bin:$(PATH) PERL_DL_NONLAZY=1 perl "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE))" $(TEST_FILES) +# +# +# clean: +Index: mythtv-status/t/01-test-help.t +=================================================================== +--- a/t/01-test-help.t 2021-04-09 22:19:14.456124190 +1200 ++++ b/t/01-test-help.t 2021-04-09 22:44:34.036348190 +1200 +@@ -1,10 +1,9 @@ + #!usr/bin/perl + + use Test::More tests => 2; +-use FindBin qw/$Bin/; + + # Test that the blurb of how to get help is printed. +-my $out = `$Bin/../bin/mythtv-status --zzz 2>&1`; ++my $out = `mythtv-status --zzz 2>&1`; + + my $expected = <&1`; ++$out = `mythtv-status --help 2>&1`; + + $expected = <&1`; ++my $out = `mythtv-status --file $xml 2>&1`; + + #diag($out); + +@@ -20,7 +20,7 @@ + + # Test that the status isn't present if --nostatus is passed. + +-$out = `$Bin/../bin/mythtv-status --file $xml --nostatus 2>&1`; ++$out = `mythtv-status --file $xml --nostatus 2>&1`; + + like($out, qr/MythTV status for localhost/, 'Header is present'); + unlike($out, qr/^Status as of\.*:/m, 'Status line is not present'); +@@ -31,7 +31,7 @@ + + # Test that the disk space isn't present if --nototal-disk-space is passed. + +-$out = `$Bin/../bin/mythtv-status --file $xml --nototal-disk-space 2>&1`; ++$out = `mythtv-status --file $xml --nototal-disk-space 2>&1`; + + like($out, qr/MythTV status for localhost/, 'Header is present'); + like($out, qr/^Status as of\.*: Thu Nov 29 2007, 6:43 PM$/m, 'Status line is present'); +@@ -42,7 +42,7 @@ + + # Test that the encoders details aren't present if --noencoders is passed. + +-$out = `$Bin/../bin/mythtv-status --file $xml --noencoders 2>&1`; ++$out = `mythtv-status --file $xml --noencoders 2>&1`; + + like($out, qr/MythTV status for localhost/, 'Header is present'); + like($out, qr/^Status as of\.*: Thu Nov 29 2007, 6:43 PM$/m, 'Status line is present'); +@@ -53,7 +53,7 @@ + + # Test that the recording now details aren't present if --norecording-now is passed. + +-$out = `$Bin/../bin/mythtv-status --file $xml --norecording-now 2>&1`; ++$out = `mythtv-status --file $xml --norecording-now 2>&1`; + + like($out, qr/MythTV status for localhost/, 'Header is present'); + like($out, qr/^Status as of\.*: Thu Nov 29 2007, 6:43 PM$/m, 'Status line is present'); +@@ -64,7 +64,7 @@ + + # Test that the encoder details for a recording are present if --encoder-details is passed. + +-$out = `$Bin/../bin/mythtv-status --file $xml --encoder-details 2>&1`; ++$out = `mythtv-status --file $xml --encoder-details 2>&1`; + + #diag($out); + +@@ -77,7 +77,7 @@ + + # Test that the encoder details for a recording are present if --encoder-details is passed. + +-$out = `$Bin/../bin/mythtv-status --file $xml --oneliner-bullets 2>&1`; ++$out = `mythtv-status --file $xml --oneliner-bullets 2>&1`; + + #diag($out); + +Index: mythtv-status/t/10-v0.20-guide-data-warning.t +=================================================================== +--- a/t/10-v0.20-guide-data-warning.t 2014-09-11 23:40:27.710233447 +1200 ++++ b/t/10-v0.20-guide-data-warning.t 2021-04-09 22:45:32.348517017 +1200 +@@ -7,7 +7,7 @@ + my $xml = "$Bin/xml/guide-data-1-day-0.20.xml"; + + # Test that the guide data warning is present. +-my $out = `$Bin/../bin/mythtv-status --file $xml 2>&1`; ++my $out = `mythtv-status --file $xml 2>&1`; + + #diag($out); + +@@ -15,7 +15,7 @@ + like($out, qr/^Guide Data\.*: There is 1 days worth of data, through to 2007-12-30/m, 'Guide data warning is present'); + + # If --noguide-data is passed in, then the guide data warning should be suppressed. +-$out = `$Bin/../bin/mythtv-status --file $xml --noguide-data 2>&1`; ++$out = `mythtv-status --file $xml --noguide-data 2>&1`; + + #diag($out); + +@@ -23,7 +23,7 @@ + unlike($out, qr/^Guide Data\.*:/m, 'Guide data warning is not present (turned off)'); + + # If --guide-days-warn is set to something different, like 0, then the guide data warning should be suppressed. +-$out = `$Bin/../bin/mythtv-status --file $xml --guide-days-warn 0 2>&1`; ++$out = `mythtv-status --file $xml --guide-days-warn 0 2>&1`; + + #diag($out); + +Index: mythtv-status/t/15-unicode.t +=================================================================== +--- a/t/15-unicode.t 2014-09-11 23:40:27.710233447 +1200 ++++ b/t/15-unicode.t 2021-04-09 22:45:39.984539111 +1200 +@@ -7,7 +7,7 @@ + my $xml = "$Bin/xml/wide-character.xml"; + + # Test that the guide data warning is present. +-my $out = `$Bin/../bin/mythtv-status -d --file $xml --date '2012-07-07 22:12' 2>&1`; ++my $out = `mythtv-status -d --file $xml --date '2012-07-07 22:12' 2>&1`; + + #diag($out); + +Index: mythtv-status/t/20-next-recording-has-hours.t +=================================================================== +--- a/t/20-next-recording-has-hours.t 2021-04-09 22:19:14.456124190 +1200 ++++ b/t/20-next-recording-has-hours.t 2021-04-09 22:45:51.728573085 +1200 +@@ -14,7 +14,7 @@ + my $xml = "$Bin/xml/bug729400-wrong-recording-date.xml"; + + # Test that the guide data warning is present. +-my $out = `$Bin/../bin/mythtv-status -d --file $xml --date '2013-12-09T21:02:12Z' 2>&1`; ++my $out = `mythtv-status -d --file $xml --date '2013-12-09T21:02:12Z' 2>&1`; + + #diag($out); + diff --git a/debian/tests/pkg-perl/SKIP b/debian/tests/pkg-perl/SKIP new file mode 100644 index 0000000..bda0d27 --- /dev/null +++ b/debian/tests/pkg-perl/SKIP @@ -0,0 +1,2 @@ +# No Perl Modules included in the package +runtime-deps.d/use.t -- 2.30.2