diff options
author | davidovski <david@davidovski.xyz> | 2023-06-09 14:43:30 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2023-06-09 14:43:30 +0100 |
commit | f09c82886544e3fb14c1853b656029339fa688b5 (patch) | |
tree | 6440b7b1cd1ee5a03160aa1f8ca9180b3a477802 | |
parent | 6a2afa3b8e9f57974b7302afcc0f4ebe6d63f57c (diff) |
Add timing to shtests
-rw-r--r-- | src/util/shtests.sh | 9 | ||||
-rwxr-xr-x | test/hbar.sh | 2 | ||||
-rwxr-xr-x | test/parseconf.sh | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/util/shtests.sh b/src/util/shtests.sh index 69da232..44ad48e 100644 --- a/src/util/shtests.sh +++ b/src/util/shtests.sh @@ -48,6 +48,7 @@ passed=0 failed=0 printf "${BLUE}Running $total tests: \n" +start=$(date +%s%N) for name in $tests; do if runtest "$name" "test_$name"; then passed=$((passed+1)) @@ -55,10 +56,12 @@ for name in $tests; do failed=$((failed+1)) fi done +end=$(date +%s%N) -printf "\n${BLUE}Summary for $total tests:\n" -printf "\t${PASS} $passed\n" -printf "\t${FAIL} $failed\n" +printf "\n${BLUE}Summary for %s tests:\n" "$total" +printf "\t${PASS} %s\n" "$passed" +printf "\t${FAIL} %s\n" "$failed" +printf "\n${LIGHT_BLUE}%s${BLUE} tests completed in ${LIGHT_BLUE}%sms\n" "$total" "$(((end-start)/1000000))" printf "\n" [ "$passed" = "$total" ] || exit 1 diff --git a/test/hbar.sh b/test/hbar.sh index eada165..c01ee25 100755 --- a/test/hbar.sh +++ b/test/hbar.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/shtests HBAR=./dist/hbar UNIT="mb" diff --git a/test/parseconf.sh b/test/parseconf.sh index 1cd668f..6eb50dc 100755 --- a/test/parseconf.sh +++ b/test/parseconf.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/shtests PARSECONF="./dist/parseconf" SIMPLECONF="./test/simple.conf" |