diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2019-06-06 16:37:13 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-06-06 16:45:04 -0300 |
| commit | 01a3a26ca169de04673bc73c5205eb9d43d66805 (patch) | |
| tree | 8fa136466a49625846ccc2f14e51b28b45f7b0d0 | |
| parent | b522656085991297b3ccd0793b5d744653b24dfe (diff) | |
| download | luarocks-01a3a26ca169de04673bc73c5205eb9d43d66805.tar.gz luarocks-01a3a26ca169de04673bc73c5205eb9d43d66805.tar.bz2 luarocks-01a3a26ca169de04673bc73c5205eb9d43d66805.zip | |
Add smoke test
| -rw-r--r-- | .travis.yml | 19 | ||||
| -rwxr-xr-x | smoke_test.sh | 55 |
2 files changed, 74 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index aca8460a..72b74825 100644 --- a/.travis.yml +++ b/.travis.yml | |||
| @@ -12,6 +12,11 @@ cache: | |||
| 12 | - testrun/testing_server-5.3 | 12 | - testrun/testing_server-5.3 |
| 13 | - testrun/testing_server-2.1 | 13 | - testrun/testing_server-2.1 |
| 14 | - testrun/binary-samples | 14 | - testrun/binary-samples |
| 15 | |||
| 16 | smoke_script: &smoke_script | ||
| 17 | - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) | ||
| 18 | - ./makedist $BRANCH | ||
| 19 | - ./smoke_test.sh luarocks-$BRANCH.tar.gz | ||
| 15 | 20 | ||
| 16 | unit_script: &unit_script | 21 | unit_script: &unit_script |
| 17 | - busted -o gtest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" | 22 | - busted -o gtest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" |
| @@ -27,6 +32,20 @@ integration_script: &integration_script | |||
| 27 | 32 | ||
| 28 | jobs: | 33 | jobs: |
| 29 | include: | 34 | include: |
| 35 | # Smoke tests for release branches | ||
| 36 | - stage: smoke | ||
| 37 | if: branch =~ [0-9].* | ||
| 38 | script: *smoke_script | ||
| 39 | os: linux | ||
| 40 | env: | ||
| 41 | - LUA="lua=5.3" | ||
| 42 | - stage: smoke | ||
| 43 | if: branch =~ [0-9].* | ||
| 44 | script: *smoke_script | ||
| 45 | os: osx | ||
| 46 | language: generic | ||
| 47 | env: | ||
| 48 | - LUA="luajit=2.1" | ||
| 30 | # Unit tests for linux | 49 | # Unit tests for linux |
| 31 | - stage: Unit on Linux | 50 | - stage: Unit on Linux |
| 32 | script: *unit_script | 51 | script: *unit_script |
diff --git a/smoke_test.sh b/smoke_test.sh new file mode 100755 index 00000000..e57a8d02 --- /dev/null +++ b/smoke_test.sh | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | #!/bin/sh -e | ||
| 2 | |||
| 3 | tarball="$1" | ||
| 4 | |||
| 5 | rm -rf smoketestdir | ||
| 6 | mkdir smoketestdir | ||
| 7 | cp "$tarball" smoketestdir | ||
| 8 | cd smoketestdir | ||
| 9 | |||
| 10 | tar zxvpf "$(basename "$tarball")" | ||
| 11 | cd "$(basename "$tarball" .tar.gz)" | ||
| 12 | ./configure --prefix=foobar | ||
| 13 | make | ||
| 14 | ./luarocks --verbose | ||
| 15 | ./luarocks --verbose install inspect | ||
| 16 | ./luarocks --verbose show inspect | ||
| 17 | ./lua -e 'print(assert(require("inspect")(_G)))' | ||
| 18 | make install | ||
| 19 | cd foobar | ||
| 20 | bin/luarocks --verbose | ||
| 21 | bin/luarocks --verbose install inspect | ||
| 22 | bin/luarocks --verbose show inspect | ||
| 23 | ( | ||
| 24 | eval $(bin/luarocks path) | ||
| 25 | lua -e 'print(assert(require("inspect")(_G)))' | ||
| 26 | ) | ||
| 27 | cd .. | ||
| 28 | rm -rf foobar | ||
| 29 | |||
| 30 | if [ "$2" = "binary" ] | ||
| 31 | then | ||
| 32 | make binary | ||
| 33 | make install-binary | ||
| 34 | cd foobar | ||
| 35 | bin/luarocks | ||
| 36 | bin/luarocks install inspect | ||
| 37 | bin/luarocks show inspect | ||
| 38 | ( | ||
| 39 | eval $(bin/luarocks path) | ||
| 40 | lua -e 'print(assert(require("inspect")(_G)))' | ||
| 41 | ) | ||
| 42 | cd .. | ||
| 43 | rm -rf foobar | ||
| 44 | fi | ||
| 45 | |||
| 46 | if [ "$3" = "windows" ] | ||
| 47 | then | ||
| 48 | make windows-binary | ||
| 49 | fi | ||
| 50 | |||
| 51 | cd .. | ||
| 52 | rm -rf smoketestdir | ||
| 53 | echo | ||
| 54 | echo "Full test ran and nothing caught fire!" | ||
| 55 | echo | ||
