File: skip-stderr-test

package info (click to toggle)
libtemplate-alloy-perl 1.022-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,276 kB
  • sloc: perl: 6,636; makefile: 2
file content (58 lines) | stat: -rw-r--r-- 2,268 bytes parent folder | download | duplicates (2)
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
Description: Skip stderr test during autopkgtests
 During autopkgtest one of the 3260 tests in t/05_tt_base.t emits
 text to STDERR (3 times) which affects the TAP harness's ability to count
 the number of expected tests.
 .
 From the build-time test log we see:
 .
 # testing stderr ... ok
 # testing stderr ... ok
 # testing stderr ... ok
 t/05_tt_base.t ..........
 1..3260
 .
 We therefore patch this test out only during autopkgtest and subtract 3
 from the total number of expected tests.
Author: Nick Morrott <nickm@debian.org>
Forwarded: not-needed
Last-Update: 2022-04-07
---
--- a/t/05_tt_base.t
+++ b/t/05_tt_base.t
@@ -7,7 +7,7 @@
 =cut
 
 use 5.006;
-our ($module, $is_tt, $compile_perl, $use_stream, $five_six, $five_eight, $has_tt_filter);
+our ($module, $is_tt, $compile_perl, $use_stream, $five_six, $five_eight, $has_tt_filter, $autopkgtest_skip);
 BEGIN {
     $module = 'Template::Alloy';
     if ($ENV{'USE_TT'} || grep {/tt/i} @ARGV) {
@@ -17,10 +17,13 @@
     $five_six   = ($^V < 5.007) ? 1 : 0;
     $five_eight = ($^V < 5.009) ? 1 : 0;
     $has_tt_filter = !eval { require Template::Filters } ? 0 : $is_tt ? 1 : 3;
+    # Skip specific tests during autopkgtest only
+    # - need to remove 3 occurences of Test stderr test
+    $autopkgtest_skip = $ENV{'AUTOPKGTEST_TMP'} ? 3 : 0;
 };
 
 use strict;
-use Test::More tests => (! $is_tt ? 3260 : 674) - (!$five_six ? 0 : 3*($is_tt ? 1 : 3)) + $has_tt_filter;
+use Test::More tests => (! $is_tt ? 3260 : 674) - (!$five_six ? 0 : 3*($is_tt ? 1 : 3)) + $has_tt_filter - $autopkgtest_skip;
 use constant test_taint => 0 && eval { require Taint::Runtime };
 use Data::Dumper;
 
@@ -463,7 +466,11 @@
 process_ok("[% n.sqrt %]" => "3", {n => 9}) if ! $is_tt;
 process_ok("[% n.squote %]" => "(\n|\\\\|\\\')", {n => "(\n|\\|\')"});
 process_ok("[% n.srand; 12 %]" => "12", {n => 9}) if ! $is_tt;
-process_ok("[% n.stderr %]" => "", {n => "# testing stderr ... ok\r"});
+
+if (! $ENV{'AUTOPKGTEST_TMP'}) {
+    process_ok("[% n.stderr %]" => "", {n => "# testing stderr ... ok\r"});
+}
+
 process_ok("[% n|trim %]" => "a  b", {n => '  a  b  '}); # TT2 filter
 process_ok("[% n.uc %]" => 'FOO', {n => "foo"}) if ! $is_tt; # TT2 filter
 process_ok("[% n|ucfirst %]" => 'Foo', {n => "foo"}); # TT2 filter