+# Start timer for time measurement
+# args - (any args will be printed though)
+start_timer() {
+ echo -e $BOLD"INFO(${BASH_LINENO[0]}): "${FUNCNAME[0]}"," $@ $EBOLD
+ TC_TIMER=$SECONDS
+ echo " Timer started"
+}
+
+# Print the value of the time (in seconds)
+# args - <timer message to print> - timer value and message will be printed both on screen
+# and in the timer measurement report
+print_timer() {
+ echo -e $BOLD"INFO(${BASH_LINENO[0]}): "${FUNCNAME[0]}"," $@ $EBOLD
+ if [ $# -lt 1 ]; then
+ ((RES_CONF_FAIL++))
+ __print_err "need 1 or more args, <timer message to print>" $@
+ exit 1
+ fi
+ duration=$(($SECONDS-$TC_TIMER))
+ if [ $duration -eq 0 ]; then
+ duration="<1 second"
+ else
+ duration=$duration" seconds"
+ fi
+ echo " Timer duration :" $duration
+
+ echo -e "${@:1} \t $duration" >> $TIMER_MEASUREMENTS
+}
+
+# Print the value of the time (in seconds) and reset the timer
+# args - <timer message to print> - timer value and message will be printed both on screen
+# and in the timer measurement report
+print_and_reset_timer() {
+ echo -e $BOLD"INFO(${BASH_LINENO[0]}): "${FUNCNAME[0]}"," $@ $EBOLD
+ if [ $# -lt 1 ]; then
+ ((RES_CONF_FAIL++))
+ __print_err "need 1 or more args, <timer message to print>" $@
+ exit 1
+ fi
+ duration=$(($SECONDS-$TC_TIMER))" seconds"
+ if [ $duration -eq 0 ]; then
+ duration="<1 second"
+ else
+ duration=$duration" seconds"
+ fi
+ echo " Timer duration :" $duration
+ TC_TIMER=$SECONDS
+ echo " Timer reset"
+
+ echo -e "${@:1} \t $duration" >> $TIMER_MEASUREMENTS
+
+}
+# Print info about a deviations from intended tests
+# Each deviation counted is also printed in the testreport
+# args <deviation message to print>
+deviation() {
+ echo -e $BOLD"DEVIATION(${BASH_LINENO[0]}): "${FUNCNAME[0]} $EBOLD
+ if [ $# -lt 1 ]; then
+ ((RES_CONF_FAIL++))
+ __print_err "need 1 or more args, <deviation message to print>" $@
+ exit 1
+ fi
+ ((RES_DEVIATION++))
+ echo -e $BOLD$YELLOW" Test case deviation: ${@:1}"$EYELLOW$EBOLD
+ echo "Line: ${BASH_LINENO[0]} - ${@:1}" >> $DEVIATION_FILE
+ echo ""
+}