]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a custom filter for the drd/tests/annotate_barrier_xml regression test
authorBart Van Assche <bvanassche@acm.org>
Sat, 22 Oct 2011 16:29:11 +0000 (16:29 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sat, 22 Oct 2011 16:29:11 +0000 (16:29 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12200

drd/tests/Makefile.am
drd/tests/annotate_barrier_xml.stderr.exp
drd/tests/annotate_barrier_xml.vgtest
drd/tests/filter_annotate_barrier_xml [new file with mode: 0755]

index eadb34ab324bc0b1a7cf4dd2d74ab3f22c106e21..94b2f3d2631ecc2b0bacbbbc37444647bddf0fb2 100644 (file)
@@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.tool-tests.am
 
 dist_noinst_SCRIPTS =              \
        compare_error_count_with    \
+       filter_annotate_barrier_xml \
        filter_error_count          \
        filter_error_summary        \
        filter_stderr               \
index 4b884b24da6f8d386e9fda6747690b79ecb0a921..52e49506d9c88897ed56f7b3a9e1a8297203adb9 100644 (file)
       <ip>0x........</ip>
       <obj>...</obj>
       <fn>start_thread</fn>
-      <dir>...</dir>
-      <file>pthread_create.c</file>
-      <line>...</line>
     </frame>
   </stack>
   <auxwhat>Address 0x........ is at offset 0 from 0x.........</auxwhat>
index f0ec0ce3d5e911ef186667e90c4c5621f931adaa..1cab1599d48ec46f795fa451540d8fad38714e00 100644 (file)
@@ -1,4 +1,4 @@
 prereq: test -e annotate_barrier && ./supported_libpthread
 vgopts: --read-var-info=yes --check-stack-var=yes --show-confl-seg=no --num-callers=3 --xml=yes --xml-fd=2
 prog: annotate_barrier 2 1 1
-stderr_filter: ../../memcheck/tests/filter_xml
+stderr_filter: filter_annotate_barrier_xml
diff --git a/drd/tests/filter_annotate_barrier_xml b/drd/tests/filter_annotate_barrier_xml
new file mode 100755 (executable)
index 0000000..06a492a
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# Remove the three lines after "<fn>start_thread</fn>" if these start with
+# "<dir>...</dir>" since these last three lines are not generated on all
+# platforms.
+../../memcheck/tests/filter_xml |
+awk '{
+       if ($0 == "      <fn>start_thread</fn>") {
+         line1 = $0
+         getline
+         if ($0 == "      <dir>...</dir>") {
+           line2 = $0
+           getline
+           if ($0 == "      <file>pthread_create.c</file>") {
+             line3 = $0
+             getline
+             if ($0 == "      <line>...</line>") {
+               $0 = line1
+             } else {
+               print line1
+               print line2
+               print line3
+             }
+           } else {
+             print line1
+             print line2
+           }
+         } else {
+           print line1
+         }
+       }
+       print
+     }'