From 5f1331636b89298696c600019ab1c94893739a59 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Sun, 16 Jul 2023 01:26:58 +1200 Subject: [PATCH] Fix autopkgtest smoke test Ensure that the tests can find mythtv-status when the smoke test runs. --- debian/patches/series | 1 - debian/patches/test-files-search-path.patch | 156 -------------------- debian/tests/pkg-perl/smoke-setup | 5 + 3 files changed, 5 insertions(+), 157 deletions(-) delete mode 100644 debian/patches/test-files-search-path.patch create mode 100755 debian/tests/pkg-perl/smoke-setup diff --git a/debian/patches/series b/debian/patches/series index 8365f22..5eca6b1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1 @@ -test-files-search-path.patch makefile-man-path.patch diff --git a/debian/patches/test-files-search-path.patch b/debian/patches/test-files-search-path.patch deleted file mode 100644 index 7bdbf4c..0000000 --- a/debian/patches/test-files-search-path.patch +++ /dev/null @@ -1,156 +0,0 @@ -Description: Adjust command for test files - Allow autopkgtest to run the installed mythtv-status. -Author: Andrew Ruthven -Forwarded: not-needed -Last-Update: 2023-07-16 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ -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/smoke-setup b/debian/tests/pkg-perl/smoke-setup new file mode 100755 index 0000000..3fc48ab --- /dev/null +++ b/debian/tests/pkg-perl/smoke-setup @@ -0,0 +1,5 @@ +#!/bin/sh + +# Ensure that mythtv-status is where the tests expect to find it. +mkdir $TDIR/bin +ln -s /usr/bin/mythtv-status $TDIR/bin -- 2.30.2