forked from LuaJIT/LuaJIT
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #3 from softdevteam/travisci
Setup travisci to run the luajit test suite
- Loading branch information
Showing
4 changed files
with
99 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -8,4 +8,5 @@ | |
*.manifest | ||
*.dmp | ||
*.swp | ||
.tags | ||
.tags | ||
test/builds/ |
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,24 @@ | ||
language: c | ||
sudo: false | ||
|
||
addons: | ||
apt: | ||
sources: | ||
- llvm-toolchain-trusty-5.0 | ||
packages: | ||
- clang-5.0 | ||
env: | ||
- MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0" | ||
|
||
before_install: | ||
- eval "${MATRIX_EVAL}" | ||
|
||
before_script: | ||
- ./test/setup.sh | ||
|
||
script: | ||
- make -C test -f test.make normal.test | ||
- make -C test -f test.make gc64.test | ||
- make -C test -f test.make dualnum.test | ||
- make -C test -f test.make nojit.test | ||
|
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,9 @@ | ||
#!/bin/bash | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
cd ${DIR} | ||
|
||
if [ ! -d "testsuite" ]; then | ||
git clone -b lib_apichanges https://github.com/softdevteam/LuaJIT-test-cleanup testsuite | ||
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,64 @@ | ||
.SECONDEXPANSION: | ||
all:: | ||
SRC=../src | ||
|
||
BUILDS= normal gc64 dualnum nojit | ||
normal : XCFLAGS= | ||
gc64 : XCFLAGS=-DLUAJIT_ENABLE_GC64 | ||
dualnum : XCFLAGS=-DLUAJIT_NUMMODE=2 | ||
nojit : XCFLAGS=-DLUAJIT_DISABLE_JIT | ||
|
||
SRC_LUA= $(wildcard $(SRC)/jit/*.lua) | ||
#Skip the dynamically generated VM info file that is generated at compile time | ||
SRC_LUA:= $(filter-out vmdef.lua,$(SRC_LUA)) | ||
LUA_NAMES= $(notdir $(SRC_LUA)) | ||
|
||
define make_buildtarget | ||
$1_BUILD_OUTPUTS= builds/$1/libluajit.so builds/$1/luajit builds/$1/jit/vmdef.lua | ||
$1_LUAFILES= $(addprefix builds/$1/jit/,$(LUA_NAMES)) | ||
$$($1_LUAFILES): $1.copylua | ||
$$($1_BUILD_OUTPUTS): $1.build | ||
$1: $$($1_BUILD_OUTPUTS) $$($1_LUAFILES) | ||
$1: BUILD_TARGET=$1 | ||
BUILD_TARGETS += $1.build | ||
LUA_TARGETS += $1.copylua | ||
TEST_TARGETS += $1.test | ||
CLEAN_TARGETS += $1.clean | ||
endef | ||
|
||
$(foreach build, $(BUILDS), $(eval $(call make_buildtarget,$(build)))) | ||
|
||
.INTERMEDIATE: $(BUILD_TARGETS) $(LUA_TARGETS) | ||
|
||
%.copylua: $(SRC_LUA) | ||
mkdir -p builds/$*/jit/ | ||
$(foreach luafile, $(SRC_LUA), $(eval $(shell cp $(luafile) builds/$*/jit/))) | ||
|
||
%.build: $(SRC)/*.h $(SRC)/*.c | ||
@echo "==== Building LuaJIT target = ${BUILD_TARGET} ====" | ||
$(MAKE) -C $(SRC) -j XCFLAGS="-DLUAJIT_ENABLE_LUA52COMPAT ${XCFLAGS}" | ||
mkdir -p builds/${BUILD_TARGET}/ | ||
cp $(SRC)/luajit builds/${BUILD_TARGET}/ | ||
cp $(SRC)/libluajit.so builds/${BUILD_TARGET}/ | ||
mkdir -p builds/${BUILD_TARGET}/jit/ | ||
cp $(SRC)/jit/vmdef.lua builds/${BUILD_TARGET}/jit/ | ||
$(MAKE) -C $(SRC) clean | ||
@echo "==== Successfully built LuaJIT ====" | ||
|
||
build : $(BUILDS) | ||
|
||
all test:: $(TEST_TARGETS) | ||
|
||
#Builds the binaries if they don't exist first | ||
%.test: $$* | ||
./builds/$*/luajit testsuite/test/test.lua | ||
|
||
%.clean: | ||
rm -f ./builds/$*/luajit | ||
rm -f ./builds/$*/libluajit.so | ||
rm -f ./builds/$*/jit/*.lua | ||
|
||
clean: $(CLEAN_TARGETS) | ||
$(MAKE) -C $(SRC) clean | ||
|
||
.PHONY: all build test clean $(BUILDS) |