Fix. Supports Lua 5.3.beta

master
Alexey Melnichuk 2014-11-26 13:58:56 +04:00
parent 47f68fa1a0
commit 15f4b2d53a
7 changed files with 43 additions and 12 deletions

View File

@ -6,6 +6,7 @@ env:
matrix:
- LUA=lua5.1
- LUA=lua5.2
- LUA=lua5.3
- LUA=luajit
branches:
@ -15,11 +16,11 @@ branches:
before_install:
- sudo apt-get update
- bash .travis/setup_lua.sh
- sudo luarocks install lunitx
- sudo luarocks install https://raw.github.com/moteus/lunit/moteus-skip/rockspecs/lunitx-scm.mot.skip-0.rockspec
- sudo pip install cpp-coveralls
- sudo luarocks install dkjson
- sudo luarocks install luafilesystem
- sudo luarocks install lua-path
- sudo luarocks install dkjson --deps-mode=none
- sudo luarocks install luafilesystem --from=https://rocks.moonscript.org/dev
- sudo luarocks install lua-path --deps-mode=none
- sudo luarocks install luacov-coveralls
install:

View File

@ -56,6 +56,9 @@ else
elif [ "$LUA" == "lua5.2" ]; then
curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz
cd lua-5.2.3;
elif [ "$LUA" == "lua5.3" ]; then
curl http://www.lua.org/work/lua-5.3.0-beta.tar.gz | tar xz
cd lua-5.3.0-beta;
fi
sudo make $PLATFORM install;
fi
@ -93,4 +96,6 @@ elif [ "$LUA" == "lua5.1" ]; then
rm -rf lua-5.1.5;
elif [ "$LUA" == "lua5.2" ]; then
rm -rf lua-5.2.3;
elif [ "$LUA" == "lua5.3" ]; then
rm -rf lua-5.3.0-beta;
fi

View File

@ -14,6 +14,23 @@
#include "lua.h"
#include "lauxlib.h"
#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */
#ifndef luaL_optint
# define luaL_optint luaL_optinteger
#endif
#ifndef luaL_checkint
# define luaL_checkint luaL_checkinteger
#endif
#ifndef luaL_checklong
# define luaL_checklong luaL_checkinteger
#endif
#endif
#if LUA_VERSION_NUM >= 502 // lua 5.2
// lua_rawgetp

View File

@ -1,13 +1,15 @@
local RUN = lunit and function()end or function ()
local lunit, RUN = lunit do
RUN = lunit and function()end or function ()
local res = lunit.run()
if res.errors + res.failed > 0 then
os.exit(-1)
end
return os.exit(0)
end
lunit = require "lunit"
end
local _,luacov = pcall(require, "luacov")
local lunit = require "lunit"
local TEST_CASE = assert(lunit.TEST_CASE)
local skip = lunit.skip or function() end

View File

@ -1,12 +1,14 @@
local RUN = lunit and function()end or function ()
local lunit, RUN = lunit do
RUN = lunit and function()end or function ()
local res = lunit.run()
if res.errors + res.failed > 0 then
os.exit(-1)
end
return os.exit(0)
end
lunit = require "lunit"
end
local lunit = require "lunit"
local TEST_CASE = assert(lunit.TEST_CASE)
local skip = lunit.skip or function() end

View File

@ -1,12 +1,14 @@
local RUN = lunit and function()end or function ()
local lunit, RUN = lunit do
RUN = lunit and function()end or function ()
local res = lunit.run()
if res.errors + res.failed > 0 then
os.exit(-1)
end
return os.exit(0)
end
lunit = require "lunit"
end
local lunit = require "lunit"
local TEST_CASE = assert(lunit.TEST_CASE)
local skip = lunit.skip or function() end

View File

@ -1,12 +1,14 @@
local RUN = lunit and function()end or function ()
local lunit, RUN = lunit do
RUN = lunit and function()end or function ()
local res = lunit.run()
if res.errors + res.failed > 0 then
os.exit(-1)
end
return os.exit(0)
end
lunit = require "lunit"
end
local lunit = require "lunit"
local TEST_CASE = assert(lunit.TEST_CASE)
local skip = lunit.skip or function() end