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