texinfo-commits
[Top][All Lists]
Advanced

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

[5584] Make tests reproducible.


From: Patrice Dumas
Subject: [5584] Make tests reproducible.
Date: Sun, 18 May 2014 23:34:08 +0000

Revision: 5584
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5584
Author:   pertusus
Date:     2014-05-18 23:34:07 +0000 (Sun, 18 May 2014)
Log Message:
-----------
Make tests reproducible.

Modified Paths:
--------------
    trunk/texi2html/T2h_l2h.pm
    trunk/texi2html/TODO
    trunk/texi2html/test/coverage/tests-parser.txt
    trunk/texi2html/test/coverage/tests.txt
    trunk/texi2html/test/many_input_files/tex_l2h.sh
    trunk/texi2html/test/run_parser_all.sh
    trunk/texi2html/test/run_test_all.sh
    trunk/texi2html/texi2html.pl

Modified: trunk/texi2html/T2h_l2h.pm
===================================================================
--- trunk/texi2html/T2h_l2h.pm  2014-05-18 22:52:04 UTC (rev 5583)
+++ trunk/texi2html/T2h_l2h.pm  2014-05-18 23:34:07 UTC (rev 5584)
@@ -581,8 +581,9 @@
         main::document_error ("l2h: could not open $docu_rdir$l2h_cache_file 
for writing: $!");
         return;
     }
