diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-04 15:21:36 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-09-13 12:16:33 -0400 |
commit | 0adfdc72499ceaeeb859b96c9cef15cf263feff6 (patch) | |
tree | 95d07ab81d249a4b32986b57f0ac15d26b6ff4ee | |
parent | c3e052a979a86cec7465213fc56784f42da186b6 (diff) | |
download | luarocks-0adfdc72499ceaeeb859b96c9cef15cf263feff6.tar.gz luarocks-0adfdc72499ceaeeb859b96c9cef15cf263feff6.tar.bz2 luarocks-0adfdc72499ceaeeb859b96c9cef15cf263feff6.zip |
Tests: add smoke test
-rw-r--r-- | .travis.yml | 22 | ||||
-rwxr-xr-x | makedist | 4 | ||||
-rwxr-xr-x | smoke_test.sh | 55 |
3 files changed, 76 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml index 64d3347a..5d24b4d2 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -11,7 +11,11 @@ cache: | |||
11 | - testrun/testing_server-5.2 | 11 | - testrun/testing_server-5.2 |
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 | 14 | ||
15 | smoke_script: &smoke_script | ||
16 | - ./makedist 3.0.0 | ||
17 | - ./smoke_test.sh luarocks-3.0.0.tar.gz | ||
18 | |||
15 | unit_script: &unit_script | 19 | unit_script: &unit_script |
16 | - busted -o gtest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" | 20 | - busted -o gtest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" |
17 | - busted -o gtest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis,env=full" | 21 | - busted -o gtest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis,env=full" |
@@ -20,12 +24,24 @@ integration_script: &integration_script | |||
20 | - lua -v | 24 | - lua -v |
21 | - if [ "$TRAVIS_OS_NAME" = "linux" ]; then shellcheck ./configure; fi | 25 | - if [ "$TRAVIS_OS_NAME" = "linux" ]; then shellcheck ./configure; fi |
22 | - ./configure --with-lua=lua_install | 26 | - ./configure --with-lua=lua_install |
23 | - ./makedist dev | 27 | - ./makedist 3.0.0 |
24 | - busted -o gtest --exclude-tags=git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" | 28 | - busted -o gtest --exclude-tags=git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" |
25 | - busted -o gtest --exclude-tags=git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis,env=full" | 29 | - busted -o gtest --exclude-tags=git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis,env=full" |
26 | 30 | ||
27 | jobs: | 31 | jobs: |
28 | include: | 32 | include: |
33 | # Smoke tests | ||
34 | - stage: smoke | ||
35 | script: *smoke_script | ||
36 | os: linux | ||
37 | env: | ||
38 | - LUA="lua=5.3" | ||
39 | - stage: smoke | ||
40 | script: *smoke_script | ||
41 | os: osx | ||
42 | language: generic | ||
43 | env: | ||
44 | - LUA="luajit=2.1" | ||
29 | # Unit tests for linux | 45 | # Unit tests for linux |
30 | - stage: unit | 46 | - stage: unit |
31 | script: *unit_script | 47 | script: *unit_script |
@@ -93,14 +93,14 @@ mkdir "release-windows" | |||
93 | mv "$out" "release-windows/$out-win32" | 93 | mv "$out" "release-windows/$out-win32" |
94 | 94 | ||
95 | cd "release-unix/$out" | 95 | cd "release-unix/$out" |
96 | rm -rf makedist install.bat win32 .travis.yml .gitignore appveyor* .appveyor | 96 | rm -rf makedist smoke_test.sh install.bat win32 .travis.yml .gitignore appveyor* .appveyor |
97 | cd .. | 97 | cd .. |
98 | tar czvpf ../"$out.tar.gz" "$out" | 98 | tar czvpf ../"$out.tar.gz" "$out" |
99 | cd .. | 99 | cd .. |
100 | rm -rf "release-unix" | 100 | rm -rf "release-unix" |
101 | 101 | ||
102 | cd "release-windows/$out-win32" | 102 | cd "release-windows/$out-win32" |
103 | rm -rf makedist Makefile GNUmakefile configure .travis.yml .gitignore test appveyor* .appveyor | 103 | rm -rf makedist smoke_test.sh Makefile GNUmakefile configure .travis.yml .gitignore test appveyor* .appveyor |
104 | cd .. | 104 | cd .. |
105 | zip -r ../"$out-win32.zip" "$out-win32" | 105 | zip -r ../"$out-win32.zip" "$out-win32" |
106 | cd .. | 106 | cd .. |
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 | ||