Browse Source

Fix caseid merging

Alois Mahdal 6 years ago
parent
commit
f1b226a59c

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

@@ -893,13 +893,12 @@ __jat__log_event() {
893 893
     local EType=$1; shift
894 894
     local msg
895 895
     local meatfn
896
-    local caseid=$JAT__TEST_ID
897 896
     local beids=()
898 897
     local data=()
899 898
     local origin=${FUNCNAME[1]}
900 899
     local pcaseid
901 900
     local CaseIdBase=$JAT__TEST_ID
902
-    pcaseid=$(__jat__sd_keyR P.caseid)
901
+    pcaseid=$(__jat__sd_keyR P.pcaseid)
903 902
     test -n "$pcaseid" && CaseIdBase+=":$pcaseid"
904 903
     case $EType in
905 904
         ASSERT.PASS|ASSERT.FAIL) : ;;
@@ -936,7 +935,7 @@ __jat__log_event() {
936 935
 
937 936
 __jat__log_evt_pstart() {
938 937
     #
939
-    #     __jat__log_event PHASE.START ID NAME TYPE [caseid=CASEID] [pdir=PDIR]
938
+    #     __jat__log_event PHASE.START ID NAME TYPE [pcaseid=CASEID] [pdir=PDIR]
940 939
     #
941 940
     local pid=$1; shift
942 941
     local pname=$1; shift
@@ -963,6 +962,10 @@ __jat__log_evt_assert() {
963 962
     local hint=$1; shift
964 963
     local caseid=$1; shift
965 964
     local data=("$@")
965
+    case $caseid in
966
+        "") caseid=$CaseIdBase ;;
967
+        *)  caseid=$CaseIdBase:$caseid ;;
968
+    esac
966 969
     __jat__yamls 2 hint "$hint"
967 970
     __jat__yamls 2 caseid "$caseid"
968 971
     __jat__yamld 2 data "${data[@]}"
@@ -1026,9 +1029,9 @@ __jat__pstart() {
1026 1029
     __jat__sd_keyw phase "$newphase"
1027 1030
     __jat__sd_keyw P.type "$type"
1028 1031
     __jat__sd_keyw P.name "$name"
1029
-    __jat__sd_keyw P.caseid "$pcaseid"
1032
+    __jat__sd_keyw P.pcaseid "$pcaseid"
1030 1033
     __jat__show_pstart "$name"
1031
-    __jat__log_event PHASE.START "$newphase" "$name" "$type" "caseid=$pcaseid" "pdir=$pdir"
1034
+    __jat__log_event PHASE.START "$newphase" "$name" "$type" "pcaseid=$pcaseid" "pdir=$pdir"
1032 1035
     test -n "$pdir" && {
1033 1036
         __jat__sd_keyw P.pdir "$pdir"
1034 1037
         __jat__sd_keyw P.PWD "$PWD"

+ 5
- 3
tests/basic/oracle/ylog_both.stdout View File

@@ -19,7 +19,7 @@ events:
19 19
             name: |-4
20 20
                 _jat_anon_phase_
21 21
         data:
22
-            caseid: ~
22
+            pcaseid: ~
23 23
             pdir: ~
24 24
     -
25 25
         etype: MESSAGE.INFO
@@ -32,7 +32,8 @@ events:
32 32
         stamp: time-5
33 33
         hint: |-4
34 34
             true is true
35
-        caseid: ~
35
+        caseid: |-4
36
+            _jat_anon_test_
36 37
         data:
37 38
             t.cmd: |-4
38 39
                 true
@@ -51,7 +52,8 @@ events:
51 52
         stamp: time-7
52 53
         hint: |-4
53 54
             false is true
54
-        caseid: ~
55
+        caseid: |-4
56
+            _jat_anon_test_
55 57
         data:
56 58
             t.cmd: |-4
57 59
                 false

+ 5
- 3
tests/basic/oracle/ylog_fail.stdout View File

@@ -19,7 +19,7 @@ events:
19 19
             name: |-4
20 20
                 _jat_anon_phase_
21 21
         data:
22
-            caseid: ~
22
+            pcaseid: ~
23 23
             pdir: ~
24 24
     -
25 25
         etype: MESSAGE.INFO
@@ -32,7 +32,8 @@ events:
32 32
         stamp: time-5
33 33
         hint: |-4
34 34
             true is false
35
-        caseid: ~
35
+        caseid: |-4
36
+            _jat_anon_test_
36 37
         data:
37 38
             t.cmd: |-4
38 39
                 true
@@ -51,7 +52,8 @@ events:
51 52
         stamp: time-7
52 53
         hint: |-4
53 54
             false is true
54
-        caseid: ~
55
+        caseid: |-4
56
+            _jat_anon_test_
55 57
         data:
56 58
             t.cmd: |-4
57 59
                 false

+ 5
- 3
tests/basic/oracle/ylog_pass.stdout View File

@@ -19,7 +19,7 @@ events:
19 19
             name: |-4
20 20
                 _jat_anon_phase_
21 21
         data:
22
-            caseid: ~
22
+            pcaseid: ~
23 23
             pdir: ~
24 24
     -
25 25
         etype: MESSAGE.INFO
@@ -32,7 +32,8 @@ events:
32 32
         stamp: time-5
33 33
         hint: |-4
34 34
             true is true
35
-        caseid: ~
35
+        caseid: |-4
36
+            _jat_anon_test_
36 37
         data:
37 38
             t.cmd: |-4
38 39
                 true
@@ -51,7 +52,8 @@ events:
51 52
         stamp: time-7
52 53
         hint: |-4
53 54
             false is false
54
-        caseid: ~
55
+        caseid: |-4
56
+            _jat_anon_test_
55 57
         data:
56 58
             t.cmd: |-4
57 59
                 false