From 5e20abef8ddd15daefdb4e6323d5be8feb1711c0 Mon Sep 17 00:00:00 2001 From: Magnus Malm Date: Tue, 23 Feb 2021 00:24:54 +0100 Subject: [PATCH] test: Print running test name with log() Signed-off-by: Magnus Malm --- test/lib.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/lib.sh b/test/lib.sh index c87ccd5a..fc85507c 100755 --- a/test/lib.sh +++ b/test/lib.sh @@ -21,7 +21,7 @@ fg_red='\e[1;31m' fg_green='\e[1;32m' fg_yellow='\e[1;33m' log() { - printf "< TEST > %b%b%b %s\n" "$1" "$2" "$color_reset" "$3" + printf "< $TEST_NAME > %b%b%b %s\n" "$1" "$2" "$color_reset" "$3" } assert() { @@ -92,6 +92,9 @@ FINIT_CONF=$(grep FINIT_CONF "$TEST_DIR/../config.h" | cut -d' ' -f3 | cut -d'"' export FINIT_CONF FINIT_CONF_DIR="$(dirname "$FINIT_CONF")"/finit.d export FINIT_CONF_DIR +TEST_NAME="$(dirname "$0")" +TEST_NAME=${TEST_NAME#*/} +export TEST_NAME log "$color_reset" 'Test start' '' log "$color_reset" '--' ''