From: Tobias Brunner Date: Wed, 9 Feb 2022 17:54:23 +0000 (+0100) Subject: testing: Print the actual start time of a command for `do-tests -t` X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b47e9919f5c0beb6d809c0e65f531057487f758b;p=people%2Fms%2Fstrongswan.git testing: Print the actual start time of a command for `do-tests -t` Because the command line, together with the results, is printed after executing it, there could have been weird delays between commands. --- diff --git a/testing/do-tests b/testing/do-tests index 9e3b3464e..ace12b86b 100755 --- a/testing/do-tests +++ b/testing/do-tests @@ -449,6 +449,7 @@ do } printf("cmd_err=\044(tempfile -p test -s err); ") printf("cmd_out=\044(tempfile -p test -s out); ") + printf("start_time=\044(print_time); ") if (command == "tcpdump") { printf("if [ \044TDUP_%s == \"true\" ]; then stop_tcpdump %s; fi; \n", host, host) @@ -475,11 +476,11 @@ do printf("if [ \044cmd_fail -ne 0 ]; then echo \"~~~~~~~ FAIL ~~~~~~~\"; fi; \n") if (command == "tcpdump") { - printf("echo \"$(print_time)%s# cat /tmp/tcpdump.log | grep \047%s\047 [%s]\"; ", host, pattern, hit) + printf("echo \"\044{start_time}%s# cat /tmp/tcpdump.log | grep \047%s\047 [%s]\"; ", host, pattern, hit) } else { - printf("echo \"$(print_time)%s# %s | grep \047%s\047 [%s]\"; ", host, command, pattern, hit) + printf("echo \"\044{start_time}%s# %s | grep \047%s\047 [%s]\"; ", host, command, pattern, hit) } printf("if [ -n \"\044cmd_res\" ]; then echo \"\044cmd_res\"; fi; \n") printf("cat \044cmd_err; \n")