texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[5296] * tp/t/test_utils.pl(test): allow for marking tests as TODO.


From: Patrice Dumas
Subject: [5296] * tp/t/test_utils.pl(test): allow for marking tests as TODO.
Date: Sat, 10 Aug 2013 16:25:04 +0000

Revision: 5296
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5296
Author:   pertusus
Date:     2013-08-10 16:24:15 +0000 (Sat, 10 Aug 2013)
Log Message:
-----------
        * tp/t/test_utils.pl(test): allow for marking tests as TODO.  Use
        this facility to mark a test of all_spaces that fails on perl 5.10
        with NEL not being treated the same as in perl 5.14.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/t/plaintext_tests.t
    trunk/tp/t/test_utils.pl

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2013-08-10 15:33:48 UTC (rev 5295)
+++ trunk/ChangeLog     2013-08-10 16:24:15 UTC (rev 5296)
@@ -12,6 +12,9 @@
        https://bugzilla.redhat.com/show_bug.cgi?id=950644
        * tp/Makefile.am: reorder alphabetically test input files.  
        Distribute missing test files.
+       * tp/t/test_utils.pl(test): allow for marking tests as TODO.  Use
+       this facility to mark a test of all_spaces that fails on perl 5.10
+       with NEL not being treated the same as in perl 5.14.
 
 2013-08-09  Patrice Dumas  <address@hidden>
 

Modified: trunk/tp/t/plaintext_tests.t
===================================================================
--- trunk/tp/t/plaintext_tests.t        2013-08-10 15:33:48 UTC (rev 5295)
+++ trunk/tp/t/plaintext_tests.t        2013-08-10 16:24:15 UTC (rev 5296)
@@ -966,7 +966,9 @@
 undef, {'test_file' => 'non_break_spaces.texi'}
 ],
 ['all_spaces',
-undef, {'test_file' => 'all_spaces.texi'}
+undef, {'test_file' => 'all_spaces.texi', 
+        'todo' => {'file_plaintext' => 
+                          'NEL handled differently between perl versions'}}
 ],
 );
 

Modified: trunk/tp/t/test_utils.pl
===================================================================
--- trunk/tp/t/test_utils.pl    2013-08-10 15:33:48 UTC (rev 5295)
+++ trunk/tp/t/test_utils.pl    2013-08-10 16:24:15 UTC (rev 5296)
@@ -342,12 +342,12 @@
   my $reference = shift;
   my $deleted_keys = shift;
   my $test_name = shift;
-  my $trimmed = remove_keys ($compared, $deleted_keys);
+  my $trimmed = remove_keys($compared, $deleted_keys);
 no warnings 'recursion';
   cmp_deeply($trimmed, $reference, $test_name);
 }
 
-sub new_test ($;$$$)
+sub new_test($;$$$)
 {
   my $name = shift;
   my $generate = shift;
@@ -670,6 +670,11 @@
     }
     delete $parser_options->{'test_split'};
   }
+  my %todos;
+  if ($parser_options->{'todo'}) {
+    %todos = %{$parser_options->{'todo'}};
+    delete $parser_options->{'todo'};
+  }
   my $split_pages = '';
   if ($parser_options->{'test_split_pages'}) {
     $split_pages = $parser_options->{'test_split_pages'};
@@ -970,7 +975,14 @@
         $test_name.' indices');
     ok (Texinfo::Convert::Texinfo::convert($result) eq 
$result_texis{$test_name}, 
          $test_name.' texi');
-    ok ($converted_text eq $result_texts{$test_name}, $test_name.' text');
+    if ($todos{'text'}) {
+      TODO: {
+        local $TODO = $todos{'text'};
+        ok ($converted_text eq $result_texts{$test_name}, $test_name.' text');
+      }
+    } else {
+      ok ($converted_text eq $result_texts{$test_name}, $test_name.' text');
+    }
     $tests_count = $nr_comparisons;
     if (defined($result_directions_text{$test_name})) {
       cmp_trimmed($elements, $result_elements{$test_name}, 
@@ -992,8 +1004,16 @@
             $reference_exists = 1;
             $tests_count += 1;
             my $errors = compare_dirs_files($reference_dir, $results_dir);
-            ok (!defined($errors), $test_name.' converted '.$format)
-             or diag (join("\n", @$errors));
+            if ($todos{$format}) {
+              TODO: {
+                local $TODO = $todos{$format};
+                ok (!defined($errors), $test_name.' converted '.$format)
+                  or diag (join("\n", @$errors));
+              }
+            } else {
+              ok (!defined($errors), $test_name.' converted '.$format)
+                or diag (join("\n", @$errors));
+            }
           } else {
             print STDERR "\n$format $test_name: \n$results_dir\n";
           }
@@ -1008,8 +1028,18 @@
         } else {
           $reference_exists = 1;
           $tests_count += 1;
-          ok ($converted{$format} eq $result_converted{$format}->{$test_name},
-            $test_name.' converted '.$format);
+          if ($todos{$format}) {
+            TODO: {
+              local $TODO = $todos{$format};
+              ok ($converted{$format} 
+                              eq $result_converted{$format}->{$test_name},
+                   $test_name.' converted '.$format);
+            }
+          } else {
+            ok ($converted{$format} 
+                           eq $result_converted{$format}->{$test_name},
+                $test_name.' converted '.$format);
+          }
         }
         if ($reference_exists) {
           $tests_count += 1;
@@ -1026,6 +1056,7 @@
   return $tests_count;
 }
 
+# if a $test_case_name is given, only run that test.
 sub run_all($$;$$$)
 {
   my $name = shift;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]