test/run: Support a "ui-in" file containing json-rpc messages

With this "ui-in", tests can execute json-rpc commands from the UI
at startup to set a specific UI state.
This commit is contained in:
Maxime Coste 2018-05-19 09:59:06 +10:00
parent 851494a374
commit a64afd7f1a

View File

@ -54,11 +54,14 @@ main() {
continue continue
fi fi
ui_in="${root}/${dir}/ui-in"
[ ! -f $ui_in ] && ui_in="/dev/tty"
number_tests=$(($number_tests + 1)) number_tests=$(($number_tests + 1))
touch in; cp in out touch in; cp in out
session="kak-tests" session="kak-tests"
rm -f $tmpdir/kakoune/$USER/$session rm -f $tmpdir/kakoune/$USER/$session
$root/../src/kak out -n -s "$session" -ui json -e "$kak_commands" > ui-out $root/../src/kak out -n -s "$session" -ui json -e "$kak_commands" > ui-out < "${ui_in}"
retval=$? retval=$?
failed=0 failed=0
if [ ! -e error ]; then # failure not expected if [ ! -e error ]; then # failure not expected