From 0adfdc72499ceaeeb859b96c9cef15cf263feff6 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 4 Jul 2018 15:21:36 -0300 Subject: Tests: add smoke test --- .travis.yml | 22 +++++++++++++++++++--- makedist | 4 ++-- smoke_test.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 5 deletions(-) create mode 100755 smoke_test.sh diff --git a/.travis.yml b/.travis.yml index 64d3347a..5d24b4d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,11 @@ cache: - testrun/testing_server-5.2 - testrun/testing_server-5.3 - testrun/testing_server-2.1 - + +smoke_script: &smoke_script + - ./makedist 3.0.0 + - ./smoke_test.sh luarocks-3.0.0.tar.gz + unit_script: &unit_script - busted -o gtest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" - 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 - lua -v - if [ "$TRAVIS_OS_NAME" = "linux" ]; then shellcheck ./configure; fi - ./configure --with-lua=lua_install - - ./makedist dev + - ./makedist 3.0.0 - busted -o gtest --exclude-tags=git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" - busted -o gtest --exclude-tags=git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis,env=full" - + jobs: include: + # Smoke tests + - stage: smoke + script: *smoke_script + os: linux + env: + - LUA="lua=5.3" + - stage: smoke + script: *smoke_script + os: osx + language: generic + env: + - LUA="luajit=2.1" # Unit tests for linux - stage: unit script: *unit_script diff --git a/makedist b/makedist index 9b737588..fe160468 100755 --- a/makedist +++ b/makedist @@ -93,14 +93,14 @@ mkdir "release-windows" mv "$out" "release-windows/$out-win32" cd "release-unix/$out" -rm -rf makedist install.bat win32 .travis.yml .gitignore appveyor* .appveyor +rm -rf makedist smoke_test.sh install.bat win32 .travis.yml .gitignore appveyor* .appveyor cd .. tar czvpf ../"$out.tar.gz" "$out" cd .. rm -rf "release-unix" cd "release-windows/$out-win32" -rm -rf makedist Makefile GNUmakefile configure .travis.yml .gitignore test appveyor* .appveyor +rm -rf makedist smoke_test.sh Makefile GNUmakefile configure .travis.yml .gitignore test appveyor* .appveyor cd .. zip -r ../"$out-win32.zip" "$out-win32" 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 @@ +#!/bin/sh -e + +tarball="$1" + +rm -rf smoketestdir +mkdir smoketestdir +cp "$tarball" smoketestdir +cd smoketestdir + +tar zxvpf "$(basename "$tarball")" +cd "$(basename "$tarball" .tar.gz)" +./configure --prefix=foobar +make +./luarocks --verbose +./luarocks --verbose install inspect +./luarocks --verbose show inspect +./lua -e 'print(assert(require("inspect")(_G)))' +make install +cd foobar +bin/luarocks --verbose +bin/luarocks --verbose install inspect +bin/luarocks --verbose show inspect +( + eval $(bin/luarocks path) + lua -e 'print(assert(require("inspect")(_G)))' +) +cd .. +rm -rf foobar + +if [ "$2" = "binary" ] +then + make binary + make install-binary + cd foobar + bin/luarocks + bin/luarocks install inspect + bin/luarocks show inspect + ( + eval $(bin/luarocks path) + lua -e 'print(assert(require("inspect")(_G)))' + ) + cd .. + rm -rf foobar +fi + +if [ "$3" = "windows" ] +then + make windows-binary +fi + +cd .. +rm -rf smoketestdir +echo +echo "Full test ran and nothing caught fire!" +echo -- cgit v1.2.3-55-g6feb