Mercurial > prosody-hg
comparison tests/test.lua @ 7061:eda0feeaf759
Merge 0.9->0.10
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 08 Jan 2016 16:16:08 +0100 |
| parents | 8ce592e376ff ecfa474ff570 |
| children | 90e8bbfbaabd |
comparison
equal
deleted
inserted
replaced
| 7050:ae044691de0f | 7061:eda0feeaf759 |
|---|---|
| 12 package.loaded["net.connlisteners"] = { get = function () return {} end }; | 12 package.loaded["net.connlisteners"] = { get = function () return {} end }; |
| 13 dotest "util.jid" | 13 dotest "util.jid" |
| 14 dotest "util.multitable" | 14 dotest "util.multitable" |
| 15 dotest "util.rfc6724" | 15 dotest "util.rfc6724" |
| 16 dotest "util.http" | 16 dotest "util.http" |
| 17 dotest "core.modulemanager" | |
| 17 dotest "core.stanza_router" | 18 dotest "core.stanza_router" |
| 18 dotest "core.s2smanager" | 19 dotest "core.s2smanager" |
| 19 dotest "core.configmanager" | 20 dotest "core.configmanager" |
| 20 dotest "util.ip" | 21 dotest "util.ip" |
| 21 dotest "util.stanza" | 22 dotest "util.stanza" |
| 138 print("WARNING: ", "Failed to load module: "..unitname, err); | 139 print("WARNING: ", "Failed to load module: "..unitname, err); |
| 139 return; | 140 return; |
| 140 end | 141 end |
| 141 | 142 |
| 142 local oldmodule, old_M = _fakeG.module, _fakeG._M; | 143 local oldmodule, old_M = _fakeG.module, _fakeG._M; |
| 143 _fakeG.module = function () _M = unit end | 144 _fakeG.module = function () |
| 145 setmetatable(unit, nil); | |
| 146 unit._M = unit; | |
| 147 end | |
| 144 setfenv(chunk, unit); | 148 setfenv(chunk, unit); |
| 145 local success, ret = pcall(chunk); | 149 local success, err = pcall(chunk); |
| 146 _fakeG.module, _fakeG._M = oldmodule, old_M; | 150 _fakeG.module, _fakeG._M = oldmodule, old_M; |
| 147 if not success then | 151 if not success then |
| 148 print("WARNING: ", "Failed to initialise module: "..unitname, err); | 152 print("WARNING: ", "Failed to initialise module: "..unitname, err); |
| 149 return; | 153 return; |
| 150 end | 154 end |
