Skip to content

Commit 8a9d0a0

Browse files
committed
Merge pull request #45 from moteus/master
Fix. Supports Lua 5.3.beta
2 parents 2a61d4d + 06505f0 commit 8a9d0a0

File tree

8 files changed

+44
-13
lines changed

8 files changed

+44
-13
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ env:
66
matrix:
77
- LUA=lua5.1
88
- LUA=lua5.2
9+
- LUA=lua5.3
910
- LUA=luajit
1011

1112
branches:
@@ -15,11 +16,11 @@ branches:
1516
before_install:
1617
- sudo apt-get update
1718
- bash .travis/setup_lua.sh
18-
- sudo luarocks install lunitx
19+
- sudo luarocks install https://raw.github.com/moteus/lunit/moteus-skip/rockspecs/lunitx-scm.mot.skip-0.rockspec
1920
- sudo pip install cpp-coveralls
20-
- sudo luarocks install dkjson
21-
- sudo luarocks install luafilesystem
22-
- sudo luarocks install lua-path
21+
- sudo luarocks install dkjson --deps-mode=none
22+
- sudo luarocks install luafilesystem --from=https://rocks.moonscript.org/dev
23+
- sudo luarocks install lua-path --deps-mode=none
2324
- sudo luarocks install luacov-coveralls
2425

2526
install:

.travis/setup_lua.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ else
5656
elif [ "$LUA" == "lua5.2" ]; then
5757
curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz
5858
cd lua-5.2.3;
59+
elif [ "$LUA" == "lua5.3" ]; then
60+
curl http://www.lua.org/work/lua-5.3.0-beta.tar.gz | tar xz
61+
cd lua-5.3.0-beta;
5962
fi
6063
sudo make $PLATFORM install;
6164
fi
@@ -93,4 +96,6 @@ elif [ "$LUA" == "lua5.1" ]; then
9396
rm -rf lua-5.1.5;
9497
elif [ "$LUA" == "lua5.2" ]; then
9598
rm -rf lua-5.2.3;
99+
elif [ "$LUA" == "lua5.3" ]; then
100+
rm -rf lua-5.3.0-beta;
96101
fi

rockspecs/lua-curl-scm-0.rockspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ description = {
1515
}
1616

1717
dependencies = {
18-
"lua >= 5.1, < 5.3"
18+
"lua >= 5.1, < 5.4"
1919
}
2020

2121
external_dependencies = {

src/l52util.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@
1414
#include "lua.h"
1515
#include "lauxlib.h"
1616

17+
#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */
18+
19+
#ifndef luaL_optint
20+
# define luaL_optint luaL_optinteger
21+
#endif
22+
23+
#ifndef luaL_checkint
24+
# define luaL_checkint luaL_checkinteger
25+
#endif
26+
27+
#ifndef luaL_checklong
28+
# define luaL_checklong luaL_checkinteger
29+
#endif
30+
31+
#endif
32+
33+
1734
#if LUA_VERSION_NUM >= 502 // lua 5.2
1835

1936
// lua_rawgetp

test/test_curl.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
local RUN = lunit and function()end or function ()
1+
local lunit, RUN = lunit do
2+
RUN = lunit and function()end or function ()
23
local res = lunit.run()
34
if res.errors + res.failed > 0 then
45
os.exit(-1)
56
end
67
return os.exit(0)
78
end
9+
lunit = require "lunit"
10+
end
811

912
local _,luacov = pcall(require, "luacov")
10-
local lunit = require "lunit"
1113
local TEST_CASE = assert(lunit.TEST_CASE)
1214
local skip = lunit.skip or function() end
1315

test/test_easy.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
local RUN = lunit and function()end or function ()
1+
local lunit, RUN = lunit do
2+
RUN = lunit and function()end or function ()
23
local res = lunit.run()
34
if res.errors + res.failed > 0 then
45
os.exit(-1)
56
end
67
return os.exit(0)
78
end
9+
lunit = require "lunit"
10+
end
811

9-
local lunit = require "lunit"
1012
local TEST_CASE = assert(lunit.TEST_CASE)
1113
local skip = lunit.skip or function() end
1214

test/test_form.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
local RUN = lunit and function()end or function ()
1+
local lunit, RUN = lunit do
2+
RUN = lunit and function()end or function ()
23
local res = lunit.run()
34
if res.errors + res.failed > 0 then
45
os.exit(-1)
56
end
67
return os.exit(0)
78
end
9+
lunit = require "lunit"
10+
end
811

9-
local lunit = require "lunit"
1012
local TEST_CASE = assert(lunit.TEST_CASE)
1113
local skip = lunit.skip or function() end
1214

test/test_safe.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
local RUN = lunit and function()end or function ()
1+
local lunit, RUN = lunit do
2+
RUN = lunit and function()end or function ()
23
local res = lunit.run()
34
if res.errors + res.failed > 0 then
45
os.exit(-1)
56
end
67
return os.exit(0)
78
end
9+
lunit = require "lunit"
10+
end
811

9-
local lunit = require "lunit"
1012
local TEST_CASE = assert(lunit.TEST_CASE)
1113
local skip = lunit.skip or function() end
1214

0 commit comments

Comments
 (0)