-    while (($key, $value) = each %l2h_cache)
-    {
+    #while (($key, $value) = each %l2h_cache)
+    foreach my $key(sort(keys(%l2h_cache))) {
+        $value = $l2h_cache{$key};
         # escape stuff
         $key =~ s|/|\\/|g;
         $key =~ s|\\\\/|\\/|g;

Modified: trunk/texi2html/TODO
===================================================================
--- trunk/texi2html/TODO        2014-05-18 22:52:04 UTC (rev 5583)
+++ trunk/texi2html/TODO        2014-05-18 23:34:07 UTC (rev 5584)
@@ -1,3 +1,18 @@
+Regenerate tests:
+sh autogen.sh
+./configure
+make
+make check-local
+cd test
+./manage_test_archives.sh get
+cd ..
+tar xzvf t2h_tests_files.tar.gz
+cd test
+./base_tests
+./long_tests
+./tex_html_tests 
+make copy-tests copy-tex-html
+
 This file contains a list of things yet to be done:
 
 Note

Modified: trunk/texi2html/test/coverage/tests-parser.txt
===================================================================
--- trunk/texi2html/test/coverage/tests-parser.txt      2014-05-18 22:52:04 UTC 
(rev 5583)
+++ trunk/texi2html/test/coverage/tests-parser.txt      2014-05-18 23:34:07 UTC 
(rev 5584)
@@ -5,7 +5,7 @@
 texi imbrications.texi
 texi formats_titles.texi
 texi delcomment.texi
-#texi line_commands_comment.texi
+texi line_commands_comment.texi
 comments comments.texi
 formatting formatting.texi address@hidden@internal_links_formatting.txt
 pass0_macros pass0_macros.texi
@@ -15,4 +15,4 @@
 # -debug 255
 comments_info comments.texi --info -U texi2html
 delcomment delcomment.texi
-#line_commands_comment line_commands_comment.texi
+line_commands_comment line_commands_comment.texi

Modified: trunk/texi2html/test/coverage/tests.txt
===================================================================
--- trunk/texi2html/test/coverage/tests.txt     2014-05-18 22:52:04 UTC (rev 
5583)
+++ trunk/texi2html/test/coverage/tests.txt     2014-05-18 23:34:07 UTC (rev 
5584)
@@ -15,4 +15,5 @@
 # -debug 255
 comments_info comments.texi --info -U texi2html
 delcomment delcomment.texi
+# result is incorrect, in menu end of line is swallowed.
 #line_commands_comment line_commands_comment.texi

Modified: trunk/texi2html/test/many_input_files/tex_l2h.sh
===================================================================
--- trunk/texi2html/test/many_input_files/tex_l2h.sh    2014-05-18 22:52:04 UTC 
(rev 5583)
+++ trunk/texi2html/test/many_input_files/tex_l2h.sh    2014-05-18 23:34:07 UTC 
(rev 5584)
@@ -28,8 +28,8 @@
 
 [ -d $basename ] && rm -rf $basename
 mkdir $basename
-echo "perl -w -x $srcdir/../../texi2html.pl --set-init-var 'TEST 1' 
--set-init-var 'L2H_TMP $tmp_dir' --conf-dir $srcdir/../../examples --l2h 
--l2h-file $srcdir/../../examples/l2h.init --expand tex --out $basename/ 
$srcdir/../manuals/mini_ker.texi $srcdir/../formatting/tex.texi >> $stdout_file 
2>$basename/${basename}.2" >> $logfile
-perl -w -x $srcdir/../../texi2html.pl --set-init-var 'TEST 1' --set-init-var 
"L2H_TMP $tmp_dir" --conf-dir $srcdir/../../examples --l2h --l2h-file 
$srcdir/../../examples/l2h.init --expand tex --out $basename/ 
$srcdir/../manuals/mini_ker.texi $srcdir/../formatting/tex.texi >> $stdout_file 
2>$basename/${basename}.2
+echo "perl -w -x $srcdir/../../texi2html.pl --set-init-var 'TEST 1' 
--set-init-var 'L2H_CLEAN 0' --set-init-var 'L2H_TMP $tmp_dir' --conf-dir 
$srcdir/../../examples --l2h --l2h-file $srcdir/../../examples/l2h.init 
--expand tex --out $basename/ $srcdir/../manuals/mini_ker.texi 
$srcdir/../formatting/tex.texi >> $stdout_file 2>$basename/${basename}.2" >> 
$logfile
+perl -w -x $srcdir/../../texi2html.pl --set-init-var 'TEST 1' --set-init-var 
'L2H_CLEAN 0' --set-init-var "L2H_TMP $tmp_dir" --conf-dir 
$srcdir/../../examples --l2h --l2h-file $srcdir/../../examples/l2h.init 
--expand tex --out $basename/ $srcdir/../manuals/mini_ker.texi 
$srcdir/../formatting/tex.texi >> $stdout_file 2>$basename/${basename}.2
 
 return_code=0
 ret=$?
@@ -44,7 +44,8 @@
    's/with LaTeX2HTML.*/with LaTeX2HTML/' "$basename/"*"_l2h.html"
   sed -i -e 's/^# LaTeX2HTML.*/# LaTeX2HTML/' "$basename/"*"_l2h_images.pl"  
"$basename/"*"_l2h_labels.pl"
   sed -i -e 's/WIDTH="\([0-9]*\)\([0-9]\)"/WIDTH="100"/' -e 
's/HEIGHT="\([0-9]*\)\([0-9]\)"/HEIGHT="12"/' "$basename/"*"_l2h_images.pl" 
"$basename/"*.html "$basename/"*-l2h_cache.pm
-  rm -f "$basename/"*".aux"  "$basename/"*"_l2h_images.out"
+  # order of entries in *_l2h_images is not reproducible
+  rm -f "$basename/"*".aux"  "$basename/"*"_l2h_images.out" 
"$basename/"*"_l2h_images.pl"
   for dir in ${basename}; do
     if [ -d $srcdir/${dir}_res ]; then
       diff -u --exclude=CVS --exclude=.svn --exclude='*.png' -r 
"$srcdir/${dir}_res" "${dir}" 2>>$logfile > "$diffs_dir/$dir.diff"

Modified: trunk/texi2html/test/run_parser_all.sh
===================================================================
--- trunk/texi2html/test/run_parser_all.sh      2014-05-18 22:52:04 UTC (rev 
5583)
+++ trunk/texi2html/test/run_parser_all.sh      2014-05-18 23:34:07 UTC (rev 
5584)
@@ -295,7 +295,8 @@
           sed -i -e 's/WIDTH="\([0-9]*\)\([0-9]\)"/WIDTH="100"/' -e 
's/HEIGHT="\([0-9]*\)\([0-9]\)"/HEIGHT="\10"/' "$file"
          fi
         done
-        rm -f "${outdir}$dir/"*".aux"  "${outdir}$dir/"*"_images.out"
+        # entries order in *_images.pl is not reproducible
+        rm -f "${outdir}$dir/"*".aux"  "${outdir}$dir/"*"_images.out" 
"${outdir}$dir/"*"_images.pl"
       fi
       if [ "$use_latex2html" = 'yes' -o "$use_tex4ht" = 'yes' ]; then
         rm -f "${outdir}$dir/$basename.1"

Modified: trunk/texi2html/test/run_test_all.sh
===================================================================
--- trunk/texi2html/test/run_test_all.sh        2014-05-18 22:52:04 UTC (rev 
5583)
+++ trunk/texi2html/test/run_test_all.sh        2014-05-18 23:34:07 UTC (rev 
5584)
@@ -246,10 +246,12 @@
       mkdir "${outdir}$dir"
       remaining_out_dir=`echo $remaining | sed 
's,@OUT_DIR@,'"${outdir}$dir/"',g'`
       echo "$command $dir" >> $logfile
-      echo "perl -w -x $command_run $format_option --force --conf-dir 
$testdir/$srcdir_test/../../maintained_extra --conf-dir 
$testdir/$srcdir_test/../../examples --conf-dir 
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ 
--conf-dir $testdir/$srcdir_test/../ -I $testdir/$srcdir_test/ -I 
$testdir/$srcdir_test/../ --set-init-var 
L2H_FILE=$testdir/$srcdir_test/../../examples/l2h.init --error-limit=1000 
--set-init-var TEST=1 $l2h_tmp_dir --output ${outdir}$dir/ $remaining_out_dir 
$src_file > ${outdir}$dir/$basename.1 2>${outdir}$dir/$basename.2" >> $logfile
-      eval "perl -w -x $command_run $format_option --force --conf-dir 
$testdir/$srcdir_test/../../maintained_extra --conf-dir 
$testdir/$srcdir_test/../../examples --conf-dir 
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ 
--conf-dir $testdir/$srcdir_test/../ -I $testdir/$srcdir_test/ -I 
$testdir/$srcdir_test/../ --set-init-var 
L2H_FILE=$testdir/$srcdir_test/../../examples/l2h.init --error-limit=1000 
--set-init-var TEST=1 $l2h_tmp_dir --output ${outdir}$dir/ $remaining_out_dir 
$src_file > ${outdir}$dir/$basename.1 2>${outdir}$dir/$basename.2"
+      echo "perl -w -x $command_run $format_option --force --conf-dir 
$testdir/$srcdir_test/../../maintained_extra --conf-dir 
$testdir/$srcdir_test/../../examples --conf-dir 
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ 
--conf-dir $testdir/$srcdir_test/../ -I $testdir/$srcdir_test/ -I 
$testdir/$srcdir_test/../ --set-init-var 
L2H_FILE=$testdir/$srcdir_test/../../examples/l2h.init --error-limit=1000 
--set-init-var TEST=1 --set-init-var L2H_CLEAN=0 $l2h_tmp_dir --output 
${outdir}$dir/ $remaining_out_dir $src_file > ${outdir}$dir/$basename.1 
2>${outdir}$dir/$basename.2" >> $logfile
+      eval "perl -w -x $command_run $format_option --force --conf-dir 
$testdir/$srcdir_test/../../maintained_extra --conf-dir 
$testdir/$srcdir_test/../../examples --conf-dir 
$testdir/$srcdir_test/../../formats --conf-dir $testdir/$srcdir_test/ 
--conf-dir $testdir/$srcdir_test/../ -I $testdir/$srcdir_test/ -I 
$testdir/$srcdir_test/../ --set-init-var 
L2H_FILE=$testdir/$srcdir_test/../../examples/l2h.init --error-limit=1000 
--set-init-var TEST=1 --set-init-var L2H_CLEAN=0 $l2h_tmp_dir --output 
${outdir}$dir/ $remaining_out_dir $src_file > ${outdir}$dir/$basename.1 
2>${outdir}$dir/$basename.2"
       ret=$?
-      rm -f ${outdir}$dir/*_l2h_images.log ${outdir}$dir/*_tex4ht_*.log \
+      # *_l2h_images.pl has not reproducible cached entries
+      rm -f ${outdir}$dir/*_l2h_images.log ${outdir}$dir/*_l2h_images.pl \
+        ${outdir}$dir/*_tex4ht_*.log \
         ${outdir}$dir/*_tex4ht_*.idv ${outdir}$dir/*_tex4ht_*.dvi \
         ${outdir}$dir/*_tex4ht_tex.html* ${outdir}$dir/*_l2h.html.*
     fi

Modified: trunk/texi2html/texi2html.pl
===================================================================
--- trunk/texi2html/texi2html.pl        2014-05-18 22:52:04 UTC (rev 5583)
+++ trunk/texi2html/texi2html.pl        2014-05-18 23:34:07 UTC (rev 5584)
@@ -5205,6 +5205,7 @@
                             # in reading order. Each member is a reference
                             # on a hash which also appears in %nodes,
                             # @sections_list @nodes_list, @elements_list
+my @headings_list;          # headings in reading order.
 my @elements_list;          # all the resulting elements in document order
 my %sections;               # sections hash. The key is the section number
 my %headings;               # headings hash. The key is the heading number
@@ -6577,7 +6578,7 @@
     my $style_kept = $Texi2HTML::Config::style;
     $Texi2HTML::Config::style = \&Texi2HTML::Config::T2H_GPL_style;
 
-    foreach my $key (keys(%nodes))
+    foreach my $key (sort(keys(%nodes)))
     {
         my $node = $nodes{$key};
         #print STDERR "CROSS_MANUAL:$key,$node\n";
@@ -7180,7 +7181,7 @@
     print STDERR "# Resolve nodes directions\n" if ($T2H_DEBUG & 
$DEBUG_ELEMENTS);
     foreach my $node (@nodes_list)
     {
-        foreach my $direction (keys(%node_directions))
+        foreach my $direction (sort(keys(%node_directions)))
         {
             if (defined($node->{$direction}))
             {
@@ -7224,7 +7225,7 @@
     # (have same node id) than an existing node
     foreach my $node (@nodes_with_unknown_directions)
     {
-        foreach my $direction (keys(%node_directions))
+        foreach my $direction (sort(keys(%node_directions)))
         { 
             if (defined($node->{$direction}) and 
!$node->{$node_directions{$direction}})
             {
@@ -7845,7 +7846,7 @@
     }
 
     # use %sections and %headings to modify also the headings
-    foreach my $section (values(%sections), values(%headings))
+    foreach my $section (@sections_list, @headings_list)
     {
         if (get_conf('NEW_CROSSREF_STYLE') and ($section->{'cross'} =~ /\S/))
         {
@@ -8401,7 +8402,7 @@
    # This seems right, however, as we don't want @refs or @footnotes
    # or @anchors within nodes, section commands or anchors.
    $global_pass = '2 node names';
-   foreach my $node (keys(%nodes))
+   foreach my $node (sort(keys(%nodes)))
    {
        my $texi = &$Texi2HTML::Config::heading_texi($nodes{$node}->{'tag'}, 
           $nodes{$node}->{'texi'}, undef);
@@ -9330,7 +9331,7 @@
 # write to files with name the node name for cross manual references.
 sub do_node_files()
 {
-    foreach my $key (keys(%nodes))
+    foreach my $key (sort(keys(%nodes)))
     {
         my $node = $nodes{$key};
         next unless ($node->{'node_file'});
@@ -9373,7 +9374,7 @@
 # do redirection files for renamed nodes
 sub do_renamed_node_files()
 {
-    foreach my $old_node_name (keys(%Texi2HTML::Config::renamed_nodes))
+    foreach my $old_node_name (sort(keys(%Texi2HTML::Config::renamed_nodes)))
     {
         my $new_node_name = $Texi2HTML::Config::renamed_nodes{$old_node_name};
         $old_node_name = normalise_node($old_node_name);
@@ -12293,6 +12294,7 @@
 
     foreach my $letter_entries 
(@{$Texi2HTML::THISDOC{'index_letters_array'}->{$name}})
     {
+      #print STDERR "$name: $letter_entries->{'letter'}\n";
       foreach my $entry (@{$letter_entries->{'entries'}})
       {
         #my $entry = $entries->{$key};
@@ -13692,6 +13694,7 @@
                     $state->{'heading_element'} = $heading_ref;
                     push @{$state->{'place'}}, $heading_ref;
                     $headings{$heading_ref->{'sec_num'}} = $heading_ref;
+                    push @headings_list, $heading_ref;
                 }
                 add_prev ($text, $stack, "address@hidden" .  $cline);
                 last;
@@ -17245,6 +17248,7 @@
                             # in reading order. Each member is a reference
                             # on a hash which also appears in %nodes,
                             # @sections_list @nodes_list, @elements_list
+   @headings_list = ();     # headings in reading order.
    @elements_list = ();     # all the resulting elements in document order
    %sections = ();          # sections hash. The key is the section number
    %headings = ();          # headings hash. The key is the heading number
@@ -17348,7 +17352,7 @@
    }
    if (get_conf('IDX_SUMMARY'))
    {
-      foreach my $entry (keys(%index_names))
+      foreach my $entry (sort(keys(%index_names)))
       {
          do_index_summary_file($entry, $docu_name);
       }




reply via email to

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