Blame SOURCES/unified-footer.patch

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