test: spawn_wait() starts a non-RPC Nvim process

Problem:
Can't use `n.clear()` to test non-RPC `nvim` invocations. So tests end
up creating ad-hoc wrappers around `system()` or `jobstart()`.

Solution:
- Introduce `n.spawn_wait()`
- TODO (followup PR): Rename `n.spawn()` and `n.spawn_wait()`.
  It's misleading that `n.spawn()` returns a RPC session...
This commit is contained in:
Justin M. Keyes
2024-09-12 03:04:33 +02:00
parent fe87656f29
commit a1ba655dee
8 changed files with 214 additions and 80 deletions

View File

@@ -634,6 +634,7 @@ int main(int argc, char **argv)
if (params.luaf != NULL) {
// Like "--cmd", "+", "-c" and "-S", don't truncate messages.
msg_scroll = true;
DLOG("executing Lua -l script");
bool lua_ok = nlua_exec_file(params.luaf);
TIME_MSG("executing Lua -l script");
if (msg_didout) {