summaryrefslogtreecommitdiffstats
path: root/TOOLS/lua/command-test.lua
diff options
context:
space:
mode:
Diffstat (limited to 'TOOLS/lua/command-test.lua')
-rw-r--r--TOOLS/lua/command-test.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/TOOLS/lua/command-test.lua b/TOOLS/lua/command-test.lua
index 1a8d86b4dd..79c1127cbf 100644
--- a/TOOLS/lua/command-test.lua
+++ b/TOOLS/lua/command-test.lua
@@ -64,4 +64,20 @@ mp.observe_property("vo-configured", "bool", function(_, v)
print("aborting sleep inf subprocess after timeout")
mp.abort_async_command(x)
end)
+
+ -- This should get killed on script exit.
+ mp.command_native_async({name = "subprocess", playback_only = false,
+ args = {"sleep", "inf"}}, function()end)
+
+ -- Runs detached; should be killed on player exit (forces timeout)
+ mp.command_native({_flags={"async"}, name = "subprocess",
+ playback_only = false, args = {"sleep", "inf"}})
+end)
+
+mp.register_event("shutdown", function()
+ -- This "freezes" the script, should be killed via timeout.
+ print("freeze!")
+ local x = mp.command_native({name = "subprocess", playback_only = false,
+ args = {"sleep", "inf"}})
+ print("done, killed=" .. utils.to_string(x.killed_by_us))
end)