From 0ea9557cb7f85bcbffe1147a55ee741c957e8beb Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 22 Mar 2020 14:30:59 +0800 Subject: update tests --- tests/modules/process/process_autoexit.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/modules/process/process_autoexit.lua (limited to 'tests/modules/process/process_autoexit.lua') diff --git a/tests/modules/process/process_autoexit.lua b/tests/modules/process/process_autoexit.lua new file mode 100644 index 000000000..584aaa04d --- /dev/null +++ b/tests/modules/process/process_autoexit.lua @@ -0,0 +1,13 @@ +import("core.base.process") +import("core.base.scheduler") + +function main(cmd) + for i = 1, 10 do + scheduler.co_start(function () + process.open(cmd or "xmake l os.sleep 60000") + end) + end + -- check processes status after exiting + -- we need terminate all unclosed processes automatically after parent process is exited + -- ps aux | grep sleep +end -- cgit v1.3.1