tests bsim: run_parallel: Print how long tests take
To give an idea of which tests are taking too long either on CI or locally. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
parent
795044ec6d
commit
b0339136c1
1 changed files with 5 additions and 2 deletions
|
@ -77,9 +77,12 @@ echo -n "" > $tmp_res_file
|
|||
if [ `command -v parallel` ]; then
|
||||
parallel '
|
||||
echo "<testcase name=\"{}\" time=\"0\">"
|
||||
start=$(date +%s%N)
|
||||
{} $@ &> {#}.log
|
||||
dur=$(($(date +%s%N) - $start))
|
||||
dur_s=$(awk -vdur=$dur "BEGIN { printf(\"%0.3f\", dur/1000000000)}")
|
||||
if [ $? -ne 0 ]; then
|
||||
(>&2 echo -e "\e[91m{} FAILED\e[39m")
|
||||
(>&2 echo -e "\e[91m{} FAILED\e[39m ($dur_s s)")
|
||||
(>&2 cat {#}.log)
|
||||
echo "<failure message=\"failed\" type=\"failure\">"
|
||||
cat {#}.log | eval $CLEAN_XML
|
||||
|
@ -88,7 +91,7 @@ if [ `command -v parallel` ]; then
|
|||
echo "</testcase>"
|
||||
exit 1
|
||||
else
|
||||
(>&2 echo -e "{} PASSED")
|
||||
(>&2 echo -e "{} PASSED ($dur_s s)")
|
||||
rm {#}.log
|
||||
echo "</testcase>"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue