[Po4a-commits] "po4a/t 01-classes.t, 1.3, 1.4 20-xml.t, 1.5, 1.6 23-man.t, 1.11, 1.12"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sun Dec 31 15:18:33 CET 2006


Update of /cvsroot/po4a/po4a/t
In directory alioth:/tmp/cvs-serv4379/t

Modified Files:
	01-classes.t 20-xml.t 23-man.t 
Log Message:
Simplify the dependencies.


Index: 23-man.t
===================================================================
RCS file: /cvsroot/po4a/po4a/t/23-man.t,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- 23-man.t	5 Sep 2006 20:16:56 -0000	1.11
+++ 23-man.t	31 Dec 2006 14:18:31 -0000	1.12
@@ -48,14 +48,17 @@
   'run'  => "LC_ALL=C COLUMNS=80 perl ../po4a-gettextize -f #format# -m data-23/dot2 -p tmp/dot2.pot 2>tmp/dot2.err || true",
   'test' => "diff -u $diff_po_flags  data-23/dot2.err tmp/dot2.err",
   'doc'  => "gettextize well various lines beginning by a dot (2)",
+  'requires' => "Text::WrapI18N",
 }, {
   'run'  => "LC_ALL=C COLUMNS=80 perl ../po4a-gettextize -f #format# -m data-23/dot3 -p tmp/dot3.pot 2>tmp/dot3.err || true",
   'test' => "diff -u $diff_po_flags  data-23/dot3.err tmp/dot3.err",
   'doc'  => "gettextize well various lines beginning by a dot (3)",
+  'requires' => "Text::WrapI18N",
 }, {
   'run'  => "LC_ALL=C COLUMNS=80 perl ../po4a-gettextize -f #format# -m data-23/dot4 -p tmp/dot4.pot 2>tmp/dot4.err || true",
   'test' => "diff -u $diff_po_flags  data-23/dot4.err tmp/dot4.err",
   'doc'  => "gettextize well various lines beginning by a dot (4)",
+  'requires' => "Text::WrapI18N",
 }, {
   'run'  => "LC_ALL=C perl ../po4a-gettextize -f #format# -m data-23/dot5 -p tmp/dot5.pot 2>/dev/null",
   'test' => "diff -u $diff_po_flags  data-23/dot5.pot tmp/dot5.pot",
@@ -102,7 +105,7 @@
 
 # Fonts
 push @tests, {
-  'run'  => "LC_ALL=C perl ../po4a-gettextize -f #format# -m data-23/fonts -p tmp/fonts.pot 2>/dev/null",
+  'run'  => "LC_ALL=C perl ../po4a-gettextize -f #format# -m data-23/fonts -p tmp/fonts.pot",
   'test' => "diff -u $diff_po_flags  data-23/fonts.pot tmp/fonts.pot",
   'doc'  => "gettextize well fonts",
 }, {
@@ -180,10 +183,20 @@
 	
 	$name=$tests[$i]{'doc'}.' runs';
 	$name =~ s/#format#/$format/g;
-	ok($val == 0,$name);
-	diag($cmd) unless ($val == 0);
-	
 	SKIP: {
+	    if (defined $tests[$i]{'requires'}) {
+		skip ($tests[$i]{'requires'}." required for this test", 1)
+		    unless eval 'require '.$tests[$i]{'requires'};
+	    }
+	    ok($val == 0,$name);
+	    diag($cmd) unless ($val == 0);
+	}
+
+	SKIP: {
+	    if (defined $tests[$i]{'requires'}) {
+		skip ($tests[$i]{'requires'}." required for this test", 1)
+		    unless eval 'require '.$tests[$i]{'requires'};
+	    }
 	    skip ("Command don't run, can't test the validity of its return",1)
 	      if $val;
 	    my $testcmd=$tests[$i]{'test'};	
@@ -208,4 +221,4 @@
 }
 
 0;
-    
+

Index: 01-classes.t
===================================================================
RCS file: /cvsroot/po4a/po4a/t/01-classes.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- 01-classes.t	6 Mar 2005 09:21:03 -0000	1.3
+++ 01-classes.t	31 Dec 2006 14:18:31 -0000	1.4
@@ -21,8 +21,12 @@
 diag($@) if $@;
 eval qq{use Locale::Po4a::Pod};          ok(!$@, 'Pod.pm loadable');
 diag($@) if $@;
-eval qq{use Locale::Po4a::Sgml};         ok(!$@, 'Sgml.pm loadable');
-diag($@) if $@;
+SKIP: {
+    skip "SGMLS required for this test", 1
+        unless eval 'require SGMLS';
+    eval qq{use Locale::Po4a::Sgml};         ok(!$@, 'Sgml.pm loadable');
+    diag($@) if $@;
+}
 eval qq{use Locale::Po4a::Xml};          ok(!$@, 'Xml.pm loadable');
 diag($@) if $@;
 eval qq{use Locale::Po4a::Dia};          ok(!$@, 'Dia.pm loadable');

Index: 20-xml.t
===================================================================
RCS file: /cvsroot/po4a/po4a/t/20-xml.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- 20-xml.t	26 Oct 2005 10:54:26 -0000	1.5
+++ 20-xml.t	31 Dec 2006 14:18:31 -0000	1.6
@@ -1,5 +1,5 @@
 #! /usr/bin/perl
-# XML module tester.
+# SGML module tester.
 
 #########################
 
@@ -8,7 +8,7 @@
 
 my @tests;
 
-my @formats=qw(pod);
+my @formats=qw(sgml);
 
 mkdir "t/tmp" unless -e "t/tmp";
 
@@ -16,9 +16,10 @@
   "-I '^\"POT-Creation-Date: ' -I '^\"Content-Transfer-Encoding:'";
 my $diff_pod_flags= " -I 'This file was generated by po4a' ";
 
-$tests[0]{'run'}  = "perl ../po4a-gettextize -f sgml -m data-20/text.xml -p tmp/xml.po 2>/dev/null";
+$tests[0]{'run'}  = "perl ../po4a-gettextize -f #format# -m data-20/text.xml -p tmp/xml.po 2>/dev/null";
 $tests[0]{'test'} = "diff -u data-20/xml.po tmp/xml.po $diff_po_flags";
 $tests[0]{'doc'}  = "gettextize well simple xml documents";
+$tests[0]{'requires'} = "Text::WrapI18N";
 
 use Test::More tests =>2; # $formats * $tests * 2 
 
@@ -34,10 +35,20 @@
 	
 	$name=$tests[$i]{'doc'}.' runs';
 	$name =~ s/#format#/$format/g;
-	ok($val == 0,$name);
-	diag($cmd) unless ($val == 0);
-	
 	SKIP: {
+	    if (defined $tests[$i]{'requires'}) {
+		skip ($tests[$i]{'requires'}." required for this test", 1)
+		    unless eval 'require '.$tests[$i]{'requires'};
+	    }
+	    ok($val == 0,$name);
+	    diag($cmd) unless ($val == 0);
+	}
+
+	SKIP: {
+	    if (defined $tests[$i]{'requires'}) {
+		skip ($tests[$i]{'requires'}." required for this test", 1)
+		    unless eval 'require '.$tests[$i]{'requires'};
+	    }
 	    skip ("Command don't run, can't test the validity of its return",1)
 	      if $val;
 	    my $testcmd=$tests[$i]{'test'};	
@@ -62,4 +73,4 @@
 }
 
 0;
-    
+




More information about the Po4a-commits mailing list