aboutsummaryrefslogtreecommitdiff
path: root/test/test_join_timeout.lua
diff options
context:
space:
mode:
authormoteus <mimir@newmail.ru>2013-12-26 18:10:40 +0400
committermoteus <mimir@newmail.ru>2013-12-26 18:10:40 +0400
commit5291caae5be68250a4d9aafa54fe2081ab2a6113 (patch)
tree48faae28c997bbb9552feb6fe60f350dee72714b /test/test_join_timeout.lua
parent5982fd74baad6cdee2c536203afe6c435a2d02e9 (diff)
downloadlua-llthreads2-5291caae5be68250a4d9aafa54fe2081ab2a6113.tar.gz
lua-llthreads2-5291caae5be68250a4d9aafa54fe2081ab2a6113.tar.bz2
lua-llthreads2-5291caae5be68250a4d9aafa54fe2081ab2a6113.zip
Update tests.
Diffstat (limited to 'test/test_join_timeout.lua')
-rw-r--r--test/test_join_timeout.lua50
1 files changed, 4 insertions, 46 deletions
diff --git a/test/test_join_timeout.lua b/test/test_join_timeout.lua
index 5beac2b..085497f 100644
--- a/test/test_join_timeout.lua
+++ b/test/test_join_timeout.lua
@@ -1,53 +1,11 @@
1local llthreads = require"llthreads" 1local llthreads = require"llthreads"
2 2local utils = require "utils"
3local sleep 3local sleep = utils.sleep
4local status, socket = pcall(require,"socket")
5if status then
6 sleep = function(secs)
7 return socket.sleep(secs)
8 end
9end
10
11if not sleep then
12 local status, ztimer = pcall(require, "lzmq.timer")
13 if status then
14 sleep = function(secs)
15 ztimer.sleep(secs * 1000)
16 end
17 end
18end
19
20if not sleep then
21 sleep = function(secs)
22 os.execute("sleep " .. tonumber(secs))
23 end
24end
25 4
26local include = [[ 5local include = [[
27local llthreads = require"llthreads" 6local llthreads = require"llthreads"
28 7]] .. utils.thread_init .. [[
29local sleep 8local sleep = require "utils".sleep
30local status, socket = pcall(require,"socket")
31if status then
32 sleep = function(secs)
33 return socket.sleep(secs)
34 end
35end
36
37if not sleep then
38 local status, ztimer = pcall(require, "lzmq.timer")
39 if status then
40 sleep = function(secs)
41 ztimer.sleep(secs * 1000)
42 end
43 end
44end
45
46if not sleep then
47 sleep = function(secs)
48 os.execute("sleep " .. tonumber(secs))
49 end
50end
51]] 9]]
52 10
53local thread = llthreads.new(include .. [[ 11local thread = llthreads.new(include .. [[