Added event_poll function; optimization experiments

This commit is contained in:
Olof hagsand 2017-09-15 17:24:51 +02:00
parent 624b949b3f
commit 687641e944
6 changed files with 148 additions and 20 deletions

View file

@ -80,6 +80,24 @@ EOF
fi
}
# clixon tester read from file for large tests
expecteof_file(){
cmd=$1
file=$2
expect=$3
# Do while read stuff
ret=$($cmd<$file)
# Match if both are empty string
if [ -z "$ret" -a -z "$expect" ]; then
return
fi
match=`echo "$ret" | grep -Eo "$expect"`
if [ -z "$match" ]; then
err "$expect" "$ret"
fi
}
# clixon tester. First arg is command second is stdin and
# third is expected outcome, fourth is how long to wait
expectwait(){