From fa2e34905b05c2b1ccacabdf4008d0a5ad76dfce Mon Sep 17 00:00:00 2001 From: mpeterv Date: Fri, 4 Dec 2015 13:44:21 +0300 Subject: [PATCH] Add more tests and move them to a script --- .travis.yml | 15 ++------------- test.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 13 deletions(-) create mode 100755 test.sh diff --git a/.travis.yml b/.travis.yml index d76e77e..d0ea4c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: python sudo: false cache: - directories: cache + directories: test/cache python: - "2.7" @@ -16,15 +16,4 @@ install: script: - pyflakes . - pep8 . --max-line-length 99 --ignore E302 - - python hererocks.py here -l 5.3 -r^ --downloads cache --builds cache - - export PATH=$PATH:$PWD/here/bin - - lua -v - - luarocks --version - - luarocks make - - hererocks-test - - rm here -r - - python hererocks.py here -j 2.1 -r^ --downloads cache --builds cache - - lua -v - - luarocks --version - - luarocks make - - hererocks-test + - ./test.sh diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..e629f2f --- /dev/null +++ b/test.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -ev +export PATH="$PWD/test/here/bin:$PATH" +HEREROCKS="python hererocks.py test/here --downloads test/cache --builds test/cache" + +rm test/here -rf +$HEREROCKS -l^ -r^ +lua -v +luarocks --version +luarocks make +hererocks-test | grep "5\.3" +$HEREROCKS -l^ -r^ | grep "already installed" + +rm test/here -rf +$HEREROCKS -j 2.1 -r^ +lua -v +luarocks --version +luarocks make +hererocks-test | grep "2\.1" + +rm test/here -rf +$HEREROCKS -l 5.1 --compat=none +lua -e "assert(not pcall(string.gfind, '', '.'))" +lua -e "(function(...) assert(arg == nil) end)()" +lua -e "assert(math.mod == nil)" + +rm test/here -rf +$HEREROCKS -l 5.3 --compat=none +lua -e "assert(module == nil)"