language: c

env:
  global:
    - LUAROCKS=2.2.0
  matrix:
    - VARARG=vararg     LUA=lua5.1
    - VARARG=vararg     LUA=lua5.2
    - VARARG=vararg     LUA=lua5.3
    - VARARG=vararg     LUA=luajit
    - VARARG=vararg-lua LUA=lua5.1
    - VARARG=vararg-lua LUA=lua5.2
    - VARARG=vararg-lua LUA=lua5.3
    - VARARG=vararg-lua LUA=luajit

branches:
  only:
    - master

before_install:
  - bash .travis/setup_lua.sh
  - sudo pip install cpp-coveralls

  - git clone https://github.com/moteus/luafilesystem.git luafilesystem
  - cd ./luafilesystem
  - sudo luarocks make rockspecs/luafilesystem-cvs-3.rockspec
  - cd ..
  - sudo luarocks install lua-path --deps-mode=none
  - sudo luarocks install luacov-coveralls

install:
  - sudo luarocks make rockspecs/$VARARG-scm-0.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"

script:
  - cd test
  - lua$LUA_SFX -lluacov test.lua

after_success:
  - if [ $VARARG = "vararg" ]; then
      cd $TRAVIS_BUILD_DIR;
      coveralls -i vararg.c;
    else
      luacov-coveralls;
    fi

notifications:
  email:
    on_success: change
    on_failure: always
language: c

env:
  global:
    - LUAROCKS=2.2.0
  matrix:
    - VARARG=vararg     LUA=lua5.1
    - VARARG=vararg     LUA=lua5.2
    - VARARG=vararg     LUA=lua5.3
    - VARARG=vararg     LUA=luajit
    - VARARG=vararg-lua LUA=lua5.1
    - VARARG=vararg-lua LUA=lua5.2
    - VARARG=vararg-lua LUA=lua5.3
    - VARARG=vararg-lua LUA=luajit

branches:
  only:
    - master

before_install:
  - bash .travis/setup_lua.sh
  - sudo pip install cpp-coveralls

  - sudo luarocks install luafilesystem --from=https://rocks.moonscript.org/dev
  - sudo luarocks install lua-path --deps-mode=none
  - sudo luarocks install luacov-coveralls

install:
  - sudo luarocks make rockspecs/$VARARG-scm-0.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"

script:
  - cd test
  - lua$LUA_SFX -lluacov test.lua

after_success:
  - if [ $VARARG = "vararg" ]; then
      cd $TRAVIS_BUILD_DIR;
      coveralls -i vararg.c;
    else
      luacov-coveralls;
    fi

notifications:
  email:
    on_success: change
    on_failure: always
Use scm version of LuaFileSystem on Travis.
Use scm version of LuaFileSystem on Travis.
