Commit bc6e33eb authored by François Perrad's avatar François Perrad
Browse files

support LuaVela

parent d3092db1
Pipeline #157468 passed with stages
in 26 seconds
......@@ -11,6 +11,7 @@ This suite is usable with :
- the standard [lua](http://www.lua.org/),
- [LuaJIT](http://luajit.org/),
- [LuaVela](https://github.com/iponweb/luavela),
- ...
See the given coverage :
......
......@@ -32,7 +32,7 @@ See section "Coroutines" in "Programming in Lua".
require'tap'
local profile = require'profile'
local has_coroutine52 = _VERSION >= 'Lua 5.2' or jit
local has_running52 = _VERSION >= 'Lua 5.2' or profile.luajit_compat52
local has_running52 = _VERSION >= 'Lua 5.2' or (profile.luajit_compat52 and not ujit)
local has_isyieldable = _VERSION >= 'Lua 5.3' or (jit and jit.version_num >= 20100)
local has_close = _VERSION >= 'Lua 5.4'
......
......@@ -2,7 +2,7 @@
--
-- lua-Harness : <https://fperrad.frama.io/lua-Harness/>
--
-- Copyright (C) 2009-2018, Perrad Francois
-- Copyright (C) 2009-2019, Perrad Francois
--
-- This code is licensed under the terms of the MIT/X11 license,
-- like Lua itself.
......@@ -28,6 +28,7 @@ L<https://www.lua.org/manual/5.3/manual.html#7>
--]]
require'tap'
local has_bytecode = not ujit
local has_error52 = _VERSION >= 'Lua 5.2'
local has_error53 = _VERSION >= 'Lua 5.3'
local has_opt_E = _VERSION >= 'Lua 5.2' or jit
......@@ -63,16 +64,18 @@ f = io.popen(cmd)
like(f:read'*l', "^[^:]+: cannot open no_file%-241%.lua", "no file")
f:close()
if jit then
os.execute(lua .. " -b hello-241.lua hello-241.luac")
else
os.execute(luac .. " -s -o hello-241.luac hello-241.lua")
if has_bytecode then
if jit then
os.execute(lua .. " -b hello-241.lua hello-241.luac")
else
os.execute(luac .. " -s -o hello-241.luac hello-241.lua")
end
cmd = lua .. " hello-241.luac"
f = io.popen(cmd)
is(f:read'*l', 'Hello World', "bytecode")
f:close()
os.remove('hello-241.luac') -- clean up
end
cmd = lua .. " hello-241.luac"
f = io.popen(cmd)
is(f:read'*l', 'Hello World', "bytecode")
f:close()
os.remove('hello-241.luac') -- clean up
if not jit then
os.execute(luac .. " -s -o hello-hello-241.luac hello-241.lua hello-241.lua")
......@@ -97,6 +100,9 @@ f:close()
cmd = lua .. " -i hello-241.lua < hello-241.lua 2>&1"
f = io.popen(cmd)
like(f:read'*l', '^Lua', "-i")
if ujit then
like(f:read'*l', '^JIT:')
end
is(f:read'*l', 'Hello World')
f:close()
......
......@@ -2,7 +2,7 @@
--
-- lua-Harness : <https://fperrad.frama.io/lua-Harness/>
--
-- Copyright (C) 2009-2018, Perrad Francois
-- Copyright (C) 2009-2019, Perrad Francois
--
-- This code is licensed under the terms of the MIT/X11 license,
-- like Lua itself.
......@@ -36,7 +36,7 @@ local has_mathx = _VERSION < 'Lua 5.3' or profile.compat52 or profile.compat53 o
local has_log10 = _VERSION < 'Lua 5.2' or profile.compat51 or profile.has_math_log10 or
profile.compat52 or profile.compat53 or profile.has_mathx
local has_log_with_base = _VERSION >= 'Lua 5.2' or profile.compat52
local has_mod = profile.has_math_mod
local has_mod = profile.has_math_mod or ujit
local nocvts2n = profile.nocvts2n
plan'no_plan'
......
......@@ -2,7 +2,7 @@
--
-- lua-Harness : <https://fperrad.frama.io/lua-Harness/>
--
-- Copyright (C) 2009-2018, Perrad Francois
-- Copyright (C) 2009-2019, Perrad Francois
--
-- This code is licensed under the terms of the MIT/X11 license,
-- like Lua itself.
......@@ -31,7 +31,7 @@ L<https://www.lua.org/manual/5.3/manual.html#6.8>
require'tap'
local profile = require'profile'
local has_write51 = _VERSION == 'Lua 5.1' and not profile.luajit_compat52
local has_write51 = _VERSION == 'Lua 5.1' and (not profile.luajit_compat52 or ujit)
local has_lines52 = _VERSION >= 'Lua 5.2' or profile.luajit_compat52
local has_read52 = _VERSION >= 'Lua 5.2' or profile.luajit_compat52
local has_read53 = _VERSION >= 'Lua 5.3' or (jit and jit.version_num >= 20100)
......
......@@ -2,7 +2,7 @@
--
-- lua-Harness : <https://fperrad.frama.io/lua-Harness/>
--
-- Copyright (C) 2009-2018, Perrad Francois
-- Copyright (C) 2009-2019, Perrad Francois
--
-- This code is licensed under the terms of the MIT/X11 license,
-- like Lua itself.
......@@ -31,7 +31,7 @@ L<https://www.lua.org/manual/5.3/manual.html#6.9>
require'tap'
local profile = require'profile'
local has_execute51 = _VERSION == 'Lua 5.1' and not profile.luajit_compat52
local has_execute51 = _VERSION == 'Lua 5.1' and (not profile.luajit_compat52 or ujit)
local lua = arg[-3] or arg[-1]
plan'no_plan'
......
......@@ -33,7 +33,7 @@ require 'tap'
local profile = require'profile'
local has_getfenv = _VERSION == 'Lua 5.1'
local has_getlocal52 = _VERSION >= 'Lua 5.2' or profile.luajit_compat52
local has_setmetatable52 = _VERSION >= 'Lua 5.2' or profile.luajit_compat52
local has_setmetatable52 = _VERSION >= 'Lua 5.2' or (profile.luajit_compat52 and not ujit)
local has_getuservalue = _VERSION >= 'Lua 5.2' or profile.luajit_compat52
local has_getuservalue54 = _VERSION >= 'Lua 5.4'
local has_upvalueid = _VERSION >= 'Lua 5.2' or jit
......
......@@ -2,7 +2,7 @@
--
-- lua-Harness : <https://fperrad.frama.io/lua-Harness/>
--
-- Copyright (C) 2018, Perrad Francois
-- Copyright (C) 2018-2019, Perrad Francois
--
-- This code is licensed under the terms of the MIT/X11 license,
-- like Lua itself.
......@@ -32,7 +32,7 @@ end
local compiled_with_jit = jit.status()
local has_jit_opt = compiled_with_jit
local has_jit_util = jit.version_num < 20100
local has_jit_util = (jit.version_num < 20100) and not ujit
plan'no_plan'
......
......@@ -2,7 +2,7 @@
--
-- lua-Harness : <https://fperrad.frama.io/lua-Harness/>
--
-- Copyright (C) 2018, Perrad Francois
-- Copyright (C) 2018-2019, Perrad Francois
--
-- This code is licensed under the terms of the MIT/X11 license,
-- like Lua itself.
......@@ -26,7 +26,7 @@ See L<http://luajit.org/running.html>
require'tap'
if not jit then
if not jit or ujit then
skip_all("only with LuaJIT")
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment