Преглед на файлове

Hide non-deterministic data from from traceback in tests

Alois Mahdal преди 6 години
родител
ревизия
a00a52dba2
променени са 1 файла, в които са добавени 10 реда и са изтрити 3 реда
  1. 10
    3
      tests/basic/TF_RUN

+ 10
- 3
tests/basic/TF_RUN Целия файл

@@ -76,9 +76,9 @@ mka() {
76 76
         inv_xpath:o_err)
77 77
             echo 'Invalid expression'
78 78
             echo 'Traceback (most recent call last):'
79
-            echo '  File "/usr/libexec/shellfu-bash-pxpath/pxpath", line 54, in <module>'
79
+            echo '  File _SOME_FILE_, line _SOME_LINE_, in <module>'
80 80
             echo '    matches = context.xpathEvalExpression(expr)'
81
-            echo '  File "/usr/lib64/python2.7/site-packages/libxml2.py", line 7346, in xpathEvalExpression'
81
+            echo '  File _SOME_FILE_, line _SOME_LINE_, in xpathEvalExpression'
82 82
             echo "    if ret is None:raise xpathError('xmlXPathEvalExpression() failed')"
83 83
             echo 'libxml2.xpathError: xmlXPathEvalExpression() failed'
84 84
             ;;
@@ -112,6 +112,7 @@ mka() {
112 112
 
113 113
 runtest() {
114 114
     local xpath
115
+    local r_es=0
115 116
     mkdir -p "test" "result/$name"
116 117
     mkxml > "test.xml"
117 118
     xpath=$(mka xpath)
@@ -122,7 +123,13 @@ runtest() {
122 123
         io_adir)        pxpath "$xpath" oracle ;;
123 124
         io_pipe)        <"test.xml" pxpath "$xpath" - ;;
124 125
         *)  pxpath  "$xpath" "test.xml" ;;
125
-    esac
126
+    esac >out.cache 2>err.cache; r_es=$?
127
+    cat out.cache
128
+    <err.cache sed '
129
+        /^  File /s/File ".*",/File _SOME_FILE_,/
130
+        /^  File /s/line [1-9][0-9]*,/line _SOME_LINE_,/
131
+    ' >&2
132
+    return $r_es
126 133
 }
127 134
 
128 135
 tf_do_subtest() {