Skip to content

Commit 2d738c3

Browse files
committed
use different skip_all tests depending on error
There is now skip_all_mw.t (if the MainWindow could not be created e.g. because DISPLAY is not set) and skip_all_font.t (if Label widget could not be created which happens usually if no font is available).
1 parent ef5fc8e commit 2d738c3

File tree

8 files changed

+18
-11
lines changed

8 files changed

+18
-11
lines changed

Event/Makefile.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ sub MY::test_via_harness
1313
{
1414
my($self, $perl, $tests) = @_;
1515
qq{\t$perl "-I../t" "-MTkTest" }.
16-
qq{"-e" "checked_test_harness('\$(TKDIR)/xt/skip_all.t', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n};
16+
qq{"-e" "checked_test_harness('\$(TKDIR)/xt', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n};
1717
}

JPEG/Makefile.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ sub MY::test_via_harness
4141
{
4242
my($self, $perl, $tests) = @_;
4343
qq{\t$perl "-I../t" "-MTkTest" }.
44-
qq{"-e" "checked_test_harness('\$(TKDIR)/xt/skip_all.t', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n};
44+
qq{"-e" "checked_test_harness('\$(TKDIR)/xt', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n};
4545
}
4646

4747
package MY;

MANIFEST

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2213,4 +2213,5 @@ Xlib/Xlib.xs
22132213
xt/font_attrs.t
22142214
xt/mw_segfault.t
22152215
xt/rt7474.t
2216-
xt/skip_all.t
2216+
xt/skip_all_font.t
2217+
xt/skip_all_mw.t

Makefile.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ sub MY::test_via_harness
210210
{
211211
my($self, $perl, $tests) = @_;
212212
qq{\t$perl "-It" "-MTkTest" }.
213-
qq{"-e" "checked_test_harness('\$(TKDIR)/xt/skip_all.t', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n};
213+
qq{"-e" "checked_test_harness('\$(TKDIR)/xt', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n};
214214
}
215215

216216
sub MY::postamble {

PNG/Makefile.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ sub MY::test_via_harness
8989
{
9090
my($self, $perl, $tests) = @_;
9191
qq{\t$perl "-I../t" "-MTkTest" }.
92-
qq{"-e" "checked_test_harness('\$(TKDIR)/xt/skip_all.t', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n};
92+
qq{"-e" "checked_test_harness('\$(TKDIR)/xt', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n};
9393
}
9494

9595
package MY;

t/TkTest.pm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use POSIX qw(DBL_EPSILON);
1818
$eps = DBL_EPSILON;
1919

2020
sub checked_test_harness ($@) {
21-
my($skip_test, @test_harness_args) = @_;
21+
my($skip_test_dir, @test_harness_args) = @_;
2222

2323
require ExtUtils::Command::MM;
2424
# In case of cygwin, use'ing Tk before forking (which is done by
@@ -37,18 +37,18 @@ sub checked_test_harness ($@) {
3737
}
3838

3939
if (defined $Tk::platform && $Tk::platform eq 'unix') { # undef for cygwin+MSWin32, because Tk not yet loaded
40-
my $have_to_skip;
40+
my $skip_all_test;
4141
my $mw = eval { MainWindow->new() };
4242
if (!Tk::Exists($mw)) {
43-
$have_to_skip = 1;
43+
$skip_all_test = "skip_all_mw.t";
4444
} else {
4545
my $l = eval { $mw->Label(-text => "test") }; # will allocate a font, which may fail
4646
if (!Tk::Exists($l)) {
47-
$have_to_skip = 1;
47+
$skip_all_test = "skip_all_font.t";
4848
}
4949
}
50-
if ($have_to_skip) {
51-
local @ARGV = $skip_test;
50+
if ($skip_all_test) {
51+
local @ARGV = "$skip_test_dir/$skip_all_test";
5252
return ExtUtils::Command::MM::test_harness(@test_harness_args);
5353
}
5454
$mw->destroy;

xt/skip_all_font.t

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/perl -w
2+
# -*- perl -*-
3+
4+
print "1..0 # SKIP Cannot create Label widget (maybe no fonts are available at all?)\n";
5+
6+
__END__
File renamed without changes.

0 commit comments

Comments
 (0)