[Tarantool-patches] [PATCH v2 luajit 15/30] test: disable PUC-Lua test for per-coroutine hooks

Sergey Kaplun skaplun at tarantool.org
Fri Mar 26 10:42:58 MSK 2021


LuaJIT does not support per-coroutine hooks.
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-Lua-5.1-tests/db.lua | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/test/PUC-Lua-5.1-tests/db.lua b/test/PUC-Lua-5.1-tests/db.lua
index c704877..8ea6af7 100644
--- a/test/PUC-Lua-5.1-tests/db.lua
+++ b/test/PUC-Lua-5.1-tests/db.lua
@@ -511,8 +511,11 @@ 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 does not support per-coroutine hooks.
+-- See also https://luajit.org/status.html.
+-- LuaJIT: 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)
@@ -520,9 +523,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)
+-- Behavior is different for LuaJIT. See the comment above.
+-- LuaJIT: 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)
+-- Behavior is different for LuaJIT. See the comment above.
+-- LuaJIT: Test is disabled for LuaJIT.
+-- assert(debug.gethook() == nil)
 checktraceback(co, {})
 
 
-- 
2.31.0



More information about the Tarantool-patches mailing list