summaryrefslogtreecommitdiff
path: root/t/uni
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-03-07 16:31:05 +0000
committerNicholas Clark <nick@ccl4.org>2011-03-07 16:31:05 +0000
commitb5b7b9adf9fbdc829b735710863e92d10a0676b8 (patch)
treefd47c5c0d75f36d53d7ab34401070a9526da0370 /t/uni
parente05e9c3d01e748834948a3f9f9f62c9e72295130 (diff)
downloadperl-b5b7b9adf9fbdc829b735710863e92d10a0676b8.tar.gz
Simplify the startup skip logic of tests in t/uni.
Use the various skip_all*() functions in test.pl to express the desired intent.
Diffstat (limited to 't/uni')
-rw-r--r--t/uni/chomp.t22
-rw-r--r--t/uni/chr.t23
-rw-r--r--t/uni/greek.t28
-rw-r--r--t/uni/latin2.t28
-rw-r--r--t/uni/tr_7jis.t22
-rw-r--r--t/uni/tr_eucjp.t22
-rw-r--r--t/uni/tr_sjis.t22
-rw-r--r--t/uni/tr_utf8.t26
-rw-r--r--t/uni/write.t14
9 files changed, 39 insertions, 168 deletions
diff --git a/t/uni/chomp.t b/t/uni/chomp.t
index 6aef50c17c..1292fb690b 100644
--- a/t/uni/chomp.t
+++ b/t/uni/chomp.t
@@ -1,25 +1,11 @@
#!./perl -w
BEGIN {
- require Config; import Config;
- if ($Config{'extensions'} !~ /\bEncode\b/) {
- print "1..0 # Skip: Encode was not built\n";
- exit 0;
- }
- if (ord("A") == 193) {
- print "1..0 # Skip: EBCDIC\n";
- exit 0;
- }
- unless (PerlIO::Layer->find('perlio')){
- print "1..0 # Skip: PerlIO required\n";
- exit 0;
- }
- if ($ENV{PERL_CORE_MINITEST}) {
- print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n";
- exit 0;
- }
-
require './test.pl';
+ skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+ skip_all("EBCDIC") if $::IS_EBCDIC;
+ skip_all_without_perlio();
+ skip_all_without_extension('Encode');
}
use strict;
diff --git a/t/uni/chr.t b/t/uni/chr.t
index 8d7924f3da..227dc52361 100644
--- a/t/uni/chr.t
+++ b/t/uni/chr.t
@@ -1,26 +1,11 @@
#!./perl -w
BEGIN {
- require Config; import Config;
- if ($Config{'extensions'} !~ /\bEncode\b/) {
- print "1..0 # Skip: Encode was not built\n";
- exit 0;
- }
- if (ord("A") == 193) {
- print "1..0 # Skip: EBCDIC\n";
- exit 0;
- }
- unless (PerlIO::Layer->find('perlio')){
- print "1..0 # Skip: PerlIO required\n";
- exit 0;
- }
- if ($ENV{PERL_CORE_MINITEST}) {
- print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n";
- exit 0;
- }
- $| = 1;
-
require './test.pl';
+ skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+ skip_all("EBCDIC") if $::IS_EBCDIC;
+ skip_all_without_perlio();
+ skip_all_without_extension('Encode');
}
use strict;
diff --git a/t/uni/greek.t b/t/uni/greek.t
index a8102f3880..a1ca3c4a27 100644
--- a/t/uni/greek.t
+++ b/t/uni/greek.t
@@ -1,27 +1,11 @@
+#!./perl -w
+
BEGIN {
- if ($ENV{'PERL_CORE'}){
- chdir 't';
- @INC = '../lib';
- }
- require Config; import Config;
- if ($Config{'extensions'} !~ /\bEncode\b/) {
- print "1..0 # Skip: Encode was not built\n";
- exit 0;
- }
- if (ord("A") == 193) {
- print "1..0 # Skip: EBCDIC\n";
- exit 0;
- }
- unless (PerlIO::Layer->find('perlio')){
- print "1..0 # Skip: PerlIO required\n";
- exit 0;
- }
- if ($ENV{PERL_CORE_MINITEST}) {
- print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n";
- exit 0;
- }
- $| = 1;
require './test.pl';
+ skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+ skip_all("EBCDIC") if $::IS_EBCDIC;
+ skip_all_without_perlio();
+ skip_all_without_extension('Encode');
}
plan tests => 72;
diff --git a/t/uni/latin2.t b/t/uni/latin2.t
index 08928b6039..344d1a8279 100644
--- a/t/uni/latin2.t
+++ b/t/uni/latin2.t
@@ -1,27 +1,11 @@
+#!./perl -w
+
BEGIN {
- if ($ENV{'PERL_CORE'}){
- chdir 't';
- @INC = '../lib';
- }
- require Config; import Config;
- if ($Config{'extensions'} !~ /\bEncode\b/) {
- print "1..0 # Skip: Encode was not built\n";
- exit 0;
- }
- if (ord("A") == 193) {
- print "1..0 # Skip: EBCDIC\n";
- exit 0;
- }
- unless (PerlIO::Layer->find('perlio')){
- print "1..0 # Skip: PerlIO required\n";
- exit 0;
- }
- if ($ENV{PERL_CORE_MINITEST}) {
- print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n";
- exit 0;
- }
- $| = 1;
require './test.pl';
+ skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+ skip_all("EBCDIC") if $::IS_EBCDIC;
+ skip_all_without_perlio();
+ skip_all_without_extension('Encode');
}
plan tests => 94;
diff --git a/t/uni/tr_7jis.t b/t/uni/tr_7jis.t
index 46f80a145c..90f34310b2 100644
--- a/t/uni/tr_7jis.t
+++ b/t/uni/tr_7jis.t
@@ -5,25 +5,11 @@
# -- dankogai
BEGIN {
- require Config; import Config;
- if ($Config{'extensions'} !~ /\bEncode\b/) {
- print "1..0 # Skip: Encode was not built\n";
- exit 0;
- }
- if (ord("A") == 193) {
- print "1..0 # Skip: EBCDIC\n";
- exit 0;
- }
- unless (PerlIO::Layer->find('perlio')){
- print "1..0 # Skip: PerlIO required\n";
- exit 0;
- }
- if ($ENV{PERL_CORE_MINITEST}) {
- print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n";
- exit 0;
- }
- $| = 1;
require './test.pl';
+ skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+ skip_all("EBCDIC") if $::IS_EBCDIC;
+ skip_all_without_perlio();
+ skip_all_without_extension('Encode');
}
use strict;
diff --git a/t/uni/tr_eucjp.t b/t/uni/tr_eucjp.t
index 6b2ca2b043..352684d64a 100644
--- a/t/uni/tr_eucjp.t
+++ b/t/uni/tr_eucjp.t
@@ -4,25 +4,11 @@
# -- dankogai
BEGIN {
- require Config; import Config;
- if ($Config{'extensions'} !~ /\bEncode\b/) {
- print "1..0 # Skip: Encode was not built\n";
- exit 0;
- }
- if (ord("A") == 193) {
- print "1..0 # Skip: EBCDIC\n";
- exit 0;
- }
- unless (PerlIO::Layer->find('perlio')){
- print "1..0 # Skip: PerlIO required\n";
- exit 0;
- }
- if ($ENV{PERL_CORE_MINITEST}) {
- print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n";
- exit 0;
- }
- $| = 1;
require './test.pl';
+ skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+ skip_all("EBCDIC") if $::IS_EBCDIC;
+ skip_all_without_perlio();
+ skip_all_without_extension('Encode');
}
use strict;
diff --git a/t/uni/tr_sjis.t b/t/uni/tr_sjis.t
index d71c4babb6..fca9d6c804 100644
--- a/t/uni/tr_sjis.t
+++ b/t/uni/tr_sjis.t
@@ -4,25 +4,11 @@
# -- dankogai
BEGIN {
- require Config; import Config;
- if ($Config{'extensions'} !~ /\bEncode\b/) {
- print "1..0 # Skip: Encode was not built\n";
- exit 0;
- }
- if (ord("A") == 193) {
- print "1..0 # Skip: EBCDIC\n";
- exit 0;
- }
- unless (PerlIO::Layer->find('perlio')){
- print "1..0 # Skip: PerlIO required\n";
- exit 0;
- }
- if ($ENV{PERL_CORE_MINITEST}) {
- print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n";
- exit 0;
- }
- $| = 1;
require './test.pl';
+ skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+ skip_all("EBCDIC") if $::IS_EBCDIC;
+ skip_all_without_perlio();
+ skip_all_without_extension('Encode');
}
use strict;
diff --git a/t/uni/tr_utf8.t b/t/uni/tr_utf8.t
index 8e697ce389..aa8f439820 100644
--- a/t/uni/tr_utf8.t
+++ b/t/uni/tr_utf8.t
@@ -5,29 +5,11 @@
# -- dankogai
BEGIN {
- if ($ENV{'PERL_CORE'}){
- chdir 't';
- @INC = '../lib';
- }
- require Config; import Config;
- if ($Config{'extensions'} !~ /\bEncode\b/) {
- print "1..0 # Skip: Encode was not built\n";
- exit 0;
- }
- if (ord("A") == 193) {
- print "1..0 # Skip: EBCDIC\n";
- exit 0;
- }
- unless (PerlIO::Layer->find('perlio')){
- print "1..0 # Skip: PerlIO required\n";
- exit 0;
- }
- if ($ENV{PERL_CORE_MINITEST}) {
- print "1..0 # Skip: no dynamic loading on miniperl, no Encode\n";
- exit 0;
- }
- $| = 1;
require './test.pl';
+ skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+ skip_all("EBCDIC") if $::IS_EBCDIC;
+ skip_all_without_perlio();
+ skip_all_without_extension('Encode');
}
use strict;
diff --git a/t/uni/write.t b/t/uni/write.t
index 136be677f7..c60065d37b 100644
--- a/t/uni/write.t
+++ b/t/uni/write.t
@@ -2,17 +2,9 @@
use strict;
BEGIN {
- chdir 't' if -d 't';
- @INC = qw(../lib .);
- require "test.pl";
- unless (PerlIO::Layer->find('perlio')){
- print "1..0 # Skip: PerlIO required\n";
- exit 0;
- }
- if (ord("A") == 193) {
- print "1..0 # Skip: EBCDIC porting needed\n";
- exit 0;
- }
+ require './test.pl';
+ skip_all("EBCDIC porting needed") if $::IS_EBCDIC;
+ skip_all_without_perlio();
}
plan tests => 6;