aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorShreyansh Chouhan <chouhan.shreyansh2702@gmail.com>2021-06-13 02:53:05 +0530
committerShreyansh Chouhan <chouhan.shreyansh2702@gmail.com>2021-09-20 18:10:40 +0530
commit73d12a8b711743b1441f4029bee48cbaaf7791ec (patch)
tree07fd20364c86a36a37103cb5cb6e199150cffb5b /test/functional/helpers.lua
parent490e09c6d81b9bf52eac7aa146e62b3da2d86579 (diff)
downloadrneovim-73d12a8b711743b1441f4029bee48cbaaf7791ec.tar.gz
rneovim-73d12a8b711743b1441f4029bee48cbaaf7791ec.tar.bz2
rneovim-73d12a8b711743b1441f4029bee48cbaaf7791ec.zip
test: fix running functional tests under gdbserver
It was not possible to run the tests under the gdbserver because we were not closing the old session before starting a new one. This caused the server to not to be able to bind to the given address and crashing the tests. This commit closes the session before starting a new one. Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index a26e883370..f152a487af 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -96,10 +96,7 @@ function module.get_session()
return session
end
-function module.set_session(s, keep)
- if session and not keep then
- session:close()
- end
+function module.set_session(s)
session = s
end
@@ -366,7 +363,11 @@ local function remove_args(args, args_rm)
return new_args
end
-function module.spawn(argv, merge, env)
+function module.spawn(argv, merge, env, keep)
+ if session and not keep then
+ session:close()
+ end
+
local child_stream = ChildProcessStream.spawn(
merge and module.merge_args(prepend_argv, argv) or argv,
env)