[Tarantool-patches] [PATCH luajit v3 15/29] test: disable PUC-Rio test for per-coroutine hooks

Sergey Kaplun skaplun at tarantool.org
Tue Apr 13 16:27:15 MSK 2021


LuaJIT does not support per-coroutine hooks. Hooks are set for the
whole VM. See actual status at https://luajit.org/status.html.

This patch disables tests for per-coroutine hooks in <db.lua>.

Part of tarantool/tarantool#5845
Part of tarantool/tarantool#4473
---
 test/PUC-Rio-Lua-5.1-tests/db.lua | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/test/PUC-Rio-Lua-5.1-tests/db.lua b/test/PUC-Rio-Lua-5.1-tests/db.lua
index 9ad58264..954a1d52 100644
--- a/test/PUC-Rio-Lua-5.1-tests/db.lua
+++ b/test/PUC-Rio-Lua-5.1-tests/db.lua
@@ -515,8 +515,12 @@ a,b = debug.getlocal(co, 1, 2)
 assert(a == "a" and b == 1)
 debug.setlocal(co, 1, 2, "hi")
 assert(debug.gethook(co) == foo)
-assert(table.getn(tr) == 2 and
-       tr[1] == l.currentline-1 and tr[2] == l.currentline)
+-- LuaJIT: LuaJIT does not support per-coroutine hooks.
+-- Hook is set for the whole VM.
+-- See also https://luajit.org/status.html.
+-- Test is disabled for LuaJIT.
+-- assert(table.getn(tr) == 2 and
+--        tr[1] == l.currentline-1 and tr[2] == l.currentline)
 
 a,b,c = pcall(coroutine.resume, co)
 assert(a and b and c == l.currentline+1)
@@ -524,9 +528,13 @@ checktraceback(co, {"yield", "in function <"})
 
 a,b = coroutine.resume(co)
 assert(a and b == "hi")
-assert(table.getn(tr) == 4 and tr[4] == l.currentline+2)
+-- LuaJIT: Behavior is different for LuaJIT.
+-- See the comment above. Test is disabled for LuaJIT.
+-- assert(table.getn(tr) == 4 and tr[4] == l.currentline+2)
 assert(debug.gethook(co) == foo)
-assert(debug.gethook() == nil)
+-- LuaJIT: Behavior is different for LuaJIT.
+-- See the comment above. Test is disabled for LuaJIT.
+-- assert(debug.gethook() == nil)
 checktraceback(co, {})
 
 
-- 
2.31.0



More information about the Tarantool-patches mailing list