summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-07-04 15:21:36 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-09-13 12:16:33 -0400
commit0adfdc72499ceaeeb859b96c9cef15cf263feff6 (patch)
tree95d07ab81d249a4b32986b57f0ac15d26b6ff4ee
parentc3e052a979a86cec7465213fc56784f42da186b6 (diff)
downloadluarocks-0adfdc72499ceaeeb859b96c9cef15cf263feff6.tar.gz
luarocks-0adfdc72499ceaeeb859b96c9cef15cf263feff6.tar.bz2
luarocks-0adfdc72499ceaeeb859b96c9cef15cf263feff6.zip
Tests: add smoke test
-rw-r--r--.travis.yml22
-rwxr-xr-xmakedist4
-rwxr-xr-xsmoke_test.sh55
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
15smoke_script: &smoke_script
16 - ./makedist 3.0.0
17 - ./smoke_test.sh luarocks-3.0.0.tar.gz
18
15unit_script: &unit_script 19unit_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
27jobs: 31jobs:
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
diff --git a/makedist b/makedist
index 9b737588..fe160468 100755
--- a/makedist
+++ b/makedist
@@ -93,14 +93,14 @@ mkdir "release-windows"
93mv "$out" "release-windows/$out-win32" 93mv "$out" "release-windows/$out-win32"
94 94
95cd "release-unix/$out" 95cd "release-unix/$out"
96rm -rf makedist install.bat win32 .travis.yml .gitignore appveyor* .appveyor 96rm -rf makedist smoke_test.sh install.bat win32 .travis.yml .gitignore appveyor* .appveyor
97cd .. 97cd ..
98tar czvpf ../"$out.tar.gz" "$out" 98tar czvpf ../"$out.tar.gz" "$out"
99cd .. 99cd ..
100rm -rf "release-unix" 100rm -rf "release-unix"
101 101
102cd "release-windows/$out-win32" 102cd "release-windows/$out-win32"
103rm -rf makedist Makefile GNUmakefile configure .travis.yml .gitignore test appveyor* .appveyor 103rm -rf makedist smoke_test.sh Makefile GNUmakefile configure .travis.yml .gitignore test appveyor* .appveyor
104cd .. 104cd ..
105zip -r ../"$out-win32.zip" "$out-win32" 105zip -r ../"$out-win32.zip" "$out-win32"
106cd .. 106cd ..
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