language: c

env:
  - LUASUFFIX=5.1 LUAVER=5.1
  - LUASUFFIX=5.2 LUAVER=5.2
  - LUASUFFIX=jit LUAVER=5.1

# Tool setup.
install:
  - sudo apt-get update -qq
  - sudo apt-get install -qq lua5.1 liblua5.1-0-dev
  - sudo apt-get install -qq lua5.2 liblua5.2-dev
  - sudo apt-get install -qq luajit
  - sudo ln -s /usr/bin/luajit-2.0.0-beta9 /usr/bin/luajit
  - sudo rm /usr/bin/lua
  - sudo ln -s /usr/bin/lua$LUASUFFIX /usr/bin/lua
  - lua -v
  - git clone git://github.com/keplerproject/luarocks.git
  - cd luarocks
  - ./configure --lua-version=$LUAVER --lua-suffix=$LUASUFFIX
  - make
  - sudo make install
  - cd ..
  - sudo luarocks install lua-testmore
  - sudo luarocks install lua-coat
  - sudo luarocks install lbc
  - sudo luarocks install luacov-coveralls
  - sudo luarocks install luacheck

# Build and test.
script:
  - make luacheck
  - make LUA=lua$LUASUFFIX test
  - make LUA=lua$LUASUFFIX coveralls

branches:
  only:
    - master

