Browse Source

Support t., o., and r. prefixes for assert data

Alois Mahdal 6 years ago
parent
commit
8532b0f97e

+ 8
- 7
src/jat.sh.skel View File

171
         __jat__etype=FAIL
171
         __jat__etype=FAIL
172
     fi
172
     fi
173
     __jat__assert $__jat__etype "$__jat__hint" "${__jat__beids[@]}" \
173
     __jat__assert $__jat__etype "$__jat__hint" "${__jat__beids[@]}" \
174
-        -- "CMDLINE=${__jat__cmd[*]}" "ES_EXPR=$__jat__o_es" "ES=$__jat__r_es"
174
+        -- "t.cmd=${__jat__cmd[*]}" "o.es_expr=$__jat__o_es" "r.es=$__jat__r_es"
175
     return "$__jat__r_es"
175
     return "$__jat__r_es"
176
 }
176
 }
177
 
177
 
217
     case $cmpes in
217
     case $cmpes in
218
         0)
218
         0)
219
             __jat__assert PASS "$hint" "${beids[@]}" \
219
             __jat__assert PASS "$hint" "${beids[@]}" \
220
-                -- "RVAL=$RVal" "OP=$Op" "OVAL=$OVal"
220
+                -- "r.val=$RVal" "t.op=$Op" "o.val=$OVal"
221
             ;;
221
             ;;
222
         1)
222
         1)
223
             __jat__assert FAIL "$hint" "${beids[@]}" \
223
             __jat__assert FAIL "$hint" "${beids[@]}" \
224
-                -- "RVAL=$RVal" "OP=$Op" "OVAL=$OVal"
224
+                -- "r.val=$RVal" "t.op=$Op" "o.val=$OVal"
225
             ;;
225
             ;;
226
         *)
226
         *)
227
             __jat__usage "bad syntax: $RVal $Op $OVal"
227
             __jat__usage "bad syntax: $RVal $Op $OVal"
301
         __jat__etype=FAIL
301
         __jat__etype=FAIL
302
     fi
302
     fi
303
     __jat__assert $__jat__etype "$__jat__hint" "${__jat__beids[@]}" \
303
     __jat__assert $__jat__etype "$__jat__hint" "${__jat__beids[@]}" \
304
-        -- "CODE=$__jat__code" "ES_EXPR=$__jat__o_es" "ES=$__jat__r_es"
304
+        -- "t.code=$__jat__code" "o.es_expr=$__jat__o_es" "r.es=$__jat__r_es"
305
     return "$__jat__r_es"
305
     return "$__jat__r_es"
306
 }
306
 }
307
 
307
 
784
     # You can provide any amount of KEY=VALUE pairs, meaning of which
784
     # You can provide any amount of KEY=VALUE pairs, meaning of which
785
     # is specific to every assert function.  (The assert function name
785
     # is specific to every assert function.  (The assert function name
786
     # is auto-detected and logged so that you can infer KEY meanings
786
     # is auto-detected and logged so that you can infer KEY meanings
787
-    # later.)
788
-    #
787
+    # later.)  Each KEY must be simple word, except that prefixes of
788
+    # `t.`, `r.`, and `o.` are allowed to signify that the value logged
789
+    # is relevant to test method, result or oracle, respectively.
789
     local etype=$1; shift
790
     local etype=$1; shift
790
     local hint=$1;    shift
791
     local hint=$1;    shift
791
     local arg
792
     local arg
1176
     # True if $1 is a valid BEID
1177
     # True if $1 is a valid BEID
1177
     #
1178
     #
1178
     local tainted=$1
1179
     local tainted=$1
1179
-    grep -qx '[[:alpha:]_][[:alnum:]_]*=.*' <<<"$tainted"
1180
+    grep -qx '\([tor][.]\)\?[[:alpha:]_][[:alnum:]_]*=.*' <<<"$tainted"
1180
 }
1181
 }
1181
 
1182
 
1182
 __jat__yamls() {
1183
 __jat__yamls() {

+ 6
- 6
tests/basic/oracle/ylog_both.stdout View File

48
             true is true
48
             true is true
49
         beids: []
49
         beids: []
50
         data:
50
         data:
51
-            CMDLINE: |
51
+            t.cmd: |
52
                 true
52
                 true
53
-            ES_EXPR: |
53
+            o.es_expr: |
54
                 0
54
                 0
55
-            ES: |
55
+            r.es: |
56
                 0
56
                 0
57
         phase:
57
         phase:
58
             id: phasid-1
58
             id: phasid-1
78
             false is true
78
             false is true
79
         beids: []
79
         beids: []
80
         data:
80
         data:
81
-            CMDLINE: |
81
+            t.cmd: |
82
                 false
82
                 false
83
-            ES_EXPR: |
83
+            o.es_expr: |
84
                 0
84
                 0
85
-            ES: |
85
+            r.es: |
86
                 1
86
                 1
87
         phase:
87
         phase:
88
             id: phasid-1
88
             id: phasid-1

+ 6
- 6
tests/basic/oracle/ylog_fail.stdout View File

48
             true is false
48
             true is false
49
         beids: []
49
         beids: []
50
         data:
50
         data:
51
-            CMDLINE: |
51
+            t.cmd: |
52
                 true
52
                 true
53
-            ES_EXPR: |
53
+            o.es_expr: |
54
                 1
54
                 1
55
-            ES: |
55
+            r.es: |
56
                 0
56
                 0
57
         phase:
57
         phase:
58
             id: phasid-1
58
             id: phasid-1
78
             false is true
78
             false is true
79
         beids: []
79
         beids: []
80
         data:
80
         data:
81
-            CMDLINE: |
81
+            t.cmd: |
82
                 false
82
                 false
83
-            ES_EXPR: |
83
+            o.es_expr: |
84
                 0
84
                 0
85
-            ES: |
85
+            r.es: |
86
                 1
86
                 1
87
         phase:
87
         phase:
88
             id: phasid-1
88
             id: phasid-1

+ 6
- 6
tests/basic/oracle/ylog_pass.stdout View File

48
             true is true
48
             true is true
49
         beids: []
49
         beids: []
50
         data:
50
         data:
51
-            CMDLINE: |
51
+            t.cmd: |
52
                 true
52
                 true
53
-            ES_EXPR: |
53
+            o.es_expr: |
54
                 0
54
                 0
55
-            ES: |
55
+            r.es: |
56
                 0
56
                 0
57
         phase:
57
         phase:
58
             id: phasid-1
58
             id: phasid-1
78
             false is false
78
             false is false
79
         beids: []
79
         beids: []
80
         data:
80
         data:
81
-            CMDLINE: |
81
+            t.cmd: |
82
                 false
82
                 false
83
-            ES_EXPR: |
83
+            o.es_expr: |
84
                 1
84
                 1
85
-            ES: |
85
+            r.es: |
86
                 1
86
                 1
87
         phase:
87
         phase:
88
             id: phasid-1
88
             id: phasid-1