Author: njn
Date: 2008-03-02 22:48:14 +0000 (Sun, 02 Mar 2008)
New Revision: 7538

Log:
Ignore Emacs temporary files.  Also, produce the correct .diff filename when
the .exp filename has a non-numeric suffix.



Modified:
   trunk/helgrind/tests/tc24_nonzero_sem.stderr.exp-glibc25-amd64
   trunk/tests/vg_regtest.in


Modified: trunk/helgrind/tests/tc24_nonzero_sem.stderr.exp-glibc25-amd64
===================================================================
--- trunk/helgrind/tests/tc24_nonzero_sem.stderr.exp-glibc25-amd64      
2008-03-02 19:15:15 UTC (rev 7537)
+++ trunk/helgrind/tests/tc24_nonzero_sem.stderr.exp-glibc25-amd64      
2008-03-02 22:48:14 UTC (rev 7538)
@@ -1,3 +1,3 @@
 
 
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+RROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Modified: trunk/tests/vg_regtest.in
===================================================================
--- trunk/tests/vg_regtest.in   2008-03-02 19:15:15 UTC (rev 7537)
+++ trunk/tests/vg_regtest.in   2008-03-02 22:48:14 UTC (rev 7538)
@@ -64,7 +64,8 @@
 # Expected stdout (filtered) is kept in <test>.stdout.exp* (can be more
 # than one expected output).  It can be missing if it would be empty.  Expected
 # stderr (filtered) is kept in <test>.stderr.exp*.   There must be at least
-# one stderr.exp* file.
+# one stderr.exp* file.  Any .exp* file that ends in '~' or '#' is ignored;
+# this is because Emacs creates temporary files of these names.
 #
 # The prerequisite command, if present, must return 0 otherwise the test is
 # skipped.  The post-test command, if present, must return 0 and its stdout
@@ -263,22 +264,27 @@
     for my $f_exp (@$f_exps) {
         (-r $f_exp) or die "Could not read `$f_exp'\n";
 
-        my $n = "";
-        if ($f_exp =~ /.*\.exp(\d*)/) {
-            $n = $1;
-        } else {
-            $n = "";
-            ($f_exp eq "/dev/null") or die "Unexpected .exp file: $f_exp\n";
-        }
+        # Emacs produces temporary files that end in '~' and '#'.  We ignore
+        # these.
+        if ($f_exp !~ /[~#]$/) {
+            # $n is the (optional) suffix after the ".exp";  we tack it onto
+            # the ".diff" file.
+            my $n = "";
+            if ($f_exp =~ /.*\.exp(.*)$/) {
+                $n = $1;
+            } else {
+                $n = "";
+                ($f_exp eq "/dev/null") or die "Unexpected .exp file: 
$f_exp\n";
+            }
 
-        #print("diff $f_exp $name.$mid.out > $name.$mid.diff$n\n");
-        mysystem("diff $f_exp $name.$mid.out > $name.$mid.diff$n");
+            mysystem("diff $f_exp $name.$mid.out > $name.$mid.diff$n");
 
-        if (not -s "$name.$mid.diff$n") {
-            # A match;  remove .out and any previously created .diff files.
-            unlink("$name.$mid.out");
-            unlink(<$name.$mid.diff*>);
-            return;
+            if (not -s "$name.$mid.diff$n") {
+                # A match;  remove .out and any previously created .diff files.
+                unlink("$name.$mid.out");
+                unlink(<$name.$mid.diff*>);
+                return;
+            }
         }
     }
     # If we reach here, none of the .exp files matched.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
Valgrind-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to