Fix errors in test script
This commit is contained in:
parent
6304a3bcd1
commit
777aca25c8
1 changed files with 12 additions and 3 deletions
15
script/test
15
script/test
|
|
@ -126,11 +126,20 @@ case ${mode} in
|
|||
function write_log_file {
|
||||
echo "<!DOCTYPE html><style>svg { width: 100%; margin-bottom: 20px; }</style>" > log.html
|
||||
line_count=$(grep -n '^$' log.dot | tail -1 | cut -f1 -d:)
|
||||
head -n $line_count log.dot | dot -Tsvg >> log.html
|
||||
echo "Wrote log.html ($line_count lines)"
|
||||
if [[ -n $line_count ]]; then
|
||||
head -n $line_count log.dot | dot -Tsvg >> log.html
|
||||
else
|
||||
cat log.dot | dot -Tsvg >> log.html
|
||||
fi
|
||||
echo "Wrote log.html - $line_count"
|
||||
}
|
||||
|
||||
function handle_sigint { echo; write_log_file; }
|
||||
function handle_sigint {
|
||||
trap '' SIGINT
|
||||
echo
|
||||
write_log_file
|
||||
exit 0
|
||||
}
|
||||
trap handle_sigint SIGINT
|
||||
|
||||
$cmd "${args[@]}" 2> log.dot || export status=$?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue