aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-07-04 15:21:36 -0300
committerHisham Muhammad <hisham@gobolinux.org>2019-05-07 17:41:23 -0300
commit171ee9e123d7b7d977d8f4f9d908c35b35dc1b36 (patch)
treebf8a8d667b14f605e70b1bc7522a2eb1d8db63d4
parent923f37301736155e1db07e540bc0e57e211d5380 (diff)
downloadluarocks-171ee9e123d7b7d977d8f4f9d908c35b35dc1b36.tar.gz
luarocks-171ee9e123d7b7d977d8f4f9d908c35b35dc1b36.tar.bz2
luarocks-171ee9e123d7b7d977d8f4f9d908c35b35dc1b36.zip
Tests: add smoke test
-rw-r--r--.travis.yml24
-rwxr-xr-xmakedist4
-rwxr-xr-xsmoke_test.sh55
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
16smoke_script: &smoke_script
17 - ./makedist 3.1.2
18 - ./smoke_test.sh luarocks-3.1.2.tar.gz
19
16unit_script: &unit_script 20unit_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
28jobs: 32jobs:
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
diff --git a/makedist b/makedist
index 9675f7cd..a66fe9bb 100755
--- a/makedist
+++ b/makedist
@@ -95,7 +95,7 @@ mkdir "release-windows"
95mv "$out" "release-windows/$out-win32" 95mv "$out" "release-windows/$out-win32"
96 96
97cd "release-unix/$out" 97cd "release-unix/$out"
98rm -rf makedist install.bat win32 .travis.yml .gitignore appveyor* .appveyor 98rm -rf makedist smoke_test.sh install.bat win32 .travis.yml .gitignore appveyor* .appveyor
99cd .. 99cd ..
100tar czvpf ../"$out.tar.gz" "$out" 100tar czvpf ../"$out.tar.gz" "$out"
101rm -f ../"$out.tar.gz.asc" 101rm -f ../"$out.tar.gz.asc"
@@ -103,7 +103,7 @@ cd ..
103rm -rf "release-unix" 103rm -rf "release-unix"
104 104
105cd "release-windows/$out-win32" 105cd "release-windows/$out-win32"
106rm -rf makedist Makefile GNUmakefile configure .travis.yml .gitignore test appveyor* .appveyor 106rm -rf makedist smoke_test.sh Makefile GNUmakefile configure .travis.yml .gitignore test appveyor* .appveyor
107cd .. 107cd ..
108zip -r ../"$out-win32.zip" "$out-win32" 108zip -r ../"$out-win32.zip" "$out-win32"
109rm -f ../"$out-win32.zip.asc" 109rm -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
3tarball="$1"
4
5rm -rf smoketestdir
6mkdir smoketestdir
7cp "$tarball" smoketestdir
8cd smoketestdir
9
10tar zxvpf "$(basename "$tarball")"
11cd "$(basename "$tarball" .tar.gz)"
12./configure --prefix=foobar
13make
14./luarocks --verbose
15./luarocks --verbose install inspect
16./luarocks --verbose show inspect
17./lua -e 'print(assert(require("inspect")(_G)))'
18make install
19cd foobar
20bin/luarocks --verbose
21bin/luarocks --verbose install inspect
22bin/luarocks --verbose show inspect
23(
24 eval $(bin/luarocks path)
25 lua -e 'print(assert(require("inspect")(_G)))'
26)
27cd ..
28rm -rf foobar
29
30if [ "$2" = "binary" ]
31then
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
44fi
45
46if [ "$3" = "windows" ]
47then
48 make windows-binary
49fi
50
51cd ..
52rm -rf smoketestdir
53echo
54echo "Full test ran and nothing caught fire!"
55echo