-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #243 from iNavFlight/development
V1.6.0
- Loading branch information
Showing
41 changed files
with
678 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,41 @@ | ||
os: | ||
- linux | ||
|
||
sudo: false | ||
os: linux | ||
|
||
dist: trusty | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- lua5.2 | ||
|
||
git: | ||
depth: 4 | ||
sudo: false | ||
|
||
language: c | ||
|
||
env: | ||
global: | ||
- LUAROCKS=2.3.0 | ||
matrix: | ||
- LUA=lua5.2 | ||
|
||
before_install: | ||
- source .travis/setenv_lua.sh | ||
- pip install --user cpp-coveralls | ||
- luarocks install Lua-cURL --server=https://luarocks.org/dev | ||
- luarocks install luacov-coveralls --server=https://luarocks.org/dev | ||
- luarocks install lunitx | ||
|
||
install: | ||
- luarocks make .travis/foo-scm-0.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage" | ||
|
||
script: | ||
- ./.travis/build.sh | ||
- cd test | ||
- lunit.sh test.lua | ||
|
||
after_success: | ||
- coveralls -b .. -r .. -i ./src --dump c.report.json | ||
- luacov-coveralls -j c.report.json -v | ||
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then curl -X POST https://api.telegram.org/bot797688679:AAEcKXFJ-0cDfiQLmn_hMg83FDFEtV7x2LQ/sendMessage -d chat_id=@luatelemetry -d "text=Build successful - PR #$TRAVIS_PULL_REQUEST $TRAVIS_PULL_REQUEST_BRANCH > $TRAVIS_BRANCH"; fi' | ||
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then curl -X POST https://api.telegram.org/bot797688679:AAEcKXFJ-0cDfiQLmn_hMg83FDFEtV7x2LQ/sendMessage -d chat_id=@luatelemetry -d "text=Build successful - Branch $TRAVIS_BRANCH: $TRAVIS_COMMIT_MESSAGE"; fi' | ||
|
||
script: ./bin/build.sh | ||
notifications: | ||
email: | ||
recipients: | ||
- [email protected] | ||
on_success: never | ||
on_failure: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package = "foo" | ||
version = "scm-0" | ||
|
||
source = { | ||
url = "" -- this is just make file | ||
} | ||
|
||
description = { | ||
summary = "", | ||
homepage = "", | ||
license = "MIT/X11", | ||
} | ||
|
||
dependencies = { | ||
"lua >= 5.1", | ||
} | ||
|
||
build = { | ||
copy_directories = {}, | ||
|
||
type = "builtin", | ||
|
||
modules = { | ||
[ "foo.core" ] = "src/foo.c"; | ||
[ "foo" ] = "src/lua/foo.lua"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
if [ -z "${PLATFORM:-}" ]; then | ||
PLATFORM=$TRAVIS_OS_NAME; | ||
fi | ||
|
||
if [ "$PLATFORM" == "osx" ]; then | ||
PLATFORM="macosx"; | ||
fi | ||
|
||
if [ -z "$PLATFORM" ]; then | ||
if [ "$(uname)" == "Linux" ]; then | ||
PLATFORM="linux"; | ||
else | ||
PLATFORM="macosx"; | ||
fi; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export PATH=${PATH}:$HOME/.lua:$HOME/.local/bin:${TRAVIS_BUILD_DIR}/install/luarocks/bin | ||
bash .travis/setup_lua.sh | ||
eval `$HOME/.lua/luarocks path` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
#! /bin/bash | ||
|
||
# A script for setting up environment for travis-ci testing. | ||
# Sets up Lua and Luarocks. | ||
# LUA must be "lua5.1", "lua5.2" or "luajit". | ||
# luajit2.0 - master v2.0 | ||
# luajit2.1 - master v2.1 | ||
|
||
set -eufo pipefail | ||
|
||
LUAJIT_VERSION="2.0.4" | ||
LUAJIT_BASE="LuaJIT-$LUAJIT_VERSION" | ||
|
||
source .travis/platform.sh | ||
|
||
LUA_HOME_DIR=$TRAVIS_BUILD_DIR/install/lua | ||
|
||
LR_HOME_DIR=$TRAVIS_BUILD_DIR/install/luarocks | ||
|
||
mkdir $HOME/.lua | ||
|
||
LUAJIT="no" | ||
|
||
if [ "$PLATFORM" == "macosx" ]; then | ||
if [ "$LUA" == "luajit" ]; then | ||
LUAJIT="yes"; | ||
fi | ||
if [ "$LUA" == "luajit2.0" ]; then | ||
LUAJIT="yes"; | ||
fi | ||
if [ "$LUA" == "luajit2.1" ]; then | ||
LUAJIT="yes"; | ||
fi; | ||
elif [ "$(expr substr $LUA 1 6)" == "luajit" ]; then | ||
LUAJIT="yes"; | ||
fi | ||
|
||
mkdir -p "$LUA_HOME_DIR" | ||
|
||
if [ "$LUAJIT" == "yes" ]; then | ||
|
||
if [ "$LUA" == "luajit" ]; then | ||
curl --location https://github.com/LuaJIT/LuaJIT/archive/v$LUAJIT_VERSION.tar.gz | tar xz; | ||
else | ||
git clone https://github.com/LuaJIT/LuaJIT.git $LUAJIT_BASE; | ||
fi | ||
|
||
cd $LUAJIT_BASE | ||
|
||
if [ "$LUA" == "luajit2.1" ]; then | ||
git checkout v2.1; | ||
# force the INSTALL_TNAME to be luajit | ||
perl -i -pe 's/INSTALL_TNAME=.+/INSTALL_TNAME= luajit/' Makefile | ||
fi | ||
|
||
make && make install PREFIX="$LUA_HOME_DIR" | ||
|
||
ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/luajit | ||
ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/lua; | ||
|
||
else | ||
|
||
if [ "$LUA" == "lua5.1" ]; then | ||
curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz | ||
cd lua-5.1.5; | ||
elif [ "$LUA" == "lua5.2" ]; then | ||
curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz | ||
cd lua-5.2.4; | ||
elif [ "$LUA" == "lua5.3" ]; then | ||
curl http://www.lua.org/ftp/lua-5.3.2.tar.gz | tar xz | ||
cd lua-5.3.2; | ||
fi | ||
|
||
# Build Lua without backwards compatibility for testing | ||
perl -i -pe 's/-DLUA_COMPAT_(ALL|5_2)//' src/Makefile | ||
make $PLATFORM | ||
make INSTALL_TOP="$LUA_HOME_DIR" install; | ||
|
||
ln -s $LUA_HOME_DIR/bin/lua $HOME/.lua/lua | ||
ln -s $LUA_HOME_DIR/bin/luac $HOME/.lua/luac; | ||
|
||
fi | ||
|
||
cd $TRAVIS_BUILD_DIR | ||
|
||
lua -v | ||
|
||
LUAROCKS_BASE=luarocks-$LUAROCKS | ||
|
||
curl --location http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | tar xz | ||
|
||
cd $LUAROCKS_BASE | ||
|
||
if [ "$LUA" == "luajit" ]; then | ||
./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR"; | ||
elif [ "$LUA" == "luajit2.0" ]; then | ||
./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR"; | ||
elif [ "$LUA" == "luajit2.1" ]; then | ||
./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.1" --prefix="$LR_HOME_DIR"; | ||
else | ||
./configure --with-lua="$LUA_HOME_DIR" --prefix="$LR_HOME_DIR" | ||
fi | ||
|
||
make build && make install | ||
|
||
ln -s $LR_HOME_DIR/bin/luarocks $HOME/.lua/luarocks | ||
|
||
cd $TRAVIS_BUILD_DIR | ||
|
||
luarocks --version | ||
|
||
rm -rf $LUAROCKS_BASE | ||
|
||
if [ "$LUAJIT" == "yes" ]; then | ||
rm -rf $LUAJIT_BASE; | ||
elif [ "$LUA" == "lua5.1" ]; then | ||
rm -rf lua-5.1.5; | ||
elif [ "$LUA" == "lua5.2" ]; then | ||
rm -rf lua-5.2.4; | ||
elif [ "$LUA" == "lua5.3" ]; then | ||
rm -rf lua-5.3.2; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "lua.h" | ||
|
||
static int ret_true(lua_State *L){ | ||
lua_pushboolean(L, 1); | ||
return 1; | ||
} | ||
|
||
int luaopen_foo_core(lua_State *L){ | ||
lua_newtable(L); | ||
lua_pushcfunction(L, ret_true); | ||
lua_setfield(L, -2, "test_true"); | ||
return 1; | ||
} |
Oops, something went wrong.