Browse Source

Fix caseid merging

Alois Mahdal 6 years ago
parent
commit
f1b226a59c

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

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

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

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

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

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

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

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