3685030
From c8b0fdde74b7cb1717454992772ab63e6cffd234 Mon Sep 17 00:00:00 2001
3685030
From: Dalibor Pospisil <dapospis@redhat.com>
3685030
Date: Fri, 2 Feb 2018 15:16:58 +0100
3685030
Subject: [PATCH 5/5] unify footer printing
3685030
3685030
make footer of the phase and also the footer of whole test formated the same
3685030
it also removes controversary strong splitter of footer
3685030
---
3685030
 src/journal.sh | 47 ++++++++++++++++++++++++++++++++++++++++-------
3685030
 1 file changed, 40 insertions(+), 7 deletions(-)
3685030
3685030
diff --git a/src/journal.sh b/src/journal.sh
3685030
index 867d08f..f3f2b78 100644
3685030
--- a/src/journal.sh
3685030
+++ b/src/journal.sh
3685030
@@ -255,8 +255,13 @@ rlJournalEnd(){
3685030
3685030
     echo "#End of metafile" >> $__INTERNAL_BEAKERLIB_METAFILE
3685030
3685030
-    __INTERNAL_LogText "Phases: $__INTERNAL_PHASES_PASSED good, $__INTERNAL_PHASES_FAILED bad" LOG 2>&1
3685030
-    __INTERNAL_LogText "RESULT: $__INTERNAL_TEST_NAME" $__INTERNAL_PHASES_WORST_RESULT 2>&1
3685030
+    __INTERNAL_PrintFootLog $__INTERNAL_STARTTIME \
3685030
+                            $__INTERNAL_ENDTIME \
3685030
+                            Phases \
3685030
+                            $__INTERNAL_PHASES_PASSED \
3685030
+                            $__INTERNAL_PHASES_FAILED \
3685030
+                            $__INTERNAL_PHASES_WORST_RESULT \
3685030
+                            "OVERALL"
3685030
3685030
     __INTERNAL_JournalXMLCreate
3685030
     __INTERNAL_TestResultsSave
3685030
@@ -603,11 +608,12 @@ rljClosePhase(){
3685030
     rlLogDebug "rljClosePhase: Phase $name closed"
3685030
     __INTERNAL_SET_TIMESTAMP
3685030
     local endtime="$__INTERNAL_TIMESTAMP"
3685030
-    __INTERNAL_LogText "________________________________________________________________________________"
3685030
-    __INTERNAL_LogText "Duration: $((endtime - __INTERNAL_PHASE_STARTTIME))s" LOG
3685030
-    __INTERNAL_LogText "Assertions: $__INTERNAL_PHASE_PASSED good, $__INTERNAL_PHASE_FAILED bad" LOG
3685030
-    __INTERNAL_LogText "RESULT: $name" $result
3685030
-    __INTERNAL_LogText ''
3685030
+    __INTERNAL_PrintFootLog $__INTERNAL_PHASE_STARTTIME \
3685030
+                            $endtime \
3685030
+                            Assertions \
3685030
+                            $__INTERNAL_PHASE_PASSED \
3685030
+                            $__INTERNAL_PHASE_FAILED \
3685030
+                            $result
3685030
     local logfile="$(mktemp)"
3685030
     tail -n +$((__INTERNAL_PHASE_TXTLOG_START+1)) $__INTERNAL_BEAKERLIB_JOURNAL_TXT > $logfile
3685030
     rlReport "$(echo "${name//[^[:alnum:]]/-}" | tr -s '-')" "$result" "$score" "$logfile"
3685030
@@ -934,6 +940,33 @@ __INTERNAL_PrintHeadLog() {
3685030
 }
3685030
3685030
3685030
+# $1 - start time
3685030
+# $2 - end time
3685030
+# $3 - stat name
3685030
+# $4 - stat good
3685030
+# $5 - stat bad
3685030
+# $6 - result
3685030
+# $7 - result prefix '<PREFIX> RESULT: <RESULT>'
3685030
+__INTERNAL_PrintFootLog(){
3685030
+  local result_colored
3685030
+  local starttime="$1"
3685030
+  local endtime="$2"
3685030
+  local stat_name="$3"
3685030
+  local stat_good="$4"
3685030
+  local stat_bad="$5"
3685030
+  local result="$6"
3685030
+  local result_pref="$7"
3685030
+  [[ -n "$result_pref" ]] && result_pref+=" "
3685030
+  __INTERNAL_colorize_prio "$result" result_colored
3685030
+  __INTERNAL_LogText "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
3685030
+  __INTERNAL_LogText "::   Duration: $((endtime - starttime))s"
3685030
+  __INTERNAL_LogText "::   $stat_name: $stat_good good, $stat_bad bad"
3685030
+  __INTERNAL_LogText "::   ${result_pref}RESULT: $result" '' '' \
3685030
+                     "::   ${result_pref}RESULT: $result_colored"
3685030
+  __INTERNAL_LogText ''
3685030
+}
3685030
+
3685030
+
3685030
 # whenever any of the persistent variable is touched,
3685030
 # functions __INTERNAL_PersistentDataLoad and __INTERNAL_PersistentDataSave
3685030
 # should be called before and after that respectively.
3685030
--
3685030
2.14.3