mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
Report duration of each test
This commit is contained in:
parent
2a62e18635
commit
8e2d207869
2 changed files with 6 additions and 2 deletions
|
@ -45,12 +45,14 @@ end
|
|||
function test_file
|
||||
set -l file $argv[1]
|
||||
echo -n "Testing file $file ... "
|
||||
set starttime (date +%s)
|
||||
begin
|
||||
set -lx TERM dumb
|
||||
expect -n -c 'source interactive.expect.rc' -f $file >$file.tmp.out 2>$file.tmp.err
|
||||
end
|
||||
set -l exit_status $status
|
||||
set -l res ok
|
||||
set test_duration (math (date +%s) - $starttime)
|
||||
mv -f interactive.tmp.log $file.tmp.log
|
||||
|
||||
diff $file.tmp.out $file.out >/dev/null
|
||||
|
@ -59,7 +61,7 @@ function test_file
|
|||
set -l err_status $status
|
||||
|
||||
if test $out_status -eq 0 -a $err_status -eq 0 -a $exit_status -eq 0
|
||||
say green "ok"
|
||||
say green "ok ($test_duration sec)"
|
||||
# clean up tmp files
|
||||
rm -f $file.tmp.{err,out,log}
|
||||
return 0
|
||||
|
|
|
@ -34,10 +34,12 @@ function test_file
|
|||
set -l base (basename $file .in)
|
||||
|
||||
echo -n "Testing file $file ... "
|
||||
set starttime (date +%s)
|
||||
|
||||
../test/root/bin/fish <$file >$base.tmp.out 2>$base.tmp.err
|
||||
set -l exit_status $status
|
||||
set -l res ok
|
||||
set test_duration (math (date +%s) - $starttime)
|
||||
|
||||
diff $base.tmp.out $base.out >/dev/null
|
||||
set -l out_status $status
|
||||
|
@ -45,7 +47,7 @@ function test_file
|
|||
set -l err_status $status
|
||||
|
||||
if test $out_status -eq 0 -a $err_status -eq 0 -a $exit_status -eq 0
|
||||
say green "ok"
|
||||
say green "ok ($test_duration sec)"
|
||||
# clean up tmp files
|
||||
rm -f $base.tmp.{err,out}
|
||||
return 0
|
||||
|
|
Loading…
Reference in a new issue