Sfoglia il codice sorgente

Make phase and session verdicts a bit smarter

Will show ERROR if there were errors in phase, and nothing (no PASS) if
there were no asserts at all (typical for diag phase).
Alois Mahdal 6 anni fa
parent
commit
6a907d3eae
1 ha cambiato i file con 31 aggiunte e 9 eliminazioni
  1. 31
    9
      src/jat.sh.skel

+ 31
- 9
src/jat.sh.skel Vedi File

@@ -1132,14 +1132,25 @@ __jat__show_pend() {
1132 1132
     local pverd     # phase verdict text
1133 1133
     local pname     # ^^ name
1134 1134
     local pnhint    # ^^ ^^ display
1135
+    local errors    # count of errors
1136
+    local warnings  # ^^ warnings
1137
+    local asserts   # ^^ asserts
1138
+    local fails     # ^^ fails
1135 1139
     pname=$(__jat__sd_keyr P.name)
1140
+    errors=$(jat__stat perrc)
1141
+    warnings=$(jat__stat pwarc)
1142
+    asserts=$(jat__stat pasrtc)
1143
+    fails=$(jat__stat pfailc)
1136 1144
     test "$pname" == "_jat_anon_phase_" || pnhint=" '$pname'"
1137
-    case "$(jat__stat pfailc)" in
1138
-        0)  pverd="$__JAT__SWORD_PASS" ;;
1139
-        *)  pverd="$__JAT__SWORD_FAIL" ;;
1145
+    case $errors:$warnings:$asserts:$fails in
1146
+        0:0:0:*) pverd=""                        ;;
1147
+        0:0:*:0) pverd=".$__JAT__SWORD_PASS"     ;;
1148
+        0:0:*:*) pverd=".$__JAT__SWORD_FAIL"     ;;
1149
+        0:*:*:*) pverd=".$__JAT__SWORD_TWARNING" ;;
1150
+        *:*:*:*) pverd=".$__JAT__SWORD_TERROR  " ;;
1140 1151
     esac
1141 1152
     __jat__show \
1142
-        "$__JAT__SWORD_PHASE.$__JAT__SWORD_END.$pverd$pnhint" \
1153
+        "$__JAT__SWORD_PHASE.$__JAT__SWORD_END$pverd$pnhint" \
1143 1154
         ""
1144 1155
 }
1145 1156
 
@@ -1158,13 +1169,24 @@ __jat__show_sfinish() {
1158 1169
     #
1159 1170
     # Show message about session $1 finalization to stderr
1160 1171
     #
1161
-    local sverd         # session verdict text
1162
-    case "$(jat__stat sfailc)" in
1163
-        0)  sverd="$__JAT__SWORD_PASS" ;;
1164
-        *)  sverd="$__JAT__SWORD_FAIL" ;;
1172
+    local sverd     # session verdict text
1173
+    local errors    # count of errors
1174
+    local warnings  # ^^ warnings
1175
+    local asserts   # ^^ asserts
1176
+    local fails     # ^^ fails
1177
+    errors=$(jat__stat serrc)
1178
+    warnings=$(jat__stat swarc)
1179
+    asserts=$(jat__stat sasrtc)
1180
+    fails=$(jat__stat sfailc)
1181
+    case $errors:$warnings:$asserts:$fails in
1182
+        0:0:0:*) sverd=""                        ;;
1183
+        0:0:*:0) sverd=".$__JAT__SWORD_PASS"     ;;
1184
+        0:0:*:*) sverd=".$__JAT__SWORD_FAIL"     ;;
1185
+        0:*:*:*) sverd=".$__JAT__SWORD_TWARNING" ;;
1186
+        *:*:*:*) sverd=".$__JAT__SWORD_TERROR"   ;;
1165 1187
     esac
1166 1188
     __jat__show \
1167
-        "$__JAT__SWORD_SESSION.$__JAT__SWORD_FINALIZE.$sverd"
1189
+        "$__JAT__SWORD_SESSION.$__JAT__SWORD_FINALIZE$sverd"
1168 1190
 }
1169 1191
 
1170 1192
 __jat__show_sinitn() {