mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 11:19:35 +01:00
Allow tracking the start and end time of tests
This commit is contained in:
parent
1e622145b2
commit
8442d587ce
1 changed files with 5 additions and 0 deletions
|
|
@ -7,6 +7,8 @@ green=""
|
||||||
yellow=""
|
yellow=""
|
||||||
normal=""
|
normal=""
|
||||||
|
|
||||||
|
TESTS_TIMER_LOG=${TESTS_TIMER_LOG:-/dev/null}
|
||||||
|
|
||||||
post_run_msg="ran test $1..."
|
post_run_msg="ran test $1..."
|
||||||
if [ -t 1 ]; then
|
if [ -t 1 ]; then
|
||||||
red="[31;1m"
|
red="[31;1m"
|
||||||
|
|
@ -17,7 +19,10 @@ fi
|
||||||
(cd tests && env ${TESTS_ENVIRONMENT} init.sh 2>/dev/null > /dev/null)
|
(cd tests && env ${TESTS_ENVIRONMENT} init.sh 2>/dev/null > /dev/null)
|
||||||
|
|
||||||
start_time=$(date -u +%s)
|
start_time=$(date -u +%s)
|
||||||
|
echo "$(date -u +%s) $1 start" >> "$TESTS_TIMER_LOG"
|
||||||
log="$(cd $(dirname $1) && env ${TESTS_ENVIRONMENT} $(basename $1) 2>&1)"
|
log="$(cd $(dirname $1) && env ${TESTS_ENVIRONMENT} $(basename $1) 2>&1)"
|
||||||
|
status=$?
|
||||||
|
echo "$(date -u +%s) $1 stop" >> "$TESTS_TIMER_LOG"
|
||||||
stop_time=$(date -u +%s)
|
stop_time=$(date -u +%s)
|
||||||
elapsed_time=$(($stop_time-$start_time))
|
elapsed_time=$(($stop_time-$start_time))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue