Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
François Perrad
lua-Harness
Commits
bc6e33eb
Commit
bc6e33eb
authored
Aug 09, 2019
by
François Perrad
Browse files
support LuaVela
parent
d3092db1
Pipeline
#157468
passed with stages
in 26 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
docs/index.md
View file @
bc6e33eb
...
...
@@ -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 :
...
...
test_lua/214-coroutine.t
View file @
bc6e33eb
...
...
@@ -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
'
...
...
test_lua/241-standalone.t
View file @
bc6e33eb
...
...
@@ -2,7 +2,7 @@
--
--
lua
-
Harness
:
<
https:
//
fperrad
.
frama
.
io
/lua-Harness/
>
--
--
Copyright
(
C
)
2009
-
201
8
,
Perrad
Francois
--
Copyright
(
C
)
2009
-
201
9
,
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
()
...
...
test_lua/307-math.t
View file @
bc6e33eb
...
...
@@ -2,7 +2,7 @@
--
--
lua
-
Harness
:
<
https:
//
fperrad
.
frama
.
io
/lua-Harness/
>
--
--
Copyright
(
C
)
2009
-
201
8
,
Perrad
Francois
--
Copyright
(
C
)
2009
-
201
9
,
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
'
...
...
test_lua/308-io.t
View file @
bc6e33eb
...
...
@@ -2,7 +2,7 @@
--
--
lua
-
Harness
:
<
https:
//
fperrad
.
frama
.
io
/lua-Harness/
>
--
--
Copyright
(
C
)
2009
-
201
8
,
Perrad
Francois
--
Copyright
(
C
)
2009
-
201
9
,
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
)
...
...
test_lua/309-os.t
View file @
bc6e33eb
...
...
@@ -2,7 +2,7 @@
--
--
lua
-
Harness
:
<
https:
//
fperrad
.
frama
.
io
/lua-Harness/
>
--
--
Copyright
(
C
)
2009
-
201
8
,
Perrad
Francois
--
Copyright
(
C
)
2009
-
201
9
,
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
'
...
...
test_lua/310-debug.t
View file @
bc6e33eb
...
...
@@ -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
...
...
test_lua/403-jit.t
View file @
bc6e33eb
...
...
@@ -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
'
...
...
test_lua/404-luajit.t
View file @
bc6e33eb
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment