From: Tobias Brunner Date: Fri, 29 Nov 2024 19:04:45 +0000 (+0100) Subject: testing: Log timestamps relative to the start of the test X-Git-Tag: 6.0.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c053bc3f053c0cf1353ffce75d5d87de4cf664d;p=thirdparty%2Fstrongswan.git testing: Log timestamps relative to the start of the test Makes it easier to compare multiple runs against each other. --- diff --git a/testing/do-tests b/testing/do-tests index 570c2e4378..89670da294 100755 --- a/testing/do-tests +++ b/testing/do-tests @@ -71,7 +71,9 @@ shift $((OPTIND-1)) function print_time() { - [ "$timestamps" == "YES" ] && echo "$(date +%T.%N) ~ " + [ "$timestamps" == "YES" ] && \ + logtime=$(date +"%s.%N") && \ + echo "$(date -d "0 +${logtime} sec -${teststart_ns} sec" +%S.%N) [$(date -d @${logtime} +%T.%N)] ~ " } ############################################################################## @@ -304,7 +306,8 @@ do testname=$SUBDIR/$name log_action " $testnumber $testname:" - teststart=$(date +%s) + teststart_ns=$(date +"%s.%N") + teststart=$(date -d "@$teststart_ns" +"%s") if [ ! -d $DEFAULTTESTSDIR/${testname} ] then