tests/test.lua

changeset 1963
7533549e8ba6
parent 1961
3652ef68c361
child 1972
26d4b99ba211
equal deleted inserted replaced
1962:3e7231c6d6a9 1963:7533549e8ba6
117 if not success then 117 if not success then
118 print("WARNING: ", "Failed to initialise tests for "..unitname, err); 118 print("WARNING: ", "Failed to initialise tests for "..unitname, err);
119 return; 119 return;
120 end 120 end
121 121
122 local unit = setmetatable({}, { __index = setmetatable({ module = function () end }, { __index = _G }) }); 122 local unit = setmetatable({}, { __index = setmetatable({ module = function () _M = getfenv(2); end }, { __index = _G }) });
123 123
124 local fn = "../"..unitname:gsub("%.", "/")..".lua"; 124 local fn = "../"..unitname:gsub("%.", "/")..".lua";
125 local chunk, err = loadfile(fn); 125 local chunk, err = loadfile(fn);
126 if not chunk then 126 if not chunk then
127 print("WARNING: ", "Failed to load module: "..unitname, err); 127 print("WARNING: ", "Failed to load module: "..unitname, err);

mercurial