diff options
author | moteus <mimir@newmail.ru> | 2013-12-26 18:10:40 +0400 |
---|---|---|
committer | moteus <mimir@newmail.ru> | 2013-12-26 18:10:40 +0400 |
commit | 5291caae5be68250a4d9aafa54fe2081ab2a6113 (patch) | |
tree | 48faae28c997bbb9552feb6fe60f350dee72714b /test/test_join_timeout.lua | |
parent | 5982fd74baad6cdee2c536203afe6c435a2d02e9 (diff) | |
download | lua-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.lua | 50 |
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 @@ | |||
1 | local llthreads = require"llthreads" | 1 | local llthreads = require"llthreads" |
2 | 2 | local utils = require "utils" | |
3 | local sleep | 3 | local sleep = utils.sleep |
4 | local status, socket = pcall(require,"socket") | ||
5 | if status then | ||
6 | sleep = function(secs) | ||
7 | return socket.sleep(secs) | ||
8 | end | ||
9 | end | ||
10 | |||
11 | if 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 | ||
18 | end | ||
19 | |||
20 | if not sleep then | ||
21 | sleep = function(secs) | ||
22 | os.execute("sleep " .. tonumber(secs)) | ||
23 | end | ||
24 | end | ||
25 | 4 | ||
26 | local include = [[ | 5 | local include = [[ |
27 | local llthreads = require"llthreads" | 6 | local llthreads = require"llthreads" |
28 | 7 | ]] .. utils.thread_init .. [[ | |
29 | local sleep | 8 | local sleep = require "utils".sleep |
30 | local status, socket = pcall(require,"socket") | ||
31 | if status then | ||
32 | sleep = function(secs) | ||
33 | return socket.sleep(secs) | ||
34 | end | ||
35 | end | ||
36 | |||
37 | if 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 | ||
44 | end | ||
45 | |||
46 | if not sleep then | ||
47 | sleep = function(secs) | ||
48 | os.execute("sleep " .. tonumber(secs)) | ||
49 | end | ||
50 | end | ||
51 | ]] | 9 | ]] |
52 | 10 | ||
53 | local thread = llthreads.new(include .. [[ | 11 | local thread = llthreads.new(include .. [[ |